mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user