mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Replace QList by QVector
This commit is contained in:
parent
5b9b5ce577
commit
da2bfd2457
@ -40,6 +40,7 @@
|
|||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
#include <QVector>
|
||||||
|
|
||||||
#include "base/global.h"
|
#include "base/global.h"
|
||||||
#include "base/search/searchpluginmanager.h"
|
#include "base/search/searchpluginmanager.h"
|
||||||
@ -146,7 +147,7 @@ void SearchWidget::fillCatCombobox()
|
|||||||
m_ui->comboCategory->addItem(SearchPluginManager::categoryFullName("all"), QVariant("all"));
|
m_ui->comboCategory->addItem(SearchPluginManager::categoryFullName("all"), QVariant("all"));
|
||||||
|
|
||||||
using QStrPair = QPair<QString, QString>;
|
using QStrPair = QPair<QString, QString>;
|
||||||
QList<QStrPair> tmpList;
|
QVector<QStrPair> tmpList;
|
||||||
for (const QString &cat : asConst(SearchPluginManager::instance()->getPluginCategories(selectedPlugin())))
|
for (const QString &cat : asConst(SearchPluginManager::instance()->getPluginCategories(selectedPlugin())))
|
||||||
tmpList << qMakePair(SearchPluginManager::categoryFullName(cat), cat);
|
tmpList << qMakePair(SearchPluginManager::categoryFullName(cat), cat);
|
||||||
std::sort(tmpList.begin(), tmpList.end(), [](const QStrPair &l, const QStrPair &r) { return (QString::localeAwareCompare(l.first, r.first) < 0); });
|
std::sort(tmpList.begin(), tmpList.end(), [](const QStrPair &l, const QStrPair &r) { return (QString::localeAwareCompare(l.first, r.first) < 0); });
|
||||||
@ -168,7 +169,7 @@ void SearchWidget::fillPluginComboBox()
|
|||||||
m_ui->selectPlugin->addItem(tr("Select..."), QVariant("multi"));
|
m_ui->selectPlugin->addItem(tr("Select..."), QVariant("multi"));
|
||||||
|
|
||||||
using QStrPair = QPair<QString, QString>;
|
using QStrPair = QPair<QString, QString>;
|
||||||
QList<QStrPair> tmpList;
|
QVector<QStrPair> tmpList;
|
||||||
for (const QString &name : asConst(SearchPluginManager::instance()->enabledPlugins()))
|
for (const QString &name : asConst(SearchPluginManager::instance()->enabledPlugins()))
|
||||||
tmpList << qMakePair(SearchPluginManager::instance()->pluginFullName(name), name);
|
tmpList << qMakePair(SearchPluginManager::instance()->pluginFullName(name), name);
|
||||||
std::sort(tmpList.begin(), tmpList.end(), [](const QStrPair &l, const QStrPair &r) { return (l.first < r.first); } );
|
std::sort(tmpList.begin(), tmpList.end(), [](const QStrPair &l, const QStrPair &r) { return (l.first < r.first); } );
|
||||||
|
Loading…
Reference in New Issue
Block a user