mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 10:16:00 +03:00
Fixed default save path on Windows
This commit is contained in:
parent
f4c29c07bf
commit
b67938aa3f
1 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,10 @@
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef Q_WS_WIN
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define QBT_REALM "Web UI Access"
|
#define QBT_REALM "Web UI Access"
|
||||||
enum scheduler_days { EVERY_DAY, WEEK_DAYS, WEEK_ENDS, MON, TUE, WED, THU, FRI, SAT, SUN };
|
enum scheduler_days { EVERY_DAY, WEEK_DAYS, WEEK_ENDS, MON, TUE, WED, THU, FRI, SAT, SUN };
|
||||||
|
|
||||||
|
@ -137,7 +141,12 @@ public:
|
||||||
// Downloads
|
// Downloads
|
||||||
static QString getSavePath() {
|
static QString getSavePath() {
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
#ifdef Q_WS_WIN
|
||||||
|
return settings.value(QString::fromUtf8("Preferences/Downloads/SavePath"),
|
||||||
|
QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).absoluteFilePath("Downloads")).toString();
|
||||||
|
#else
|
||||||
return settings.value(QString::fromUtf8("Preferences/Downloads/SavePath"), QDir::home().absoluteFilePath("qBT_dir")).toString();
|
return settings.value(QString::fromUtf8("Preferences/Downloads/SavePath"), QDir::home().absoluteFilePath("qBT_dir")).toString();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setSavePath(QString save_path) {
|
static void setSavePath(QString save_path) {
|
||||||
|
|
Loading…
Reference in a new issue