Make setComment declaration and definition order consistent

This commit is contained in:
HamletDuFromage 2025-08-02 23:14:46 +02:00
commit 82086b14ba
2 changed files with 23 additions and 23 deletions

View file

@ -443,6 +443,15 @@ QString TorrentImpl::comment() const
return m_comment; return m_comment;
} }
void TorrentImpl::setComment(const QString &comment)
{
if (m_comment != comment)
{
m_comment = comment;
deferredRequestResumeData();
}
}
bool TorrentImpl::isPrivate() const bool TorrentImpl::isPrivate() const
{ {
return m_torrentInfo.isPrivate(); return m_torrentInfo.isPrivate();
@ -2962,13 +2971,4 @@ QFuture<std::invoke_result_t<Func>> TorrentImpl::invokeAsync(Func &&func) const
}); });
return future; return future;
} }
void TorrentImpl::setComment(const QString &comment)
{
if (m_comment != comment)
{
m_comment = comment;
deferredRequestResumeData();
}
}

View file

@ -1591,6 +1591,19 @@ void TorrentsController::renameAction()
setResult(QString()); 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() void TorrentsController::setAutoManagementAction()
{ {
requireParams({u"hashes"_s, u"enable"_s}); requireParams({u"hashes"_s, u"enable"_s});
@ -2143,16 +2156,3 @@ void TorrentsController::onMetadataDownloaded(const BitTorrent::TorrentInfo &inf
iter.value().setTorrentInfo(info); 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);
});
}