From 13b1614e111dcb86c58b553005d512722ff4db8b Mon Sep 17 00:00:00 2001 From: David Rosca Date: Thu, 25 Sep 2014 14:13:26 +0200 Subject: [PATCH] Use std::sort instead of obsolete qSort --- src/lib/app/browserwindow.cpp | 2 +- src/lib/navigation/completer/locationcompleterdelegate.cpp | 4 ++-- src/lib/navigation/completer/locationcompleterrefreshjob.cpp | 2 +- .../GnomeKeyringPasswords/gnomekeyringpasswordbackend.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index 5784647ab..a5498c2f2 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -399,7 +399,7 @@ void BrowserWindow::createEncodingSubMenu(const QString &name, QStringList &code return; } - /// TODO: Alphanumeric sorting: QCollator (5.2+) or http://www.davekoelle.com/alphanum.html + // TODO: Alphanumeric sorting: QCollator (5.2+) or http://www.davekoelle.com/alphanum.html std::sort(codecNames.begin(), codecNames.end()); QMenu* subMenu = new QMenu(name, menu); diff --git a/src/lib/navigation/completer/locationcompleterdelegate.cpp b/src/lib/navigation/completer/locationcompleterdelegate.cpp index 2468c43ea..0a3ffdd66 100644 --- a/src/lib/navigation/completer/locationcompleterdelegate.cpp +++ b/src/lib/navigation/completer/locationcompleterdelegate.cpp @@ -237,7 +237,7 @@ void LocationCompleterDelegate::viewItemDrawText(QPainter *p, const QStyleOption QList delimiters; QStringList searchStrings = searchText.split(QLatin1Char(' '), QString::SkipEmptyParts); // Look for longer parts first - qSort(searchStrings.begin(), searchStrings.end(), sizeBiggerThan); + std::sort(searchStrings.begin(), searchStrings.end(), sizeBiggerThan); foreach (const QString &string, searchStrings) { int delimiter = text.indexOf(string, 0, Qt::CaseInsensitive); @@ -265,7 +265,7 @@ void LocationCompleterDelegate::viewItemDrawText(QPainter *p, const QStyleOption } // We need to sort delimiters to properly paint all parts that user typed - qSort(delimiters); + std::sort(delimiters.begin(), delimiters.end()); // If we don't find any match, just paint it without any highlight if (!delimiters.isEmpty() && !(delimiters.count() % 2)) { diff --git a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp index 7ce27a645..4bf9ba496 100644 --- a/src/lib/navigation/completer/locationcompleterrefreshjob.cpp +++ b/src/lib/navigation/completer/locationcompleterrefreshjob.cpp @@ -159,7 +159,7 @@ void LocationCompleterRefreshJob::completeFromHistory() } // Sort by count - qSort(m_items.begin(), m_items.end(), countBiggerThan); + std::sort(m_items.begin(), m_items.end(), countBiggerThan); // Search in history if (showType == HistoryAndBookmarks || showType == History) { diff --git a/src/plugins/GnomeKeyringPasswords/gnomekeyringpasswordbackend.cpp b/src/plugins/GnomeKeyringPasswords/gnomekeyringpasswordbackend.cpp index 9f3caa15a..fc82974ff 100644 --- a/src/plugins/GnomeKeyringPasswords/gnomekeyringpasswordbackend.cpp +++ b/src/plugins/GnomeKeyringPasswords/gnomekeyringpasswordbackend.cpp @@ -99,7 +99,7 @@ QVector GnomeKeyringPasswordBackend::getEntries(const QUrl &url) } // Sort to prefer last updated entries - qSort(list.begin(), list.end()); + std::sort(list.begin(), list.end()); return list; }