author | ulf69 <ulf69> | 2004-06-29 05:35:06 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-06-29 05:35:06 (UTC) |
commit | b863f47dbb927a54f492b70ac59f3f99202dd7ca (patch) (side-by-side diff) | |
tree | c5fffc44350972f0e7c963ea1ac98f2d5ce2dcfa | |
parent | ed68714fca68286417778f0f5378b9f65d4acaa3 (diff) | |
download | kdepimpi-b863f47dbb927a54f492b70ac59f3f99202dd7ca.zip kdepimpi-b863f47dbb927a54f492b70ac59f3f99202dd7ca.tar.gz kdepimpi-b863f47dbb927a54f492b70ac59f3f99202dd7ca.tar.bz2 |
added Qtopia as directory to search for libraries (Qtopia/libs)
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 5abe05c..1a1e027 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp @@ -30,32 +30,33 @@ #include <assert.h> //US#include <errno.h> //US #ifdef HAVE_SYS_STAT_H //US #include <sys/stat.h> //US #endif //US#include <sys/types.h> //US#include <dirent.h> //US#include <pwd.h> #include <qregexp.h> #include <qasciidict.h> #include <qdict.h> #include <qdir.h> #include <qfileinfo.h> #include <qstring.h> #include <qstringlist.h> +#include <qpe/qpeapplication.h> #include "kstandarddirs.h" #include "kconfig.h" #include "kdebug.h" //US #include "kinstance.h" #include "kshell.h" //US#include <sys/param.h> //US#include <unistd.h> //US QString KStandardDirs::mAppDir = QString::null; template class QDict<QStringList>; #if 0 @@ -337,36 +338,37 @@ QStringList KStandardDirs::findDirs( const char *type, QString KStandardDirs::findResourceDir( const char *type, const QString& filename) const { #ifndef NDEBUG if (filename.isEmpty()) { kdWarning() << "filename for type " << type << " in KStandardDirs::findResourceDir is not supposed to be empty!!" << endl; return QString::null; } #endif if (d && d->restrictionsActive && (strcmp(type, "data")==0)) applyDataRestrictions(filename); QStringList candidates = resourceDirs(type); QString fullPath; - for (QStringList::ConstIterator it = candidates.begin(); - it != candidates.end(); it++) + for (QStringList::ConstIterator it = candidates.begin(); it != candidates.end(); it++) + { if (exists(*it + filename)) return *it; + } #ifndef NDEBUG if(false && type != "locale") kdDebug() << "KStdDirs::findResDir(): can't find \"" << filename << "\" in type \"" << type << "\"." << endl; #endif return QString::null; } bool KStandardDirs::exists(const QString &fullPath) { //US struct stat buff; QFileInfo fullPathInfo(QFile::encodeName(fullPath)); //US if (access(QFile::encodeName(fullPath), R_OK) == 0 && fullPathInfo.isReadable()) if (fullPathInfo.isReadable()) @@ -384,32 +386,33 @@ bool KStandardDirs::exists(const QString &fullPath) } return false; } static void lookupDirectory(const QString& path, const QString &relPart, const QRegExp ®exp, QStringList& list, QStringList& relList, bool recursive, bool uniq) { QString pattern = regexp.pattern(); if (recursive || pattern.contains('?') || pattern.contains('*')) { // We look for a set of files. //US DIR *dp = opendir( QFile::encodeName(path)); QDir dp(QFile::encodeName(path)); + if (!dp.exists()) return; static int iii = 0; ++iii; if ( iii == 5 ) abort(); assert(path.at(path.length() - 1) == '/'); //US struct dirent *ep; //US struct stat buff; QString _dot("."); QString _dotdot(".."); //US while( ( ep = readdir( dp ) ) != 0L ) QStringList direntries = dp.entryList(); @@ -1208,32 +1211,34 @@ void KStandardDirs::addKDEDefaults() // begin KDEDIRS QString kdedirs = readEnvPath("MICROKDEDIRS"); if (!kdedirs.isEmpty()) { tokenize(kdedirList, kdedirs, ":"); } else { QString kdedir = readEnvPath("MICROKDEDIR"); if (!kdedir.isEmpty()) { kdedir = KShell::tildeExpand(kdedir); kdedirList.append(kdedir); } } //US kdedirList.append(KDEDIR); +//US for embedded, add qtopia dir as kdedir + kdedirList.append(QPEApplication::qpeDir()); #ifdef __KDE_EXECPREFIX QString execPrefix(__KDE_EXECPREFIX); if (execPrefix!="NONE") kdedirList.append(execPrefix); #endif QString localKdeDir; //US if (getuid()) if (true) { localKdeDir = readEnvPath("MICROKDEHOME"); if (!localKdeDir.isEmpty()) { if (localKdeDir.at(localKdeDir.length()-1) != '/') |