summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-03-15 23:22:34 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-22 18:59:45 +0100
commit3b2ccf1277e1d673a0a4bcfd81565fc7cf5cc5a6 (patch)
tree29b0d74c50f4fe5e70fe80102b39dac48daa7c62
parent349c0de0912884388f2490d4bfd6905424ccf194 (diff)
QStandardPaths: implement displayName() on all platforms.
It was only implemented on Mac OSX until now (all this came from the QDesktopServices code). Change-Id: I7fd81d80ca77cf0ca6c213f59813a6163abe7dc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/io/qstandardpaths.cpp42
-rw-r--r--src/corelib/io/qstandardpaths_json.cpp6
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp6
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp6
4 files changed, 42 insertions, 18 deletions
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 78bf6c7b96..55f824cdeb 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -267,6 +267,48 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
an empty QString if no relevant location can be found.
*/
+#ifndef Q_OS_MAC
+QString QStandardPaths::displayName(StandardLocation type)
+{
+ switch (type) {
+ case DesktopLocation:
+ return QCoreApplication::translate("QStandardPaths", "Desktop");
+ case DocumentsLocation:
+ return QCoreApplication::translate("QStandardPaths", "Documents");
+ case FontsLocation:
+ return QCoreApplication::translate("QStandardPaths", "Fonts");
+ case ApplicationsLocation:
+ return QCoreApplication::translate("QStandardPaths", "Applications");
+ case MusicLocation:
+ return QCoreApplication::translate("QStandardPaths", "Music");
+ case MoviesLocation:
+ return QCoreApplication::translate("QStandardPaths", "Movies");
+ case PicturesLocation:
+ return QCoreApplication::translate("QStandardPaths", "Pictures");
+ case TempLocation:
+ return QCoreApplication::translate("QStandardPaths", "Temporary Directory");
+ case HomeLocation:
+ return QCoreApplication::translate("QStandardPaths", "Home");
+ case DataLocation:
+ return QCoreApplication::translate("QStandardPaths", "Application Data");
+ case CacheLocation:
+ return QCoreApplication::translate("QStandardPaths", "Cache");
+ case GenericDataLocation:
+ return QCoreApplication::translate("QStandardPaths", "Shared Data");
+ case RuntimeLocation:
+ return QCoreApplication::translate("QStandardPaths", "Runtime");
+ case ConfigLocation:
+ return QCoreApplication::translate("QStandardPaths", "Configuration");
+ case GenericCacheLocation:
+ return QCoreApplication::translate("QStandardPaths", "Shared Cache");
+ case DownloadLocation:
+ return QCoreApplication::translate("QStandardPaths", "Download");
+ }
+ // not reached
+ return QString();
+}
+#endif
+
QT_END_NAMESPACE
#endif // QT_NO_STANDARDPATHS
diff --git a/src/corelib/io/qstandardpaths_json.cpp b/src/corelib/io/qstandardpaths_json.cpp
index 52b194bea8..7d7a0a9f28 100644
--- a/src/corelib/io/qstandardpaths_json.cpp
+++ b/src/corelib/io/qstandardpaths_json.cpp
@@ -173,12 +173,6 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
return dirs;
}
-QString QStandardPaths::displayName(StandardLocation type)
-{
- Q_UNUSED(type);
- return QString();
-}
-
QT_END_NAMESPACE
#endif // QT_NO_STANDARDPATHS
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index b27b19eac9..1a2ae96edb 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -280,12 +280,6 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
return dirs;
}
-QString QStandardPaths::displayName(StandardLocation type)
-{
- Q_UNUSED(type);
- return QString();
-}
-
QT_END_NAMESPACE
#endif // QT_NO_STANDARDPATHS
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index 848dd448eb..8bd32eb1d4 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -206,12 +206,6 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
return dirs;
}
-QString QStandardPaths::displayName(StandardLocation type)
-{
- Q_UNUSED(type);
- return QString();
-}
-
QT_END_NAMESPACE
#endif // QT_NO_STANDARDPATHS