Refactor TorrentPersistentData

Conflicts:
	src/mainwindow.cpp
	src/mainwindow.h
	src/qtlibtorrent/qbtsession.cpp
	src/qtlibtorrent/qtorrenthandle.cpp
	src/transferlistwidget.cpp
	src/webui/btjson.cpp
This commit is contained in:
Ivan Sorokin 2014-11-02 16:52:26 +03:00
parent 70a114eb13
commit e3349092ad
10 changed files with 157 additions and 128 deletions

View file

@ -415,7 +415,7 @@ QByteArray btjson::getPropertiesForTorrent(const QString& hash)
return QByteArray();
// Save path
QString save_path = fsutils::toNativePath(TorrentPersistentData::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::getLabel(h.hash());
ret[KEY_TORRENT_LABEL] = TorrentPersistentData::instance().getLabel(h.hash());
return ret;
}