summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qdesktopservices_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/util/qdesktopservices_win.cpp')
-rw-r--r--src/gui/util/qdesktopservices_win.cpp86
1 files changed, 0 insertions, 86 deletions
diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp
index b06b52e399..8b120b4bf1 100644
--- a/src/gui/util/qdesktopservices_win.cpp
+++ b/src/gui/util/qdesktopservices_win.cpp
@@ -172,92 +172,6 @@ static bool launchWebBrowser(const QUrl &url)
return (returnValue > 32);
}
-QString QDesktopServices::storageLocation(StandardLocation type)
-{
- QString result;
-
-#ifndef Q_OS_WINCE
- QSystemLibrary library(QLatin1String("shell32"));
-#else
- QSystemLibrary library(QLatin1String("coredll"));
-#endif // Q_OS_WINCE
- typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL);
- static GetSpecialFolderPath SHGetSpecialFolderPath =
- (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW");
- if (!SHGetSpecialFolderPath)
- return QString();
-
- wchar_t path[MAX_PATH];
-
- switch (type) {
- case DataLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE))
- result = QString::fromWCharArray(path);
- if (!QCoreApplication::organizationName().isEmpty())
- result = result + QLatin1String("\\") + QCoreApplication::organizationName();
- if (!QCoreApplication::applicationName().isEmpty())
- result = result + QLatin1String("\\") + QCoreApplication::applicationName();
- break;
-
- case DesktopLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_DESKTOPDIRECTORY, FALSE))
- result = QString::fromWCharArray(path);
- break;
-
- case DocumentsLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_PERSONAL, FALSE))
- result = QString::fromWCharArray(path);
- break;
-
- case FontsLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_FONTS, FALSE))
- result = QString::fromWCharArray(path);
- break;
-
- case ApplicationsLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_PROGRAMS, FALSE))
- result = QString::fromWCharArray(path);
- break;
-
- case MusicLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_MYMUSIC, FALSE))
- result = QString::fromWCharArray(path);
- break;
-
- case MoviesLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_MYVIDEO, FALSE))
- result = QString::fromWCharArray(path);
- break;
-
- case PicturesLocation:
- if (SHGetSpecialFolderPath(0, path, CSIDL_MYPICTURES, FALSE))
- result = QString::fromWCharArray(path);
- break;
-
- case CacheLocation:
- // Although Microsoft has a Cache key it is a pointer to IE's cache, not a cache
- // location for everyone. Most applications seem to be using a
- // cache directory located in their AppData directory
- return storageLocation(DataLocation) + QLatin1String("\\cache");
-
- case QDesktopServices::HomeLocation:
- return QDir::homePath(); break;
-
- case QDesktopServices::TempLocation:
- return QDir::tempPath(); break;
-
- default:
- break;
- }
- return result;
-}
-
-QString QDesktopServices::displayName(StandardLocation type)
-{
- Q_UNUSED(type);
- return QString();
-}
-
QT_END_NAMESPACE
#endif // QT_NO_DESKTOPSERVICES