summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qdesktopservices_mac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/util/qdesktopservices_mac.cpp')
-rw-r--r--src/gui/util/qdesktopservices_mac.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/util/qdesktopservices_mac.cpp b/src/gui/util/qdesktopservices_mac.cpp
index 5124068..4f730b7 100644
--- a/src/gui/util/qdesktopservices_mac.cpp
+++ b/src/gui/util/qdesktopservices_mac.cpp
@@ -96,7 +96,7 @@ OSType translateLocation(QDesktopServices::StandardLocation type)
static bool lsOpen(const QUrl &url)
{
- if (!url.isValid())
+ if (!url.isValid() || url.scheme().isEmpty())
return false;
QCFType<CFURLRef> cfUrl = CFURLCreateWithString(0, QCFString(QString::fromLatin1(url.toEncoded())), 0);
@@ -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,9 +154,8 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString path = getFullPath(ref);
QString appName = QCoreApplication::applicationName();
- if (!appName.isEmpty() &&
- (QDesktopServices::DataLocation == type || QDesktopServices::CacheLocation == type))
- path += QLatin1String("/") + appName;
+ if (!appName.isEmpty() && (type == DataLocation || type == CacheLocation))
+ path += QLatin1Char('/') + appName;
return path;
}