summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2009-10-30 13:49:05 (GMT)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2009-10-30 13:50:33 (GMT)
commit4510c18ed3ffd2c01d11159fc2d2ec7f0eb48e42 (patch)
tree0734081121e4aa284168515e7ddb5732b04471d1 /src
parent5cca60ad593cc5b8778d7be0b8137ffecd34b247 (diff)
downloadQt-4510c18ed3ffd2c01d11159fc2d2ec7f0eb48e42.zip
Qt-4510c18ed3ffd2c01d11159fc2d2ec7f0eb48e42.tar.gz
Qt-4510c18ed3ffd2c01d11159fc2d2ec7f0eb48e42.tar.bz2
Fix QDesktopServices::DataLocation on Mac.
DataLocation now behaves as on the other platforms, QCoreApplication::organizationName() and applicationName() is included in the returned path.
Diffstat (limited to 'src')
-rw-r--r--src/gui/util/qdesktopservices.cpp9
-rw-r--r--src/gui/util/qdesktopservices_mac.cpp9
2 files changed, 6 insertions, 12 deletions
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 1690d87..85b539f 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -294,15 +294,6 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
Rest of the standard locations point to folder on same drive with executable, except
that if executable is in ROM the folder from C drive is returned.
- \note On Mac OS X, DataLocation does not include QCoreApplication::organizationName.
- Use code like this to add it:
-
- \code
- QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
- #ifdef Q_WS_MAC
- location.insert(location.count() - QCoreApplication::applicationName().count(),
- QCoreApplication::organizationName() + "/");
- #endif
\endcode
*/
diff --git a/src/gui/util/qdesktopservices_mac.cpp b/src/gui/util/qdesktopservices_mac.cpp
index 0626e0a..23f9e60 100644
--- a/src/gui/util/qdesktopservices_mac.cpp
+++ b/src/gui/util/qdesktopservices_mac.cpp
@@ -153,9 +153,12 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString path = getFullPath(ref);
- QString appName = QCoreApplication::applicationName();
- if (!appName.isEmpty() && (type == DataLocation || type == CacheLocation))
- path += QLatin1Char('/') + appName;
+ if (type == DataLocation || type == CacheLocation) {
+ if (QCoreApplication::organizationName().isEmpty() == false)
+ path += QLatin1Char('/') + QCoreApplication::organizationName();
+ if (QCoreApplication::applicationName().isEmpty() == false)
+ path += QLatin1Char('/') + QCoreApplication::applicationName();
+ }
return path;
}