1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Use std::sort instead of obsolete qSort

This commit is contained in:
David Rosca 2014-09-25 14:13:26 +02:00
parent 767e01fd22
commit 13b1614e11
4 changed files with 5 additions and 5 deletions

View File

@ -399,7 +399,7 @@ void BrowserWindow::createEncodingSubMenu(const QString &name, QStringList &code
return; 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()); std::sort(codecNames.begin(), codecNames.end());
QMenu* subMenu = new QMenu(name, menu); QMenu* subMenu = new QMenu(name, menu);

View File

@ -237,7 +237,7 @@ void LocationCompleterDelegate::viewItemDrawText(QPainter *p, const QStyleOption
QList<int> delimiters; QList<int> delimiters;
QStringList searchStrings = searchText.split(QLatin1Char(' '), QString::SkipEmptyParts); QStringList searchStrings = searchText.split(QLatin1Char(' '), QString::SkipEmptyParts);
// Look for longer parts first // Look for longer parts first
qSort(searchStrings.begin(), searchStrings.end(), sizeBiggerThan); std::sort(searchStrings.begin(), searchStrings.end(), sizeBiggerThan);
foreach (const QString &string, searchStrings) { foreach (const QString &string, searchStrings) {
int delimiter = text.indexOf(string, 0, Qt::CaseInsensitive); 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 // 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 we don't find any match, just paint it without any highlight
if (!delimiters.isEmpty() && !(delimiters.count() % 2)) { if (!delimiters.isEmpty() && !(delimiters.count() % 2)) {

View File

@ -159,7 +159,7 @@ void LocationCompleterRefreshJob::completeFromHistory()
} }
// Sort by count // Sort by count
qSort(m_items.begin(), m_items.end(), countBiggerThan); std::sort(m_items.begin(), m_items.end(), countBiggerThan);
// Search in history // Search in history
if (showType == HistoryAndBookmarks || showType == History) { if (showType == HistoryAndBookmarks || showType == History) {

View File

@ -99,7 +99,7 @@ QVector<PasswordEntry> GnomeKeyringPasswordBackend::getEntries(const QUrl &url)
} }
// Sort to prefer last updated entries // Sort to prefer last updated entries
qSort(list.begin(), list.end()); std::sort(list.begin(), list.end());
return list; return list;
} }