Browse Source

Merge pull request #11430 from Chocobo1/qt

Fix integer narrowing on x86
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
565eb4cdc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/app/application.cpp
  2. 6
      src/base/bittorrent/session.cpp
  3. 2
      src/base/search/searchpluginmanager.cpp
  4. 2
      src/base/utils/fs.cpp
  5. 4
      src/gui/downloadfromurldialog.cpp
  6. 2
      src/gui/transferlistmodel.cpp
  7. 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

@ -730,7 +730,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;
} }
@ -742,7 +742,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;
} }
@ -3813,7 +3813,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

2
src/base/utils/fs.cpp

@ -348,7 +348,7 @@ bool Utils::Fs::isNetworkFileSystem(const QString &path)
// Magic number references: // Magic number references:
// 1. /usr/include/linux/magic.h // 1. /usr/include/linux/magic.h
// 2. https://github.com/coreutils/coreutils/blob/master/src/stat.c // 2. https://github.com/coreutils/coreutils/blob/master/src/stat.c
switch (buf.f_type) { switch (static_cast<unsigned int>(buf.f_type)) {
case 0xFF534D42: // CIFS_MAGIC_NUMBER case 0xFF534D42: // CIFS_MAGIC_NUMBER
case 0x6969: // NFS_SUPER_MAGIC case 0x6969: // NFS_SUPER_MAGIC
case 0x517B: // SMB_SUPER_MAGIC case 0x517B: // SMB_SUPER_MAGIC

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