]> git.sur5r.net Git - minitube/blobdiff - src/downloadsettings.cpp
Upload 3.9.3-2 to unstable
[minitube] / src / downloadsettings.cpp
index 1afb2d5b1317b89d6435580361789f3e16dfe758..c8b9d6c01a621cb93cea2b20d7cfc6ada1c69efd 100644 (file)
@@ -56,17 +56,18 @@ void DownloadSettings::paintEvent(QPaintEvent * /*event*/) {
 }
 
 void DownloadSettings::changeFolder() {
-
+    const QString path = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
 #ifdef APP_MAC
     QFileDialog* dialog = new QFileDialog(this);
     dialog->setFileMode(QFileDialog::Directory);
     dialog->setOptions(QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
-    dialog->setDirectory(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
+    dialog->setDirectory(path);
     dialog->open(this, SLOT(folderChosen(const QString &)));
 #else
+
     QString folder = QFileDialog::getExistingDirectory(window(), tr("Choose the download location"),
-                                                    QDesktopServices::storageLocation(QDesktopServices::HomeLocation),
-                                                    QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
+                                                       path,
+                                                       QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
     folderChosen(folder);
 #endif
 }
@@ -84,12 +85,12 @@ void DownloadSettings::folderChosen(const QString &dir) {
 }
 
 void DownloadSettings::updateMessage() {
-    QString path = DownloadManager::instance()->currentDownloadFolder();
-    QString home = QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + "/";
+    const QString path = DownloadManager::instance()->currentDownloadFolder();
+    const QString home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
     QString displayPath = path;
-    displayPath = displayPath.remove(home);
+    displayPath = displayPath.remove(home + "/");
     message->setText(
-            tr("Downloading to: %1")
-            .arg("<a href='file://%1' style='text-decoration:none; color:palette(text); font-weight:bold'>%2</a>")
-            .arg(path, displayPath));
+                tr("Downloading to: %1")
+                .arg("<a href='file://%1' style='text-decoration:none; color:palette(text); font-weight:bold'>%2</a>")
+                .arg(path, displayPath));
 }