mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 05:13:30 -07:00
Make setComment declaration and definition order consistent
This commit is contained in:
parent
54a8553f67
commit
82086b14ba
2 changed files with 23 additions and 23 deletions
|
@ -443,6 +443,15 @@ QString TorrentImpl::comment() const
|
|||
return m_comment;
|
||||
}
|
||||
|
||||
void TorrentImpl::setComment(const QString &comment)
|
||||
{
|
||||
if (m_comment != comment)
|
||||
{
|
||||
m_comment = comment;
|
||||
deferredRequestResumeData();
|
||||
}
|
||||
}
|
||||
|
||||
bool TorrentImpl::isPrivate() const
|
||||
{
|
||||
return m_torrentInfo.isPrivate();
|
||||
|
@ -2962,13 +2971,4 @@ QFuture<std::invoke_result_t<Func>> TorrentImpl::invokeAsync(Func &&func) const
|
|||
});
|
||||
|
||||
return future;
|
||||
}
|
||||
|
||||
void TorrentImpl::setComment(const QString &comment)
|
||||
{
|
||||
if (m_comment != comment)
|
||||
{
|
||||
m_comment = comment;
|
||||
deferredRequestResumeData();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1591,6 +1591,19 @@ void TorrentsController::renameAction()
|
|||
setResult(QString());
|
||||
}
|
||||
|
||||
void TorrentsController::setCommentAction()
|
||||
{
|
||||
requireParams({u"hashes"_s, u"comment"_s});
|
||||
|
||||
const QStringList hashes {params()[u"hashes"_s].split(u'|')};
|
||||
const QString comment = params()[u"comment"_s].trimmed();
|
||||
|
||||
applyToTorrents(hashes, [&comment](BitTorrent::Torrent *const torrent)
|
||||
{
|
||||
torrent->setComment(comment);
|
||||
});
|
||||
}
|
||||
|
||||
void TorrentsController::setAutoManagementAction()
|
||||
{
|
||||
requireParams({u"hashes"_s, u"enable"_s});
|
||||
|
@ -2143,16 +2156,3 @@ void TorrentsController::onMetadataDownloaded(const BitTorrent::TorrentInfo &inf
|
|||
iter.value().setTorrentInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
void TorrentsController::setCommentAction()
|
||||
{
|
||||
requireParams({u"hashes"_s, u"comment"_s});
|
||||
|
||||
const QStringList hashes {params()[u"hashes"_s].split(u'|')};
|
||||
const QString comment = params()[u"comment"_s].trimmed();
|
||||
|
||||
applyToTorrents(hashes, [&comment](BitTorrent::Torrent *const torrent)
|
||||
{
|
||||
torrent->setComment(comment);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue