]> git.sur5r.net Git - minitube/commitdiff
Fallback to home when Desktop does not exist
authorFlavio <flavio@odisseo.local>
Thu, 12 May 2011 10:05:07 +0000 (12:05 +0200)
committerFlavio <flavio@odisseo.local>
Thu, 12 May 2011 10:05:07 +0000 (12:05 +0200)
src/downloadmanager.cpp

index fbfb0d0201ded6761073b3b7ac0ddb15f240807e..6e3068b74911f670d3b1392d46e832dc4dc0a99a 100644 (file)
@@ -146,6 +146,11 @@ QString DownloadManager::defaultDownloadFolder() {
         // fallback to Desktop
         path = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
     }
+    QDir desktopDir(path);
+    if (!desktopDir.exists()) {
+        // fallback to Home
+        path = QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
+    }
     return path;
 }