Make 'TorrentPersistentData' similar to 'Preferences' class.

This commit is contained in:
sledgehammer999
2015-01-27 17:28:21 +02:00
parent 70985480d6
commit eeee24a0b3
11 changed files with 235 additions and 223 deletions

View File

@@ -415,7 +415,7 @@ QByteArray btjson::getPropertiesForTorrent(const QString& hash)
return QByteArray();
// Save path
QString save_path = fsutils::toNativePath(TorrentPersistentData::instance().getSavePath(hash));
QString save_path = fsutils::toNativePath(TorrentPersistentData::instance()->getSavePath(hash));
if (save_path.isEmpty())
save_path = fsutils::toNativePath(h.save_path());
data[KEY_PROP_SAVE_PATH] = save_path;
@@ -554,7 +554,7 @@ QVariantMap toMap(const QTorrentHandle& h)
ret[KEY_TORRENT_SEQUENTIAL_DOWNLOAD] = status.sequential_download;
if (h.has_metadata())
ret[KEY_TORRENT_FIRST_LAST_PIECE_PRIO] = h.first_last_piece_first();
ret[KEY_TORRENT_LABEL] = TorrentPersistentData::instance().getLabel(h.hash());
ret[KEY_TORRENT_LABEL] = TorrentPersistentData::instance()->getLabel(h.hash());
return ret;
}

View File

@@ -116,5 +116,5 @@ bool QTorrentFilter::torrentHasLabel(const QTorrentHandle &h) const
if (label_.isNull())
return true;
else
return TorrentPersistentData::instance().getLabel(h.hash()) == label_;
return TorrentPersistentData::instance()->getLabel(h.hash()) == label_;
}