summaryrefslogtreecommitdiff
authoreilers <eilers>2003-11-17 16:02:31 (UTC)
committer eilers <eilers>2003-11-17 16:02:31 (UTC)
commit74a1afb21424a4f69c7a01fda2cc517daf69fd82 (patch) (side-by-side diff)
treeff509880b5c14281bbb2bb05a6519bf081612525
parente206333876a37ae188fe2889bb079158611cebe3 (diff)
downloadopie-74a1afb21424a4f69c7a01fda2cc517daf69fd82.zip
opie-74a1afb21424a4f69c7a01fda2cc517daf69fd82.tar.gz
opie-74a1afb21424a4f69c7a01fda2cc517daf69fd82.tar.bz2
Fixing the ".so" stuff for MacOS-X .. Quicklauncher apps are now
loaded successfully..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/tools/quicklauncher/dropins.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/tools/quicklauncher/dropins.h b/core/tools/quicklauncher/dropins.h
index fe43ec2..3e2b5fd 100644
--- a/core/tools/quicklauncher/dropins.h
+++ b/core/tools/quicklauncher/dropins.h
@@ -1,61 +1,70 @@
#include <qstring.h>
#include <qtopia/qcom.h>
#include <qtopia/qlibrary.h>
#include <qtopia/applicationinterface.h>
#include <qtopia/resource.h>
#include <opie/owait.h>
#include <qmetaobject.h>
#include <qmap.h>
namespace Opie {
struct PluginLoader {
PluginLoader( const char* ) {
}
QRESULT queryInterface( const QString& app, const QUuid&, QUnknownInterface** );
void releaseInterface( QUnknownInterface* );
QMap<QUnknownInterface*, QLibrary*> libs;
};
/*
* We can skip installing a Translator here because Opies QPEApplication
* will do that in initApp for us as well
*/
QRESULT PluginLoader::queryInterface( const QString& libFile, const QUuid& uuid, QUnknownInterface** iface ) {
QRESULT res = QS_FALSE;
*iface = 0;
+ // This code is very platform specific.. We should find better
+ // solutions to handle names.. Maybe one central function would be
+ // better than checking this ".so" stuff all around in the sources..
+ // (eilers)
+
// Below lines from TT then mine again
QString name = libFile;
if ( libFile.findRev(".so") == (int)libFile.length()-3 ) {
name = libFile.left( libFile.length()-3 );
if ( name.find( "lib" ) == 0 )
name = name.mid( 3 );
}
+#ifdef Q_OS_MACX
+ QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".dylib";
+#else
QString path = QPEApplication::qpeDir() + "/plugins/application/lib"+name+".so";
+#endif
QLibrary *lib = new QLibrary( path );
if ( lib->queryInterface( uuid, iface ) == QS_OK && iface ) {
libs.insert( *iface, lib );
res = QS_OK;
}
return res;
}
void PluginLoader::releaseInterface( QUnknownInterface* iface ) {
if ( libs.contains( iface ) ) {
iface->release();
delete libs[iface];
libs.remove( iface ); // we only handle pointers so even if the object is not valid the address-space is
}
}
}
/* small hack ;) */
using namespace Opie;