FEATURE: Torrent files can be exported to a given directory

BUGFIX: Fix crash when double-clicking on a torrent that has no metadata to open its save path
This commit is contained in:
Christophe Dumez
2010-01-31 13:09:46 +00:00
parent 9bd40a9b79
commit a03ad3de23
9 changed files with 225 additions and 26 deletions

View File

@@ -214,6 +214,24 @@ public:
settings.setValue(QString::fromUtf8("Preferences/Downloads/ScanDir"), path);
}
static bool isTorrentExportEnabled() {
QSettings settings("qBittorrent", "qBittorrent");
return !settings.value(QString::fromUtf8("Preferences/Downloads/TorrentExport"), QString()).toString().isEmpty();
}
static QString getExportDir() {
QSettings settings("qBittorrent", "qBittorrent");
return settings.value(QString::fromUtf8("Preferences/Downloads/TorrentExport"), QString()).toString();
}
static void setExportDir(QString path) {
path = path.trimmed();
if(path.isEmpty())
path = QString();
QSettings settings("qBittorrent", "qBittorrent");
settings.setValue(QString::fromUtf8("Preferences/Downloads/TorrentExport"), path);
}
static int getActionOnDblClOnTorrentDl() {
QSettings settings("qBittorrent", "qBittorrent");
return settings.value(QString::fromUtf8("Preferences/Downloads/DblClOnTorDl"), 0).toInt();