summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.vuorela@jolla.com>2018-08-15 11:59:21 +0300
committerPekka Vuorela <pvuorela@iki.fi>2018-08-16 07:48:29 +0000
commit26594420e157878e4bb187e3441dc7df6877652b (patch)
tree4bdaa769b6794b6dc8bd5e4927a7a5309835c1b1
parent4d66cabe407abedae21a635fcc055119ec6f664d (diff)
Replace deprecated qSort/qLowerBound/qGreater with std methods
Change-Id: Ia3913b998f3686d6f047d02d8781a7297b018bbd Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
-rw-r--r--examples/qtmail/selectcomposerwidget.cpp2
-rw-r--r--src/libraries/qmfclient/qmailaccountlistmodel.cpp2
-rw-r--r--src/libraries/qmfclient/qmailmessagelistmodel.cpp10
-rw-r--r--src/libraries/qmfclient/qmailmessagethreadedmodel.cpp2
-rw-r--r--src/libraries/qmfclient/qmailthreadlistmodel.cpp2
-rw-r--r--src/libraries/qmfclient/support/qcharsetdetector.cpp6
-rw-r--r--src/plugins/messageservices/imap/imapstrategy.cpp6
7 files changed, 15 insertions, 15 deletions
diff --git a/examples/qtmail/selectcomposerwidget.cpp b/examples/qtmail/selectcomposerwidget.cpp
index 0ac3b3f1..62b2c292 100644
--- a/examples/qtmail/selectcomposerwidget.cpp
+++ b/examples/qtmail/selectcomposerwidget.cpp
@@ -244,7 +244,7 @@ void SelectComposerWidget::refresh()
if (_sendTypes.contains(type))
options.append(qMakePair(key, type));
- qSort(options.begin(), options.end(), compareOptionsByType);
+ std::sort(options.begin(), options.end(), compareOptionsByType);
foreach (const OptionType &option, options)
(void)new SelectListWidgetItem(option.first, option.second, m_listWidget);
diff --git a/src/libraries/qmfclient/qmailaccountlistmodel.cpp b/src/libraries/qmfclient/qmailaccountlistmodel.cpp
index 23b08b26..28f566cb 100644
--- a/src/libraries/qmfclient/qmailaccountlistmodel.cpp
+++ b/src/libraries/qmfclient/qmailaccountlistmodel.cpp
@@ -147,7 +147,7 @@ int QMailAccountListModelPrivate::indexOf(const QMailAccountId& id) const
template<typename Comparator>
QMailAccountIdList::iterator QMailAccountListModelPrivate::lowerBound(const QMailAccountId& id, Comparator& cmp) const
{
- return qLowerBound(idList.begin(), idList.end(), id, cmp);
+ return std::lower_bound(idList.begin(), idList.end(), id, cmp);
}
diff --git a/src/libraries/qmfclient/qmailmessagelistmodel.cpp b/src/libraries/qmfclient/qmailmessagelistmodel.cpp
index 6aa1a79b..550e6e22 100644
--- a/src/libraries/qmfclient/qmailmessagelistmodel.cpp
+++ b/src/libraries/qmfclient/qmailmessagelistmodel.cpp
@@ -350,7 +350,7 @@ bool QMailMessageListModelPrivate::appendMessages(const QMailMessageIdList &idsT
}
}
- qSort(insertIndices);
+ std::sort(insertIndices.begin(), insertIndices.end());
foreach (int index, insertIndices) {
// Since the list is ordered, if index is bigger than the limit
// we stop inserting
@@ -460,7 +460,7 @@ bool QMailMessageListModelPrivate::updateMessages(const QMailMessageIdList &ids)
}
// Sort the lists to yield ascending order
- qSort(removeIndices);
+ std::sort(removeIndices.begin(), removeIndices.end());
for (int i = removeIndices.count(); i > 0; --i) {
int index = removeIndices[i - 1];
_model.emitBeginRemoveRows(QModelIndex(), index, index);
@@ -468,7 +468,7 @@ bool QMailMessageListModelPrivate::updateMessages(const QMailMessageIdList &ids)
_model.emitEndRemoveRows();
}
- qSort(insertIndices);
+ std::sort(insertIndices.begin(), insertIndices.end());
foreach (int index, insertIndices) {
// Since the list is ordered, if index is bigger than the limit
// we stop inserting
@@ -486,7 +486,7 @@ bool QMailMessageListModelPrivate::updateMessages(const QMailMessageIdList &ids)
removeMessages(idsToRemove);
}
- qSort(updateIndices);
+ std::sort(updateIndices.begin(), updateIndices.end());
foreach (int index, updateIndices) {
_model.emitDataChanged(_model.index(index, 0, QModelIndex()), _model.index(index, _model.columnCount() - 1, QModelIndex()));
}
@@ -528,7 +528,7 @@ bool QMailMessageListModelPrivate::removeMessages(const QMailMessageIdList &ids)
}
// Sort the indices to yield ascending order (they must be deleted in descending order!)
- qSort(removeIndices);
+ std::sort(removeIndices.begin(), removeIndices.end());
for (int i = removeIndices.count(); i > 0; --i) {
int index = removeIndices.at(i - 1);
diff --git a/src/libraries/qmfclient/qmailmessagethreadedmodel.cpp b/src/libraries/qmfclient/qmailmessagethreadedmodel.cpp
index 343790d4..248fac69 100644
--- a/src/libraries/qmfclient/qmailmessagethreadedmodel.cpp
+++ b/src/libraries/qmfclient/qmailmessagethreadedmodel.cpp
@@ -389,7 +389,7 @@ bool QMailMessageThreadedModelPrivate::appendMessages(const QMailMessageIdList &
if (validIndices.isEmpty())
return true;
- qSort(validIndices);
+ std::sort(validIndices.begin(), validIndices.end());
QMailMessageIdList additionIds;
foreach (int index, validIndices) {
diff --git a/src/libraries/qmfclient/qmailthreadlistmodel.cpp b/src/libraries/qmfclient/qmailthreadlistmodel.cpp
index 193ee0d1..b2541b53 100644
--- a/src/libraries/qmfclient/qmailthreadlistmodel.cpp
+++ b/src/libraries/qmfclient/qmailthreadlistmodel.cpp
@@ -145,7 +145,7 @@ int QMailThreadListModelPrivate::indexOf(const QMailThreadId& id) const
template<typename Comparator>
QMailThreadIdList::iterator QMailThreadListModelPrivate::lowerBound(const QMailThreadId& id, Comparator& cmp) const
{
- return qLowerBound(idList.begin(), idList.end(), id, cmp);
+ return std::lower_bound(idList.begin(), idList.end(), id, cmp);
}
diff --git a/src/libraries/qmfclient/support/qcharsetdetector.cpp b/src/libraries/qmfclient/support/qcharsetdetector.cpp
index e71cad36..43f23151 100644
--- a/src/libraries/qmfclient/support/qcharsetdetector.cpp
+++ b/src/libraries/qmfclient/support/qcharsetdetector.cpp
@@ -589,8 +589,8 @@ QList<QCharsetMatch> QCharsetDetector::detectAll()
}
// sort the list of matches again if confidences have been changed:
if(sortNeeded)
- qSort(qCharsetMatchList.begin(), qCharsetMatchList.end(),
- qGreater<QCharsetMatch>());
+ std::sort(qCharsetMatchList.begin(), qCharsetMatchList.end(),
+ std::greater<QCharsetMatch>());
if(qCharsetMatchList.isEmpty()) {
// is there any better status to describe this case?
d->_status = U_CE_NOT_FOUND_ERROR;
@@ -781,7 +781,7 @@ QStringList QCharsetDetector::getAllDetectableCharsets()
d->_allDetectableCharsets << cs;
}
- qSort(d->_allDetectableCharsets);
+ std::sort(d->_allDetectableCharsets.begin(), d->_allDetectableCharsets.end());
return d->_allDetectableCharsets;
}
diff --git a/src/plugins/messageservices/imap/imapstrategy.cpp b/src/plugins/messageservices/imap/imapstrategy.cpp
index 9dd792c6..7380818f 100644
--- a/src/plugins/messageservices/imap/imapstrategy.cpp
+++ b/src/plugins/messageservices/imap/imapstrategy.cpp
@@ -1193,7 +1193,7 @@ void ImapMessageListStrategy::resetMessageListTraversal()
_folderItr = _selectionMap.begin();
if (_folderItr != _selectionMap.end()) {
FolderSelections &folder(*_folderItr);
- qSort(folder.begin(), folder.end(), messageSelectorLessThan);
+ std::sort(folder.begin(), folder.end(), messageSelectorLessThan);
_selectionItr = folder.begin();
}
@@ -1224,7 +1224,7 @@ bool ImapMessageListStrategy::selectNextMessageSequence(ImapStrategyContextBase
break;
FolderSelections &folder(*_folderItr);
- qSort(folder.begin(), folder.end(), messageSelectorLessThan);
+ std::sort(folder.begin(), folder.end(), messageSelectorLessThan);
_selectionItr = folder.begin();
selectionEnd = folder.end();
@@ -1477,7 +1477,7 @@ void ImapFetchSelectedMessagesStrategy::prepareCompletionList(
sectionList, completionSectionList,
preferredBody, bytesLeft);
- qSort(sectionList.begin(), sectionList.end(), qMailMessageImapStrategyLessThan);
+ std::sort(sectionList.begin(), sectionList.end(), qMailMessageImapStrategyLessThan);
QList<QPair<QMailMessagePart::Location, uint> >::iterator it = sectionList.begin();
while (it != sectionList.end() && (bytesLeft > 0) && (partsToRetrieve < maxParts)) {
const QMailMessagePart &part = message.partAt(it->first);