-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 7f2a326..1c3e0ae 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp @@ -37,16 +37,17 @@ //US#include <pwd.h> #include <qregexp.h> #include <qasciidict.h> #include <qdict.h> #include <qdir.h> #include <qfileinfo.h> #include <qstring.h> +#include <qmessagebox.h> #include <qapplication.h> #include <qstringlist.h> #include "kstandarddirs.h" #include "kconfig.h" #include "kdebug.h" //US #include "kinstance.h" @@ -1199,28 +1200,32 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) i = pos + 1; } return true; } static QString readEnvPath(const char *env) { -#ifdef _WIN32_ - return ""; -#else - QCString c_path = getenv(env); - if (c_path.isEmpty()) - return QString::null; - return QFile::decodeName(c_path); -#endif + //#ifdef _WIN32_ + // return ""; + //#else + QCString c_path; + if ( getenv(env) != NULL ) + c_path = QString ( getenv(env) ); + if (c_path.isEmpty()) + return QString::null; + return QFile::decodeName(c_path); + //#endif + } void KStandardDirs::addKDEDefaults() { + //qDebug("ERROR: KStandardDirs::addKDEDefaults() called "); //return; QStringList kdedirList; // begin KDEDIRS QString kdedirs = readEnvPath("MICROKDEDIRS"); if (!kdedirs.isEmpty()) { @@ -1262,18 +1267,24 @@ void KStandardDirs::addKDEDefaults() QString localKdeDir; //US if (getuid()) if (true) { localKdeDir = readEnvPath("MICROKDEHOME"); if (!localKdeDir.isEmpty()) { +#ifdef _WIN32_ + if (localKdeDir.at(localKdeDir.length()-1) != '\\') + localKdeDir += '\\'; +#else if (localKdeDir.at(localKdeDir.length()-1) != '/') localKdeDir += '/'; +#endif + //QMessageBox::information( 0,"localKdeDir",localKdeDir, 1 ); } else { localKdeDir = QDir::homeDirPath() + "/kdepim/"; } } else { |