Remove credential sorting from Browser Integration (#6353)

This commit is contained in:
Sami Vänttinen authored and GitHub committed 2021-03-31 23:14:29 -04:00
1 parent 439c155552
commit c19efb5b19
9 files changed
+4 -97

No files matched your search

+2 -7
View File
@@ -750,14 +750,9 @@ BrowserService::sortEntries(QList<Entry*>& pwEntries, const QString& siteUrlStr,
std::sort(keys.begin(), keys.end(), [](int l, int r) { return l > r; });
QList<Entry*> results;
auto sortField = browserSettings()->sortByTitle() ? EntryAttributes::TitleKey : EntryAttributes::UserNameKey;
for (auto key : keys) {
// Sort same priority entries by Title or UserName
auto entries = priorities.values(key);
std::sort(entries.begin(), entries.end(), [&sortField](Entry* left, Entry* right) {
return QString::localeAwareCompare(left->attribute(sortField), right->attribute(sortField)) < 0;
});
results << entries;
results << priorities.values(key);
if (browserSettings()->bestMatchOnly() && !results.isEmpty()) {
// Early out once we find the highest batch of matches
break;
-20
View File
@@ -82,26 +82,6 @@ void BrowserSettings::setMatchUrlScheme(bool matchUrlScheme)
config()->set(Config::Browser_MatchUrlScheme, matchUrlScheme);
}
bool BrowserSettings::sortByUsername()
{
return config()->get(Config::Browser_SortByUsername).toBool();
}
void BrowserSettings::setSortByUsername(bool sortByUsername)
{
config()->set(Config::Browser_SortByUsername, sortByUsername);
}
bool BrowserSettings::sortByTitle()
{
return !sortByUsername();
}
void BrowserSettings::setSortByTitle(bool sortByUsertitle)
{
setSortByUsername(!sortByUsertitle);
}
bool BrowserSettings::alwaysAllowAccess()
{
return config()->get(Config::Browser_AlwaysAllowAccess).toBool();
-4
View File
@@ -42,10 +42,6 @@ public:
void setUnlockDatabase(bool unlockDatabase);
bool matchUrlScheme();
void setMatchUrlScheme(bool matchUrlScheme);
bool sortByUsername();
void setSortByUsername(bool sortByUsername = true);
bool sortByTitle();
void setSortByTitle(bool sortByUsertitle = true);
bool alwaysAllowAccess();
void setAlwaysAllowAccess(bool alwaysAllowAccess);
bool alwaysAllowUpdate();
-7
View File
@@ -117,12 +117,6 @@ void BrowserSettingsWidget::loadSettings()
// TODO: fix this
m_ui->showNotification->hide();
if (settings->sortByUsername()) {
m_ui->sortByUsername->setChecked(true);
} else {
m_ui->sortByTitle->setChecked(true);
}
m_ui->alwaysAllowAccess->setChecked(settings->alwaysAllowAccess());
m_ui->alwaysAllowUpdate->setChecked(settings->alwaysAllowUpdate());
m_ui->httpAuthPermission->setChecked(settings->httpAuthPermission());
@@ -212,7 +206,6 @@ void BrowserSettingsWidget::saveSettings()
settings->setBestMatchOnly(m_ui->bestMatchOnly->isChecked());
settings->setUnlockDatabase(m_ui->unlockDatabase->isChecked());
settings->setMatchUrlScheme(m_ui->matchUrlScheme->isChecked());
settings->setSortByUsername(m_ui->sortByUsername->isChecked());
settings->setUseCustomProxy(m_ui->useCustomProxy->isChecked());
settings->setCustomProxyLocation(m_ui->customProxyLocation->text());
-14
View File
@@ -246,20 +246,6 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="sortByTitle">
<property name="text">
<string extracomment="Credentials mean login data requested via browser extension">Sort matching credentials by title</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="sortByUsername">
<property name="text">
<string extracomment="Credentials mean login data requested via browser extension">Sort matching credentials by username</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
-1
View File
@@ -147,7 +147,6 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::Browser_BestMatchOnly, {QS("Browser/BestMatchOnly"), Roaming, false}},
{Config::Browser_UnlockDatabase, {QS("Browser/UnlockDatabase"), Roaming, true}},
{Config::Browser_MatchUrlScheme, {QS("Browser/MatchUrlScheme"), Roaming, true}},
{Config::Browser_SortByUsername, {QS("Browser/SortByUsername"), Roaming, false}},
{Config::Browser_SupportBrowserProxy, {QS("Browser/SupportBrowserProxy"), Roaming, true}},
{Config::Browser_UseCustomProxy, {QS("Browser/UseCustomProxy"), Roaming, false}},
{Config::Browser_CustomProxyLocation, {QS("Browser/CustomProxyLocation"), Roaming, {}}},
-1
View File
@@ -127,7 +127,6 @@ public:
Browser_BestMatchOnly,
Browser_UnlockDatabase,
Browser_MatchUrlScheme,
Browser_SortByUsername,
Browser_SupportBrowserProxy,
Browser_UseCustomProxy,
Browser_CustomProxyLocation,