summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qdesktopservices_s60.cpp
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2011-10-21 20:12:01 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-23 00:56:31 +0200
commit86558de34134f67cf3815a29612edc2d730f2ea2 (patch)
tree868417b17bac24be1f17080680af0f614a98b9b6 /src/gui/util/qdesktopservices_s60.cpp
parent4a788eb8313d7c089e3a59594fc6a5c9a7dd6499 (diff)
Move path information from QDesktopServices (gui) to QStandardPaths (core)
Change-Id: Ic596c21894d83b4dab0c3f5b1aed916ddd590f2f Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/util/qdesktopservices_s60.cpp')
-rw-r--r--src/gui/util/qdesktopservices_s60.cpp125
1 files changed, 0 insertions, 125 deletions
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp
index 41fc0f3b3c..f4d8fe99e1 100644
--- a/src/gui/util/qdesktopservices_s60.cpp
+++ b/src/gui/util/qdesktopservices_s60.cpp
@@ -327,130 +327,5 @@ static bool openDocument(const QUrl &file)
#endif //USE_SCHEMEHANDLER
-// Common functions to all implementations
-
-static TDriveUnit exeDrive()
-{
- RProcess me;
- TFileName processFileName = me.FileName();
- TDriveUnit drive(processFileName);
- return drive;
-}
-
-static TDriveUnit writableExeDrive()
-{
- TDriveUnit drive = exeDrive();
- if (drive.operator TInt() == EDriveZ)
- return TDriveUnit(EDriveC);
- return drive;
-}
-
-static TPtrC writableDataRoot()
-{
- TDriveUnit drive = exeDrive();
- switch (drive.operator TInt()){
- case EDriveC:
- return PathInfo::PhoneMemoryRootPath();
- break;
- case EDriveE:
- return PathInfo::MemoryCardRootPath();
- break;
- case EDriveZ:
- // It is not possible to write on ROM drive ->
- // return phone mem root path instead
- return PathInfo::PhoneMemoryRootPath();
- break;
- default:
- return PathInfo::PhoneMemoryRootPath();
- break;
- }
-}
-
-QString QDesktopServices::storageLocation(StandardLocation type)
-{
- TFileName path;
-
- switch (type) {
- case DesktopLocation:
- qWarning("No desktop concept in Symbian OS");
- // But lets still use some feasible default
- path.Append(writableDataRoot());
- break;
- case DocumentsLocation:
- path.Append(writableDataRoot());
- break;
- case FontsLocation:
- path.Append(KFontsDir);
- break;
- case ApplicationsLocation:
- path.Append(exeDrive().Name());
- path.Append(KSysBin);
- break;
- case MusicLocation:
- path.Append(writableDataRoot());
- path.Append(PathInfo::SoundsPath());
- break;
- case MoviesLocation:
- path.Append(writableDataRoot());
- path.Append(PathInfo::VideosPath());
- break;
- case PicturesLocation:
- path.Append(writableDataRoot());
- path.Append(PathInfo::ImagesPath());
- break;
- case TempLocation:
- return QDir::tempPath();
- break;
- case HomeLocation:
- path.Append(writableDataRoot());
- //return QDir::homePath(); break;
- break;
- case DataLocation:
- qt_s60GetRFs().PrivatePath(path);
- path.Insert(0, writableExeDrive().Name());
- break;
- case CacheLocation:
- qt_s60GetRFs().PrivatePath(path);
- path.Insert(0, writableExeDrive().Name());
- path.Append(KCacheSubDir);
- break;
- default:
- // Lets use feasible default
- path.Append(writableDataRoot());
- break;
- }
-
- // Convert to cross-platform format and clean the path
- QString nativePath = QString::fromUtf16(path.Ptr(), path.Length());
- QString qtPath = QDir::fromNativeSeparators(nativePath);
- qtPath = QDir::cleanPath(qtPath);
-
- // Note: The storage location returned can be a directory that does not exist;
- // i.e., it may need to be created by the system or the user.
- return qtPath;
-}
-
-typedef QString (*LocalizerFunc)(QString&);
-
-static QString defaultLocalizedDirectoryName(QString&)
-{
- return QString();
-}
-
-QString QDesktopServices::displayName(StandardLocation type)
-{
- static LocalizerFunc ptrLocalizerFunc = NULL;
-
- if (!ptrLocalizerFunc) {
- ptrLocalizerFunc = reinterpret_cast<LocalizerFunc>
- (qt_resolveS60PluginFunc(S60Plugin_LocalizedDirectoryName));
- if (!ptrLocalizerFunc)
- ptrLocalizerFunc = &defaultLocalizedDirectoryName;
- }
-
- QString rawPath = storageLocation(type);
- return ptrLocalizerFunc(rawPath);
-}
-
QT_END_NAMESPACE