Commit 39d0e2d8 authored by Jonathan Marten's avatar Jonathan Marten
Browse files

Port deprecated qSort() -> std::sort(), qStableSort() -> std::stable_sort()

parent 438ec374
Pipeline #170745 failed with stage
in 4 minutes and 26 seconds
......@@ -97,7 +97,7 @@ AddAccountWizard::AddAccountWizard(QWidget *parent, bool firstRun)
// add the available messenger services to the dialogs list
QList<KPluginInfo> protocols = Kopete::PluginManager::self()->availablePlugins(QStringLiteral("Protocols"));
qSort(protocols);
std::sort(protocols.begin(), protocols.end());
for (QList<KPluginInfo>::Iterator it = protocols.begin(); it != protocols.end(); ++it) {
QTreeWidgetItem *pluginItem = new QTreeWidgetItem(d->uiSelectService.protocolListView);
pluginItem->setIcon(0, QIcon(SmallIcon(it->icon())));
......
......@@ -150,7 +150,7 @@ void KopeteAccountConfig::load()
// Sort by priority, the priority is take from identity accounts because identity doesn't have priority
QList<Kopete::Identity *> identityList = Kopete::IdentityManager::self()->identities();
qSort(identityList.begin(), identityList.end(), identityPriorityLessThan);
std::sort(identityList.begin(), identityList.end(), identityPriorityLessThan);
foreach (Kopete::Identity *i, identityList) {
//KopeteIdentityLVI *lvi = new KopeteIdentityLVI( i, mIdentityList );
......@@ -175,7 +175,7 @@ void KopeteAccountConfig::load()
// Sort by priority
QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts();
qSort(accountList.begin(), accountList.end(), accountPriorityLessThan);
std::sort(accountList.begin(), accountList.end(), accountPriorityLessThan);
foreach (Kopete::Account *account, accountList) {
Kopete::Identity *idnt = account->identity();
......
......@@ -379,7 +379,7 @@ void ContactListPlainModel::loadModelSettingsImpl(QDomElement &rootElement)
}
}
qStableSort(m_contacts.begin(), m_contacts.end(), manualMetaContactSort);
std::stable_sort(m_contacts.begin(), m_contacts.end(), manualMetaContactSort);
delete _metaContactPositionPlain;
_metaContactPositionPlain = 0;
......
......@@ -843,7 +843,7 @@ void GroupModelItem::sort(bool (*lessThan)(const ContactListModelItem *, const C
clmi->sort(lessThan);
}
qStableSort(mItems.begin(), mItems.end(), lessThan);
std::stable_sort(mItems.begin(), mItems.end(), lessThan);
}
int GroupModelItem::indexOf(const ContactListModelItem *item) const
......
......@@ -760,7 +760,7 @@ void KopeteWindow::slotConfigChanged()
}
} else {
QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts();
qSort(accountList.begin(), accountList.end(), invertedCompareOnlineStatus);
std::sort(accountList.begin(), accountList.end(), invertedCompareOnlineStatus);
foreach (Kopete::Account *account, accountList) {
KopeteAccountStatusBarIcon *sbIcon = new KopeteAccountStatusBarIcon(account, d->statusBarWidget);
d->accountStatusBarIcons.insert(account, sbIcon);
......@@ -950,7 +950,7 @@ void KopeteWindow::slotAllPluginsLoaded()
// If some account already loaded, build the status icon
QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts();
qSort(accountList.begin(), accountList.end(), invertedCompareOnlineStatus);
std::sort(accountList.begin(), accountList.end(), invertedCompareOnlineStatus);
foreach (Kopete::Account *a, accountList) {
slotAccountRegistered(a);
}
......@@ -1135,7 +1135,7 @@ void KopeteWindow::makeTrayToolTip()
if (d->tray) {
QString tt = QStringLiteral("<qt>");
QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts();
qSort(accountList.begin(), accountList.end(), compareOnlineStatus);
std::sort(accountList.begin(), accountList.end(), compareOnlineStatus);
foreach (Kopete::Account *a, accountList) {
Kopete::Contact *self = a->myself();
/*tt += i18nc ( "Account tooltip information: <nobr>ICON <b>PROTOCOL:</b> NAME (<i>STATUS</i>)</nobr><br />",
......@@ -1267,7 +1267,7 @@ void KopeteWindow::slotTrayAboutToShowMenu(QMenu *popup)
popup->addSection(qApp->windowIcon(), KGlobal::caption());
QList<Kopete::Account *> accountList = Kopete::AccountManager::self()->accounts();
qSort(accountList.begin(), accountList.end(), invertedCompareOnlineStatus);
std::sort(accountList.begin(), accountList.end(), invertedCompareOnlineStatus);
foreach (Kopete::Account *account, accountList) {
KActionMenu *menu = new KActionMenu(account->accountId(), account);
menu->setIcon(account->myself()->onlineStatus().iconFor(account));
......
......@@ -269,7 +269,7 @@ Account *AccountManager::registerAccount(Account *account)
}
d->accounts.append(account);
qSort(d->accounts.begin(), d->accounts.end(), compareAccountsByPriority);
std::sort(d->accounts.begin(), d->accounts.end(), compareAccountsByPriority);
// Connect to the account's status changed signal
connect(account->myself(), SIGNAL(onlineStatusChanged(Kopete::Contact *,
......@@ -349,7 +349,7 @@ void AccountManager::removeAccount(Account *account)
void AccountManager::save()
{
//qCDebug(LIBKOPETE_LOG) ;
qSort(d->accounts.begin(), d->accounts.end(), compareAccountsByPriority);
std::sort(d->accounts.begin(), d->accounts.end(), compareAccountsByPriority);
for (QListIterator<Account *> it(d->accounts); it.hasNext();) {
Account *a = it.next();
......
......@@ -127,7 +127,7 @@ public:
ports = newPorts;
// keep ports in sorted order
qSort(ports);
std::sort(ports.begin(), ports.end());
foreach(int x, added)
{
......
......@@ -112,14 +112,14 @@ QString DiscoItem::capsHash(QCryptographicHash::Algorithm algo) const
{
QStringList prep;
DiscoItem::Identities idents = d->identities;
qSort(idents);
std::sort(idents.begin(), idents.end());
foreach (const DiscoItem::Identity &id, idents) {
prep << QString("%1/%2/%3/%4").arg(id.category, id.type, id.lang, id.name);
}
QStringList fl = d->features.list();
qSort(fl);
std::sort(fl.begin(), fl.end());
prep += fl;
QMap<QString,XData> forms;
......@@ -146,7 +146,7 @@ QString DiscoItem::capsHash(QCryptographicHash::Algorithm algo) const
if (v.isEmpty()) {
continue; // maybe it's media-element but xep-115 (1.5) and xep-232 (0.3) are not clear about that.
}
qSort(v);
std::sort(v.begin(), v.end());
values[f.var()] = v;
}
QMap <QString, QStringList>::ConstIterator it = values.constBegin();
......
......@@ -31,7 +31,7 @@
PrivacyList::PrivacyList(const QString& name, const QList<PrivacyListItem>& items) : name_(name), items_(items)
{
qSort(items_);
std::sort(items_.begin(), items_.end());
}
PrivacyList::PrivacyList(const QDomElement& e)
......@@ -145,7 +145,7 @@ void PrivacyList::fromXml(const QDomElement& el)
items_.append(PrivacyListItem(e));
}
qSort(items_);
std::sort(items_.begin(), items_.end());
}
QString PrivacyList::toString() const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment