summaryrefslogtreecommitdiffabout
path: root/microkde
Side-by-side diff
Diffstat (limited to 'microkde') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kdecore/klibloader.cpp6
-rw-r--r--microkde/kdecore/kstandarddirs.cpp17
2 files changed, 21 insertions, 2 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
@@ -375,71 +375,77 @@ QString KLibLoader::findLibrary( const char * name/*US , const KInstance * insta
/*US
if (libname.find('.', pos) < 0) {
libname += ".la";
}
*/
//US in the microedition we work only with shared libraries.
if (libname.find('.', pos) < 0) {
libname += ".so";
}
// only look up the file if it is not an absolute filename
// (mhk, 20000228)
QString libfile;
if (libname[0] == '/')
libfile = libname;
else
{
//US at this point the libname must exist as real filesname. No expansions will be made later
// 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() )
{
#ifndef NDEBUG
kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl;
self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname);
qDebug("KLibLoader::library could not find library: %s", libname.data());
#endif
}
else
self()->d->errorMessage = QString::null;
}
+
+ //qDebug("return libfile = %s ",libfile.latin1() );
return libfile;
}
KLibrary* KLibLoader::globalLibrary( const char *name )
{
KLibrary *tmp;
/*US
int olt_dlopen_flag = lt_dlopen_flag;
lt_dlopen_flag |= LT_GLOBAL;
kdDebug(150) << "Loading the next library global with flag "
<< lt_dlopen_flag
<< "." << endl;
*/
tmp = library(name);
/*US
lt_dlopen_flag = olt_dlopen_flag;
*/
return tmp;
}
KLibrary* KLibLoader::library( 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
@@ -21,48 +21,50 @@
/*
* Author: Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org>
* Version: $Id$
* Generated: Thu Mar 5 16:05:28 EST 1998
*/
//US #include "config.h"
#include <stdlib.h>
#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 <qapplication.h>
+
#include <qstringlist.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
#include <qtextedit.h>
void ddd( QString op )
{
static QTextEdit * dot = 0;
if ( ! dot )
dot = new QTextEdit();
@@ -328,58 +330,66 @@ QStringList KStandardDirs::findDirs( const char *type,
for (QStringList::ConstIterator it = candidates.begin();
it != candidates.end(); it++) {
testdir.setPath(*it + reldir);
if (testdir.exists())
list.append(testdir.absPath() + '/');
}
return list;
}
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;
-
+#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)
{
//US struct stat buff;
QFileInfo fullPathInfo(QFile::encodeName(fullPath));
//US if (access(QFile::encodeName(fullPath), R_OK) == 0 && fullPathInfo.isReadable())
if (fullPathInfo.isReadable())
{
if (fullPath.at(fullPath.length() - 1) != '/') {
//US if (S_ISREG( buff.st_mode ))
if (fullPathInfo.isFile())
return true;
}
else {
//US if (S_ISDIR( buff.st_mode ))
if (fullPathInfo.isDir())
return true;
}
}
@@ -1203,49 +1213,52 @@ static QString readEnvPath(const char *env)
void KStandardDirs::addKDEDefaults()
{
//qDebug("ERROR: KStandardDirs::addKDEDefaults() called ");
//return;
QStringList kdedirList;
// 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
+
+#ifndef DESKTOP_VERSION
kdedirList.append(readEnvPath("QPEDIR" ));
+#endif
#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) != '/')
localKdeDir += '/';
}
else
{
localKdeDir = QDir::homeDirPath() + "/kdepim/";
}
}
else