Browse Source

Replace deprecated Qt functions

QSet::toList() is replaced by QSet::values()
adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
6fd678195c
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/app/application.cpp
  2. 6
      src/base/bittorrent/session.cpp
  3. 2
      src/base/search/searchpluginmanager.cpp
  4. 4
      src/gui/downloadfromurldialog.cpp
  5. 2
      src/gui/transferlistmodel.cpp
  6. 2
      src/webui/api/serialize/serialize_torrent.cpp

2
src/app/application.cpp

@ -296,7 +296,7 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c @@ -296,7 +296,7 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c
program.replace("%N", torrent->name());
program.replace("%L", torrent->category());
QStringList tags = torrent->tags().toList();
QStringList tags = torrent->tags().values();
std::sort(tags.begin(), tags.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
program.replace("%G", tags.join(','));

6
src/base/bittorrent/session.cpp

@ -726,7 +726,7 @@ bool Session::addTag(const QString &tag) @@ -726,7 +726,7 @@ bool Session::addTag(const QString &tag)
if (!hasTag(tag)) {
m_tags.insert(tag);
m_storedTags = m_tags.toList();
m_storedTags = m_tags.values();
emit tagAdded(tag);
return true;
}
@ -738,7 +738,7 @@ bool Session::removeTag(const QString &tag) @@ -738,7 +738,7 @@ bool Session::removeTag(const QString &tag)
if (m_tags.remove(tag)) {
for (TorrentHandle *const torrent : asConst(torrents()))
torrent->removeTag(tag);
m_storedTags = m_tags.toList();
m_storedTags = m_tags.values();
emit tagRemoved(tag);
return true;
}
@ -3752,7 +3752,7 @@ void Session::startUpTorrents() @@ -3752,7 +3752,7 @@ void Session::startUpTorrents()
}
if (!queue.empty())
fastresumes = queue + fastresumes.toSet().subtract(queue.toSet()).toList();
fastresumes = queue + fastresumes.toSet().subtract(queue.toSet()).values();
}
for (const QString &fastresumeName : asConst(fastresumes)) {

2
src/base/search/searchpluginmanager.cpp

@ -157,7 +157,7 @@ QStringList SearchPluginManager::getPluginCategories(const QString &pluginName) @@ -157,7 +157,7 @@ QStringList SearchPluginManager::getPluginCategories(const QString &pluginName)
categories << category;
}
return categories.toList();
return categories.values();
}
PluginInfo *SearchPluginManager::pluginInfo(const QString &name) const

4
src/gui/downloadfromurldialog.cpp

@ -79,7 +79,7 @@ DownloadFromURLDialog::DownloadFromURLDialog(QWidget *parent) @@ -79,7 +79,7 @@ DownloadFromURLDialog::DownloadFromURLDialog(QWidget *parent)
if (isDownloadable(str))
uniqueURLs << str;
}
m_ui->textUrls->setText(uniqueURLs.toList().join('\n'));
m_ui->textUrls->setText(uniqueURLs.values().join('\n'));
Utils::Gui::resize(this);
show();
@ -108,6 +108,6 @@ void DownloadFromURLDialog::downloadButtonClicked() @@ -108,6 +108,6 @@ void DownloadFromURLDialog::downloadButtonClicked()
return;
}
emit urlsReadyToBeDownloaded(uniqueURLs.toList());
emit urlsReadyToBeDownloaded(uniqueURLs.values());
accept();
}

2
src/gui/transferlistmodel.cpp

@ -200,7 +200,7 @@ QVariant TransferListModel::data(const QModelIndex &index, const int role) const @@ -200,7 +200,7 @@ QVariant TransferListModel::data(const QModelIndex &index, const int role) const
case TR_CATEGORY:
return torrent->category();
case TR_TAGS: {
QStringList tagsList = torrent->tags().toList();
QStringList tagsList = torrent->tags().values();
tagsList.sort();
return tagsList.join(", ");
}

2
src/webui/api/serialize/serialize_torrent.cpp

@ -102,7 +102,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent) @@ -102,7 +102,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent)
{KEY_TORRENT_FIRST_LAST_PIECE_PRIO, torrent.hasFirstLastPiecePriority()},
{KEY_TORRENT_CATEGORY, torrent.category()},
{KEY_TORRENT_TAGS, torrent.tags().toList().join(", ")},
{KEY_TORRENT_TAGS, torrent.tags().values().join(", ")},
{KEY_TORRENT_SUPER_SEEDING, torrent.superSeeding()},
{KEY_TORRENT_FORCE_START, torrent.isForced()},
{KEY_TORRENT_SAVE_PATH, Utils::Fs::toNativePath(torrent.savePath())},

Loading…
Cancel
Save