]> git.sur5r.net Git - minitube/blobdiff - src/downloadmanager.cpp
Imported Upstream version 2.5.1
[minitube] / src / downloadmanager.cpp
index 340b8d6a9a159e48b2d2edbf86b8aa716f776ddf..9375bb082f6a4164b6ad6ccf87a6e9e0c95a2580 100644 (file)
@@ -31,6 +31,8 @@ $END_LICENSE */
 #include "extra.h"
 #endif
 #include "datautils.h"
+#include "compatibility/pathsservice.h"
+#include "iconutils.h"
 
 static DownloadManager *downloadManagerInstance = 0;
 
@@ -72,7 +74,7 @@ void DownloadManager::addItem(Video *video) {
     if (!Activation::instance().isActivated()) {
         if (video->duration() >= 60*4) {
             QMessageBox msgBox(MainWindow::instance());
-            msgBox.setIconPixmap(QPixmap(":/images/app.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
+            msgBox.setIconPixmap(IconUtils::pixmap(":/images/app.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
             msgBox.setText(tr("This is just the demo version of %1.").arg(Constants::NAME));
             msgBox.setInformativeText(
                         tr("It can only download videos shorter than %1 minutes so you can test the download functionality.")
@@ -167,29 +169,17 @@ void DownloadManager::updateStatusMessage() {
 
 QString DownloadManager::defaultDownloadFolder() {
     // download in the Movies system folder
-#if QT_VERSION >= 0x050000
-    QString path = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
-#else
-    QString path = QDesktopServices::storageLocation(QDesktopServices::MoviesLocation);
-#endif
+    QString path = Paths::getMoviesLocation();
 
-    QDir moviesDir(path);
+    const QDir moviesDir(path);
     if (!moviesDir.exists()) {
         // fallback to Desktop
-#if QT_VERSION >= 0x050000
-        path = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
-#else
-        path = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
-#endif
+        path = Paths::getDesktopLocation();
 
-        QDir desktopDir(path);
+        const QDir desktopDir(path);
         if (!desktopDir.exists()) {
             // fallback to Home
-#if QT_VERSION >= 0x050000
-            path = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
-#else
-            path = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
-#endif
+            path = Paths::getHomeLocation();
         }
     }
     return path;