summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-06-02 09:48:34 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-06-02 09:56:34 (GMT)
commit39fc672795fbb60118e8f506e4f2c49b1980b7c0 (patch)
tree8d6f0c900cf69a56833ecd95a7ebc4d520e927d9
parentb31819a2871f0479da59c01d9fc7469d36120c2b (diff)
downloadQt-39fc672795fbb60118e8f506e4f2c49b1980b7c0.zip
Qt-39fc672795fbb60118e8f506e4f2c49b1980b7c0.tar.gz
Qt-39fc672795fbb60118e8f506e4f2c49b1980b7c0.tar.bz2
Change QDesktopServices::TempLocation on Mac to be the same as QDir.
In the past, TempLocation would return something like: /private/var/folders/4k/4k97GBy2Ha46D3DAWSLbQE+++TI/TemporaryItems Now it returns something like: /var/folders/4k/4k97GBy2Ha46D3DAWSLbQE+++TI/-Tmp- This isn't that different and it's a temporary location so it shouldn't effect many people (and it will be gone once the system reboots anyway), but the issue could be that TemporaryItems isn't there and that it's a bit more "Carbon" to use TemporaryItems. Also our own documentation claims they are equivalent and I'm happy to do that. I also enforced the Qt-style of if-statements and got rid of the extra qualifiers to make the code look nicer. Task-number: 253806 Reviewed-by: Morten Sørvig
-rw-r--r--src/gui/util/qdesktopservices_mac.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/util/qdesktopservices_mac.cpp b/src/gui/util/qdesktopservices_mac.cpp
index fb1e193..4f730b7 100644
--- a/src/gui/util/qdesktopservices_mac.cpp
+++ b/src/gui/util/qdesktopservices_mac.cpp
@@ -134,13 +134,15 @@ static QString getFullPath(const FSRef &ref)
QString QDesktopServices::storageLocation(StandardLocation type)
{
- if (QDesktopServices::HomeLocation == type)
+ if (type == HomeLocation)
return QDir::homePath();
+ if (type == TempLocation)
+ return QDir::tempPath();
+
short domain = kOnAppropriateDisk;
- if (QDesktopServices::DataLocation == type
- || QDesktopServices::CacheLocation == type)
+ if (type == DataLocation || type == CacheLocation)
domain = kUserDomain;
// http://developer.apple.com/documentation/Carbon/Reference/Folder_Manager/Reference/reference.html
@@ -152,8 +154,7 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString path = getFullPath(ref);
QString appName = QCoreApplication::applicationName();
- if (!appName.isEmpty() &&
- (QDesktopServices::DataLocation == type || QDesktopServices::CacheLocation == type))
+ if (!appName.isEmpty() && (type == DataLocation || type == CacheLocation))
path += QLatin1Char('/') + appName;
return path;