From 10e5d0f302ecfca26376478cda1c0b36c9c3bc34 Mon Sep 17 00:00:00 2001 From: Flavio Date: Thu, 12 May 2011 12:05:07 +0200 Subject: [PATCH] Fallback to home when Desktop does not exist --- src/downloadmanager.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.39.5