From 053676a80e6fd3d415fd1915968b22bd5fb87704 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 2 Jan 2012 23:36:05 +0100 Subject: QStandardPaths: add GenericCacheLocation. Much like DataLocation = GenericDataLocation + domain + appname, this makes CacheLocation = GenericCacheLocation + domain + appname. This way a framework library can have an application-independent cache (like ksycoca). Change-Id: I6a8c47ff85b7d5c68b594cc8b071a752d96b029d Reviewed-by: Bradley T. Hughes Reviewed-by: Thiago Macieira --- src/corelib/io/qstandardpaths_unix.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/corelib/io/qstandardpaths_unix.cpp') diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index b1c5869f71..4a4b5049aa 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -62,15 +62,18 @@ QString QStandardPaths::writableLocation(StandardLocation type) case TempLocation: return QDir::tempPath(); case CacheLocation: + case GenericCacheLocation: { // http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html QString xdgCacheHome = QFile::decodeName(qgetenv("XDG_CACHE_HOME")); if (xdgCacheHome.isEmpty()) xdgCacheHome = QDir::homePath() + QLatin1String("/.cache"); - if (!QCoreApplication::organizationName().isEmpty()) - xdgCacheHome += QLatin1Char('/') + QCoreApplication::organizationName(); - if (!QCoreApplication::applicationName().isEmpty()) - xdgCacheHome += QLatin1Char('/') + QCoreApplication::applicationName(); + if (type == QStandardPaths::CacheLocation) { + if (!QCoreApplication::organizationName().isEmpty()) + xdgCacheHome += QLatin1Char('/') + QCoreApplication::organizationName(); + if (!QCoreApplication::applicationName().isEmpty()) + xdgCacheHome += QLatin1Char('/') + QCoreApplication::applicationName(); + } return xdgCacheHome; } case DataLocation: -- cgit v1.2.3 From 1fdfc2abfe1fa26b86028934d4853432e25b4655 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 5 Jan 2012 14:03:39 +1000 Subject: Update copyright year in license headers. Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern --- src/corelib/io/qstandardpaths_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io/qstandardpaths_unix.cpp') diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index 4a4b5049aa..5aef52eaba 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -- cgit v1.2.3