]> git.sur5r.net Git - minitube/blobdiff - src/downloadsettings.cpp
Update upstream source from tag 'upstream/3.8'
[minitube] / src / downloadsettings.cpp
index f04a3f215b8663f39253ef78e49581fa9f42578d..c8b9d6c01a621cb93cea2b20d7cfc6ada1c69efd 100644 (file)
@@ -56,25 +56,15 @@ void DownloadSettings::paintEvent(QPaintEvent * /*event*/) {
 }
 
 void DownloadSettings::changeFolder() {
-    QString path;
+    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);
-#if QT_VERSION >= 0x050000
-    path = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
-    path = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
     dialog->setDirectory(path);
     dialog->open(this, SLOT(folderChosen(const QString &)));
 #else
 
-#if QT_VERSION >= 0x050000
-    path = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
-    path = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
     QString folder = QFileDialog::getExistingDirectory(window(), tr("Choose the download location"),
                                                        path,
                                                        QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks | QFileDialog::ReadOnly);
@@ -95,12 +85,8 @@ void DownloadSettings::folderChosen(const QString &dir) {
 }
 
 void DownloadSettings::updateMessage() {
-    QString path = DownloadManager::instance()->currentDownloadFolder();
-#if QT_VERSION >= 0x050000
-    QString home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
-    QString home = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
+    const QString path = DownloadManager::instance()->currentDownloadFolder();
+    const QString home = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
     QString displayPath = path;
     displayPath = displayPath.remove(home + "/");
     message->setText(