From: Flavio Date: Thu, 12 May 2011 10:05:07 +0000 (+0200) Subject: Fallback to home when Desktop does not exist X-Git-Tag: 1.4.3~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=10e5d0f302ecfca26376478cda1c0b36c9c3bc34;p=minitube Fallback to home when Desktop does not exist --- diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index fbfb0d0..6e3068b 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -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; }