From b67938aa3fae6e0439c9416eca7b0ef17ff87d8b Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 2 Jun 2010 22:31:49 +0000 Subject: [PATCH] Fixed default save path on Windows --- src/preferences.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/preferences.h b/src/preferences.h index 52368d45e..aff859b89 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -43,6 +43,10 @@ #include #endif +#ifdef Q_WS_WIN +#include +#endif + #define QBT_REALM "Web UI Access" enum scheduler_days { EVERY_DAY, WEEK_DAYS, WEEK_ENDS, MON, TUE, WED, THU, FRI, SAT, SUN }; @@ -137,7 +141,12 @@ public: // Downloads static QString getSavePath() { 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(); +#endif } static void setSavePath(QString save_path) {