Redesign "Incomplete folder" feature

Change "Incomplete/temp folder" term with "download folder".
Allow to set "download folder" per torrent (in manual mode) and per category (in automatic mode).
This commit is contained in:
Vladimir Golovnev (Glassez) 2021-05-20 10:36:44 +03:00 committed by Vladimir Golovnev (glassez)
parent b0e41abf5a
commit 1c0f8b4289
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
48 changed files with 1457 additions and 599 deletions

View file

@ -209,6 +209,7 @@ namespace
case QMetaType::ULongLong:
case QMetaType::UInt:
case QMetaType::QDateTime:
case QMetaType::Nullptr:
if (prevData[key] != value)
syncData[key] = value;
break;
@ -426,6 +427,7 @@ SyncController::~SyncController()
// - "uploaded_session": Amount of data uploaded since program open
// - "amount_left": Amount of data left to download
// - "save_path": Torrent save path
// - "download_path": Torrent download path
// - "completed": Amount of data completed
// - "max_ratio": Upload max share ratio
// - "max_seeding_time": Upload max seeding time
@ -496,15 +498,13 @@ void SyncController::maindataAction()
data["torrents"] = torrents;
QVariantHash categories;
const QStringMap categoriesList = session->categories();
for (auto it = categoriesList.cbegin(); it != categoriesList.cend(); ++it)
const QStringList categoriesList = session->categories();
for (const auto &categoryName : categoriesList)
{
const QString &key = it.key();
categories[key] = QVariantMap
{
{"name", key},
{"savePath", it.value()}
};
const BitTorrent::CategoryOptions categoryOptions = session->categoryOptions(categoryName);
QJsonObject category = categoryOptions.toJSON();
category.insert(QLatin1String("name"), categoryName);
categories[categoryName] = category.toVariantMap();
}
data["categories"] = categories;