|
|
|
@ -227,6 +227,22 @@ public:
@@ -227,6 +227,22 @@ public:
|
|
|
|
|
return dt; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void setErrorState(QString hash, bool has_error) { |
|
|
|
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume")); |
|
|
|
|
QHash<QString, QVariant> all_data = settings.value("torrents", QHash<QString, QVariant>()).toHash(); |
|
|
|
|
QHash<QString, QVariant> data = all_data[hash].toHash(); |
|
|
|
|
data.insert("has_error", has_error); |
|
|
|
|
all_data[hash] = data; |
|
|
|
|
settings.setValue("torrents", all_data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static bool hasError(QString hash) { |
|
|
|
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume")); |
|
|
|
|
QHash<QString, QVariant> all_data = settings.value("torrents", QHash<QString, QVariant>()).toHash(); |
|
|
|
|
QHash<QString, QVariant> data = all_data[hash].toHash(); |
|
|
|
|
return data.value("has_error", false).toBool(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void setRootFolder(QString hash, QString root_folder) { |
|
|
|
|
QIniSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent-resume")); |
|
|
|
|
QHash<QString, QVariant> all_data = settings.value("torrents", QHash<QString, QVariant>()).toHash(); |
|
|
|
|