kdelibs/kdecore
Waldo Bastian
bastian at kde.org
Fri Jun 6 11:20:05 BST 2003
CVS commit by waba:
CCMAIL: kde-core-devel at kde.org
Replace fixHomeDir with KShell::tildeExpand.
M +9 -19 kstandarddirs.cpp 1.160
--- kdelibs/kdecore/kstandarddirs.cpp #1.159:1.160
@@ -49,4 +49,5 @@
#include "kdebug.h"
#include "kinstance.h"
+#include "kshell.h"
#include <sys/param.h>
#include <unistd.h>
@@ -991,12 +992,4 @@ static QString readEnvPath(const char *e
}
-static void fixHomeDir(QString &dir)
-{
- if (dir[0] == '~')
- {
- dir = QDir::homeDirPath() + dir.mid(1);
- }
-}
-
void KStandardDirs::addKDEDefaults()
{
@@ -1014,5 +1007,5 @@ void KStandardDirs::addKDEDefaults()
if (!kdedir.isEmpty())
{
- fixHomeDir(kdedir);
+ kdedir = KShell::tildeExpand(kdedir);
kdedirList.append(kdedir);
}
@@ -1060,5 +1053,5 @@ void KStandardDirs::addKDEDefaults()
if (localKdeDir != "-/")
{
- fixHomeDir(localKdeDir);
+ localKdeDir = KShell::tildeExpand(localKdeDir);
addPrefix(localKdeDir);
}
@@ -1067,6 +1060,5 @@ void KStandardDirs::addKDEDefaults()
it != kdedirList.end(); it++)
{
- QString dir = *it;
- fixHomeDir(dir);
+ QString dir = KShell::tildeExpand(*it);
addPrefix(dir);
}
@@ -1105,5 +1097,5 @@ void KStandardDirs::addKDEDefaults()
}
- fixHomeDir(localXdgDir);
+ localXdgDir = KShell::tildeExpand(localXdgDir);
addXdgConfigPrefix(localXdgDir);
@@ -1111,6 +1103,5 @@ void KStandardDirs::addKDEDefaults()
it != xdgdirList.end(); it++)
{
- QString dir = *it;
- fixHomeDir(dir);
+ QString dir = KShell::tildeExpand(*it);
addXdgConfigPrefix(dir);
}
@@ -1158,5 +1149,5 @@ void KStandardDirs::addKDEDefaults()
}
- fixHomeDir(localXdgDir);
+ localXdgDir = KShell::tildeExpand(localXdgDir);
addXdgDataPrefix(localXdgDir);
@@ -1164,6 +1155,5 @@ void KStandardDirs::addKDEDefaults()
it != xdgdirList.end(); it++)
{
- QString dir = *it;
- fixHomeDir(dir);
+ QString dir = KShell::tildeExpand(*it);
addXdgDataPrefix(dir);
}
More information about the kde-core-devel
mailing list