aboutsummaryrefslogtreecommitdiff
path: root/src/corelib/theme/mthemedaemon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/theme/mthemedaemon.cpp')
-rw-r--r--src/corelib/theme/mthemedaemon.cpp34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/corelib/theme/mthemedaemon.cpp b/src/corelib/theme/mthemedaemon.cpp
index 3bfbe3d8..abdaae26 100644
--- a/src/corelib/theme/mthemedaemon.cpp
+++ b/src/corelib/theme/mthemedaemon.cpp
@@ -35,6 +35,7 @@
#include "mimagedirectory.h"
#include "mthemedaemonprotocol.h"
#include "mpixmaphandle.h"
+#include "msystemdirectories.h"
using namespace M::MThemeDaemonProtocol;
@@ -79,38 +80,7 @@ QString MThemeDaemon::systemThemeDirectory()
QString MThemeDaemon::systemThemeCacheDirectory()
{
- static QString cacheDir;
- if (cacheDir.isEmpty()) {
- // first check if we can write to CACHEDIR
-#ifdef Q_OS_WIN
- QDir appDir(QCoreApplication::applicationDirPath());
-
- appDir.cdUp();
-
- cacheDir = appDir.absolutePath()
- + QDir::separator() + "var"
- + QDir::separator() + "cache"
- + QDir::separator() + "meegotouch";
-#else
- cacheDir = CACHEDIR;
-#endif
- QDir().mkpath(cacheDir);
- QFile testFile(cacheDir + QDir::separator() + "permission_test_file");
- if (!testFile.open(QFile::WriteOnly)) {
- // now we try a standard cache location
- cacheDir = QDesktopServices::storageLocation(QDesktopServices::CacheLocation)
- + QDir::separator() + QLatin1String("meegotouch");
- QDir().mkpath(cacheDir);
- testFile.setFileName(cacheDir + QDir::separator() + "permission_test_file");
- if (!testFile.open(QFile::WriteOnly)) {
- exit(EXIT_FAILURE);
- }
- }
- testFile.remove();
- testFile.close();
- }
-
- return cacheDir + QDir::separator() + QLatin1String("themedaemon");
+ return MSystemDirectories::cacheDirectory() + QLatin1String("themedaemon") + QDir::separator();
}
void MThemeDaemon::addClient(MThemeDaemonClient *client)