Drop implicit conversions between InfoHash and QString

This commit is contained in:
Vladimir Golovnev (Glassez) 2021-03-01 10:41:31 +03:00
parent 752eb58ec0
commit 8cfd803222
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
13 changed files with 72 additions and 68 deletions

View file

@ -471,7 +471,7 @@ void SyncController::maindataAction()
if (iterTorrents != lastResponse.end())
{
const QVariantHash lastResponseTorrents = iterTorrents->toHash();
const auto iterHash = lastResponseTorrents.find(torrentHash);
const auto iterHash = lastResponseTorrents.find(torrentHash.toString());
if (iterHash != lastResponseTorrents.end())
{
@ -488,9 +488,9 @@ void SyncController::maindataAction()
}
for (const BitTorrent::TrackerEntry &tracker : asConst(torrent->trackers()))
trackers[tracker.url()] << torrentHash;
trackers[tracker.url()] << torrentHash.toString();
torrents[torrentHash] = map;
torrents[torrentHash.toString()] = map;
}
data["torrents"] = torrents;
@ -541,7 +541,7 @@ void SyncController::torrentPeersAction()
auto lastResponse = sessionManager()->session()->getData(QLatin1String("syncTorrentPeersLastResponse")).toMap();
auto lastAcceptedResponse = sessionManager()->session()->getData(QLatin1String("syncTorrentPeersLastAcceptedResponse")).toMap();
const QString hash {params()["hash"]};
const auto hash = BitTorrent::InfoHash::fromString(params()["hash"]);
const BitTorrent::Torrent *torrent = BitTorrent::Session::instance()->findTorrent(hash);
if (!torrent)
throw APIError(APIErrorType::NotFound);