mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
Merge pull request #11430 from Chocobo1/qt
Fix integer narrowing on x86
This commit is contained in:
commit
565eb4cdc8
@ -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(','));
|
||||||
|
|
||||||
|
@ -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)) {
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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(", ");
|
||||||
}
|
}
|
||||||
|
@ -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…
Reference in New Issue
Block a user