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
program.replace("%N", torrent->name()); program.replace("%N", torrent->name());
program.replace("%L", torrent->category()); 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>); std::sort(tags.begin(), tags.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
program.replace("%G", tags.join(',')); program.replace("%G", tags.join(','));

6
src/base/bittorrent/session.cpp

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

2
src/base/search/searchpluginmanager.cpp

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

4
src/gui/downloadfromurldialog.cpp

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

2
src/gui/transferlistmodel.cpp

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

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

@ -102,7 +102,7 @@ QVariantMap serialize(const BitTorrent::TorrentHandle &torrent)
{KEY_TORRENT_FIRST_LAST_PIECE_PRIO, torrent.hasFirstLastPiecePriority()}, {KEY_TORRENT_FIRST_LAST_PIECE_PRIO, torrent.hasFirstLastPiecePriority()},
{KEY_TORRENT_CATEGORY, torrent.category()}, {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_SUPER_SEEDING, torrent.superSeeding()},
{KEY_TORRENT_FORCE_START, torrent.isForced()}, {KEY_TORRENT_FORCE_START, torrent.isForced()},
{KEY_TORRENT_SAVE_PATH, Utils::Fs::toNativePath(torrent.savePath())}, {KEY_TORRENT_SAVE_PATH, Utils::Fs::toNativePath(torrent.savePath())},

Loading…
Cancel
Save