summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2014-12-04 09:09:30 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2014-12-04 20:17:47 +0100
commit933ae21b9925f1d9fc467e1ecb72eb91b5892d61 (patch)
tree080c56ce34f1d2cad41d99d03011be1dda7fc802 /src/gui
parent74112db92ca8582ac09a2f877e87177e7d46ea7b (diff)
Windows: Fix return value of QDesktopServices::storageLocation(DataLocation).
Return empty string if SHGetSpecialFolderPath() fails for DataLocation, ie, the directory does not exist. Change-Id: I2abf41174b904fe36e587894832c0f3f4947dc1e Task-number: QTBUG-43092 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/util/qdesktopservices_win.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp
index 1bf3654b61..9ac6f4a7d3 100644
--- a/src/gui/util/qdesktopservices_win.cpp
+++ b/src/gui/util/qdesktopservices_win.cpp
@@ -196,15 +196,16 @@ QString QDesktopServices::storageLocation(StandardLocation type)
switch (type) {
case DataLocation:
#if defined Q_WS_WINCE
- if (SHGetSpecialFolderPath(0, path, CSIDL_APPDATA, FALSE))
+ if (SHGetSpecialFolderPath(0, path, CSIDL_APPDATA, FALSE)) {
#else
- if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE))
+ if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE)) {
#endif
result = QString::fromWCharArray(path);
- if (!QCoreApplication::organizationName().isEmpty())
- result = result + QLatin1String("\\") + QCoreApplication::organizationName();
- if (!QCoreApplication::applicationName().isEmpty())
- result = result + QLatin1String("\\") + QCoreApplication::applicationName();
+ if (!QCoreApplication::organizationName().isEmpty())
+ result += QLatin1String("\\") + QCoreApplication::organizationName();
+ if (!QCoreApplication::applicationName().isEmpty())
+ result += QLatin1String("\\") + QCoreApplication::applicationName();
+ }
break;
case DesktopLocation: