-rw-r--r-- | microkde/kdecore/klibloader.cpp | 6 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 21 |
2 files changed, 23 insertions, 4 deletions
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp index c091e05..9eee912 100644 --- a/microkde/kdecore/klibloader.cpp +++ b/microkde/kdecore/klibloader.cpp @@ -393,17 +393,21 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta // in findResources. Because of that we prepend the lib prefix here to the name //US I add also the "lib" prefix. I do not how could this could have worked before without it? libname.insert(pos, "lib"); //US libfile = instance->dirs()->findResource( "module", libname ); + //qDebug("libname = %s ",libname.data() ); libfile = KGlobal::dirs()->findResource( "module", libname ); + //qDebug("libfile = %s ",libfile.latin1() ); + if ( libfile.isEmpty() ) { //US libfile = instance->dirs()->findResource( "lib", libname ); libfile = KGlobal::dirs()->findResource( "lib", libname ); + //qDebug("libfile2 = %s ",libfile.latin1() ); #ifndef NDEBUG if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl; #endif } if ( libfile.isEmpty() ) @@ -416,12 +420,14 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta #endif } else self()->d->errorMessage = QString::null; } + + //qDebug("return libfile = %s ",libfile.latin1() ); return libfile; } KLibrary* KLibLoader::globalLibrary( const char *name ) { diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 7f51d78..e1c78f6 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp @@ -39,12 +39,14 @@ #include <qregexp.h> #include <qasciidict.h> #include <qdict.h> #include <qdir.h> #include <qfileinfo.h> #include <qstring.h> +#include <qapplication.h> + #include <qstringlist.h> #include "kstandarddirs.h" #include "kconfig.h" #include "kdebug.h" //US #include "kinstance.h" @@ -346,22 +348,30 @@ QString KStandardDirs::findResourceDir( const char *type, #endif if (d && d->restrictionsActive && (strcmp(type, "data")==0)) applyDataRestrictions(filename); QStringList candidates = resourceDirs(type); QString fullPath; - +#ifdef DESKTOP_VERSION +#ifdef _WIN32_ + candidates.prepend( qApp->applicationDirPath () +"\\"); +#else + candidates.prepend( qApp->applicationDirPath () +"/"); +#endif +#endif for (QStringList::ConstIterator it = candidates.begin(); it != candidates.end(); it++) { + //qDebug("looking for dir %s - file %s", (*it).latin1(), filename.latin1()); if (exists(*it + filename)) return *it; } #ifndef NDEBUG if(false && type != "locale") - kdDebug() << "KStdDirs::findResDir(): can't find \"" << filename << "\" in type \"" << type << "\"." << endl; + qDebug("KStdDirs::findResDir(): can't find %s ", filename.latin1()); + #endif return QString::null; } bool KStandardDirs::exists(const QString &fullPath) @@ -966,15 +976,15 @@ QString KStandardDirs::kde_default(const char *type) { return "share/wallpapers/"; if (!strcmp(type, "templates")) return "share/templates/"; if (!strcmp(type, "exe")) return "bin/"; if (!strcmp(type, "lib")) - return "lib/"; + return "lib/"; if (!strcmp(type, "module")) - return "lib/kde3/"; + return "lib/kde3/"; if (!strcmp(type, "qtplugins")) return "lib/kde3/plugins"; if (!strcmp(type, "xdgdata-apps")) return "applications/"; if (!strcmp(type, "xdgdata-dirs")) return "desktop-directories/"; @@ -1221,13 +1231,16 @@ void KStandardDirs::addKDEDefaults() kdedir = KShell::tildeExpand(kdedir); kdedirList.append(kdedir); } } //US kdedirList.append(KDEDIR); //US for embedded, add qtopia dir as kdedir + +#ifndef DESKTOP_VERSION kdedirList.append(readEnvPath("QPEDIR" )); +#endif #ifdef __KDE_EXECPREFIX QString execPrefix(__KDE_EXECPREFIX); if (execPrefix!="NONE") kdedirList.append(execPrefix); #endif |