Replace deprecated qSort with std::sort
authorJanne Koschinski <janne@kuschku.de>
Mon, 5 Aug 2019 10:30:19 +0000 (12:30 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Aug 2019 19:45:23 +0000 (21:45 +0200)
src/client/clientbacklogmanager.cpp
src/client/messagefilter.cpp
src/client/messagemodel.cpp
src/client/networkmodel.cpp
src/core/coresessioneventprocessor.cpp
src/qtui/chatview.cpp
src/qtui/chatviewsearchcontroller.cpp
src/qtui/settingspages/bufferviewsettingspage.cpp
src/qtui/settingspages/corehighlightsettingspage.cpp
src/qtui/settingspages/highlightsettingspage.cpp

index cf6ab5d..75ed87a 100644 (file)
@@ -164,7 +164,7 @@ void ClientBacklogManager::dispatchMessages(const MessageList& messages, bool so
 
     clock_t start_t = clock();
     if (sort)
-        qSort(msgs);
+        std::sort(msgs.begin(), msgs.end());
     Client::messageProcessor()->process(msgs);
     clock_t end_t = clock();
 
index 10c9aa0..49676e3 100644 (file)
@@ -115,7 +115,7 @@ QString MessageFilter::idString() const
         return "*";
 
     QList<BufferId> bufferIds = _validBuffers.toList();
-    qSort(bufferIds);
+    std::sort(bufferIds.begin(), bufferIds.end());
 
     QStringList bufferIdStrings;
     foreach (BufferId id, bufferIds)
index e39c7a3..fcd7acb 100644 (file)
@@ -105,13 +105,13 @@ void MessageModel::insertMessages(const QList<Message>& msglist)
             else {
                 _messageBuffer = msglist.mid(processedMsgs);
             }
-            qSort(_messageBuffer);
+            std::sort(_messageBuffer.begin(), _messageBuffer.end());
             QCoreApplication::postEvent(this, new ProcessBufferEvent());
         }
     }
     else {
         _messageBuffer << msglist;
-        qSort(_messageBuffer);
+        std::sort(_messageBuffer.begin(), _messageBuffer.end());
     }
 }
 
index 17a9aaa..4713932 100644 (file)
@@ -1605,7 +1605,7 @@ void NetworkModel::sortBufferIds(QList<BufferId>& bufferIds) const
             bufferItems << _bufferItemCache[bufferId];
     }
 
-    qSort(bufferItems.begin(), bufferItems.end(), bufferItemLessThan);
+    std::sort(bufferItems.begin(), bufferItems.end(), bufferItemLessThan);
 
     bufferIds.clear();
     foreach (BufferItem* bufferItem, bufferItems) {
index af30bfb..86b4cde 100644 (file)
@@ -1536,7 +1536,7 @@ void CoreSessionEventProcessor::handleCtcpClientinfo(CtcpEvent* e)
     QStringList supportedHandlers;
     for (const QString& handler : providesHandlers())
         supportedHandlers << handler.toUpper();
-    qSort(supportedHandlers);
+    std::sort(supportedHandlers.begin(), supportedHandlers.end());
     e->setReply(supportedHandlers.join(" "));
 }
 
index 3a432bf..df25b1a 100644 (file)
@@ -292,7 +292,7 @@ QSet<ChatLine*> ChatView::visibleChatLines(Qt::ItemSelectionMode mode) const
 QList<ChatLine*> ChatView::visibleChatLinesSorted(Qt::ItemSelectionMode mode) const
 {
     QList<ChatLine*> result = visibleChatLines(mode).toList();
-    qSort(result.begin(), result.end(), chatLinePtrLessThan);
+    std::sort(result.begin(), result.end(), chatLinePtrLessThan);
     return result;
 }
 
index b81e261..f53cbc6 100644 (file)
@@ -330,7 +330,7 @@ void ChatViewSearchController::repositionHighlights(ChatLine* line)
         }
     }
 
-    qSort(searchHighlights.begin(), searchHighlights.end(), SearchHighlightItem::firstInLine);
+    std::sort(searchHighlights.begin(), searchHighlights.end(), SearchHighlightItem::firstInLine);
 
     Q_ASSERT(wordPos.count() == searchHighlights.count());
     for (int i = 0; i < searchHighlights.count(); i++) {
index 1097dff..aa31d52 100644 (file)
@@ -248,7 +248,7 @@ void BufferViewSettingsPage::newBufferView(const QString& bufferViewName)
         }
         else {
             bufferIds = Client::networkModel()->allBufferIds();
-            qSort(bufferIds);
+            std::sort(bufferIds.begin(), bufferIds.end());
             config->setProperty("OriginalBufferList", toVariantList<BufferId>(bufferIds));
         }
     }
index 9707c70..46b9dd9 100644 (file)
@@ -420,7 +420,7 @@ void CoreHighlightSettingsPage::removeSelectedHighlightRows()
     for (auto selectedItem : selectedItemList) {
         selectedRows.append(selectedItem->row());
     }
-    qSort(selectedRows.begin(), selectedRows.end(), qGreater<int>());
+    std::sort(selectedRows.begin(), selectedRows.end(), std::greater<>());
     int lastRow = -1;
     for (auto row : selectedRows) {
         if (row != lastRow) {
@@ -438,7 +438,7 @@ void CoreHighlightSettingsPage::removeSelectedIgnoredRows()
     for (auto selectedItem : selectedItemList) {
         selectedRows.append(selectedItem->row());
     }
-    qSort(selectedRows.begin(), selectedRows.end(), qGreater<int>());
+    std::sort(selectedRows.begin(), selectedRows.end(), std::greater<>());
     int lastRow = -1;
     for (auto row : selectedRows) {
         if (row != lastRow) {
index 1a6a51a..3eebd91 100644 (file)
@@ -197,7 +197,7 @@ void HighlightSettingsPage::removeSelectedRows()
     foreach (QTableWidgetItem* selectedItem, selectedItemList) {
         selectedRows.append(selectedItem->row());
     }
-    qSort(selectedRows.begin(), selectedRows.end(), qGreater<int>());
+    std::sort(selectedRows.begin(), selectedRows.end(), std::greater<>());
     int lastRow = -1;
     foreach (int row, selectedRows) {
         if (row != lastRow) {