author | eilers <eilers> | 2003-11-03 16:52:18 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-11-03 16:52:18 (UTC) |
commit | d34dc773591a2d467c68875a68a671d6a809f861 (patch) (unidiff) | |
tree | b57e5ae15c51e3d87ca95d57aedfd1ca3db57bfe /core | |
parent | ce84f2d8bdd65c438821f0457cdad6bbbfa73380 (diff) | |
download | opie-d34dc773591a2d467c68875a68a671d6a809f861.zip opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.gz opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.bz2 |
Porting Opie to MacOS-X.
The base system and all platform independent applications and platforms
should work.
Please see $OPIEDIR/development/macosx for details
33 files changed, 381 insertions, 56 deletions
diff --git a/core/applets/batteryapplet/batteryapplet.pro b/core/applets/batteryapplet/batteryapplet.pro index c68ceb7..1bc208b 100644 --- a/core/applets/batteryapplet/batteryapplet.pro +++ b/core/applets/batteryapplet/batteryapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS= battery.h batterystatus.h batteryappletimpl.h | 3 | HEADERS= battery.h batterystatus.h batteryappletimpl.h |
4 | SOURCES= battery.cpp batterystatus.cpp batteryappletimpl.cpp | 4 | SOURCES= battery.cpp batterystatus.cpp batteryappletimpl.cpp |
5 | TARGET = batteryapplet | 5 | TARGET = batteryapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += ../$(OPIEDIR)/include .. | 8 | DEPENDPATH += ../$(OPIEDIR)/include .. |
9 | LIBS += -lqpe -lopie | 9 | LIBS += -lqpe -lopie |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/cardmon/cardmon.pro b/core/applets/cardmon/cardmon.pro index 3907aa4..75facde 100644 --- a/core/applets/cardmon/cardmon.pro +++ b/core/applets/cardmon/cardmon.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS =cardmon.h cardmonimpl.h | 3 | HEADERS =cardmon.h cardmonimpl.h |
4 | SOURCES =cardmon.cpp cardmonimpl.cpp | 4 | SOURCES =cardmon.cpp cardmonimpl.cpp |
5 | TARGET = cardmonapplet | 5 | TARGET = cardmonapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include ../launcher | 8 | DEPENDPATH += $(OPIEDIR)/include ../launcher |
9 | LIBS += -lqpe -lopie | 9 | LIBS += -lqpe -lopie |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/clipboardapplet/clipboardapplet.pro b/core/applets/clipboardapplet/clipboardapplet.pro index 1e9cc4f..358d658 100644 --- a/core/applets/clipboardapplet/clipboardapplet.pro +++ b/core/applets/clipboardapplet/clipboardapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS= clipboard.h clipboardappletimpl.h | 3 | HEADERS= clipboard.h clipboardappletimpl.h |
4 | SOURCES= clipboard.cpp clipboardappletimpl.cpp | 4 | SOURCES= clipboard.cpp clipboardappletimpl.cpp |
5 | TARGET = clipboardapplet | 5 | TARGET = clipboardapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += ../$(OPIEDIR)/include | 8 | DEPENDPATH += ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/clockapplet/clockapplet.pro b/core/applets/clockapplet/clockapplet.pro index 22c7b55..88092f5 100644 --- a/core/applets/clockapplet/clockapplet.pro +++ b/core/applets/clockapplet/clockapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS= clock.h clockappletimpl.h | 3 | HEADERS= clock.h clockappletimpl.h |
4 | SOURCES= clock.cpp clockappletimpl.cpp | 4 | SOURCES= clock.cpp clockappletimpl.cpp |
5 | TARGET = clockapplet | 5 | TARGET = clockapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += ../$(OPIEDIR)/include .. | 8 | DEPENDPATH += ../$(OPIEDIR)/include .. |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/homeapplet/homeapplet.pro b/core/applets/homeapplet/homeapplet.pro index ac7956b..854050f 100644 --- a/core/applets/homeapplet/homeapplet.pro +++ b/core/applets/homeapplet/homeapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = home.h | 3 | HEADERS = home.h |
4 | SOURCES = home.cpp | 4 | SOURCES = home.cpp |
5 | TARGET = homeapplet | 5 | TARGET = homeapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/irdaapplet/irdaapplet.pro b/core/applets/irdaapplet/irdaapplet.pro index 56632ed..be16bad 100644 --- a/core/applets/irdaapplet/irdaapplet.pro +++ b/core/applets/irdaapplet/irdaapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = irda.h irdaappletimpl.h | 3 | HEADERS = irda.h irdaappletimpl.h |
4 | SOURCES = irda.cpp irdaappletimpl.cpp | 4 | SOURCES = irda.cpp irdaappletimpl.cpp |
5 | TARGET = irdaapplet | 5 | TARGET = irdaapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += ../$(OPIEDIR)/include | 8 | DEPENDPATH += ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/logoutapplet/logoutapplet.pro b/core/applets/logoutapplet/logoutapplet.pro index a019303..7826bb3 100644 --- a/core/applets/logoutapplet/logoutapplet.pro +++ b/core/applets/logoutapplet/logoutapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = logout.h | 3 | HEADERS = logout.h |
4 | SOURCES = logout.cpp | 4 | SOURCES = logout.cpp |
5 | TARGET = logoutapplet | 5 | TARGET = logoutapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/restartapplet/restartapplet.pro b/core/applets/restartapplet/restartapplet.pro index bd27b0a..368a0ea 100644 --- a/core/applets/restartapplet/restartapplet.pro +++ b/core/applets/restartapplet/restartapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = restart.h restartappletimpl.h | 3 | HEADERS = restart.h restartappletimpl.h |
4 | SOURCES = restart.cpp restartappletimpl.cpp | 4 | SOURCES = restart.cpp restartappletimpl.cpp |
5 | TARGET = restartapplet | 5 | TARGET = restartapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += ../$(OPIEDIR)/include | 8 | DEPENDPATH += ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/restartapplet2/restartapplet.pro b/core/applets/restartapplet2/restartapplet.pro index 85a3b66..12a7922 100644 --- a/core/applets/restartapplet2/restartapplet.pro +++ b/core/applets/restartapplet2/restartapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = restart.h | 3 | HEADERS = restart.h |
4 | SOURCES = restart.cpp | 4 | SOURCES = restart.cpp |
5 | TARGET = restartapplet | 5 | TARGET = restartapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/rotateapplet/rotateapplet.pro b/core/applets/rotateapplet/rotateapplet.pro index 9b39dba..2c8de8d 100644 --- a/core/applets/rotateapplet/rotateapplet.pro +++ b/core/applets/rotateapplet/rotateapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugn warn_on release |
3 | HEADERS = rotate.h | 3 | HEADERS = rotate.h |
4 | SOURCES = rotate.cpp | 4 | SOURCES = rotate.cpp |
5 | TARGET = rotateapplet | 5 | TARGET = rotateapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/screenshotapplet/screenshotapplet.pro b/core/applets/screenshotapplet/screenshotapplet.pro index fe7b299..a86eff2 100644 --- a/core/applets/screenshotapplet/screenshotapplet.pro +++ b/core/applets/screenshotapplet/screenshotapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = screenshot.h inputDialog.h screenshotappletimpl.h | 3 | HEADERS = screenshot.h inputDialog.h screenshotappletimpl.h |
4 | SOURCES = screenshot.cpp inputDialog.cpp screenshotappletimpl.cpp | 4 | SOURCES = screenshot.cpp inputDialog.cpp screenshotappletimpl.cpp |
5 | TARGET = screenshotapplet | 5 | TARGET = screenshotapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += ../$(OPIEDIR)/include | 8 | DEPENDPATH += ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/suspendapplet/suspendapplet.pro b/core/applets/suspendapplet/suspendapplet.pro index 7635d32..f58de63 100644 --- a/core/applets/suspendapplet/suspendapplet.pro +++ b/core/applets/suspendapplet/suspendapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = suspend.h | 3 | HEADERS = suspend.h |
4 | SOURCES = suspend.cpp | 4 | SOURCES = suspend.cpp |
5 | TARGET = suspendapplet | 5 | TARGET = suspendapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/vmemo/vmemo.pro b/core/applets/vmemo/vmemo.pro index 8cf1f07..43cb767 100644 --- a/core/applets/vmemo/vmemo.pro +++ b/core/applets/vmemo/vmemo.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = vmemo.h vmemoimpl.h adpcm.h | 3 | HEADERS = vmemo.h vmemoimpl.h adpcm.h |
4 | SOURCES = vmemo.cpp vmemoimpl.cpp adpcm.c | 4 | SOURCES = vmemo.cpp vmemoimpl.cpp adpcm.c |
5 | TARGET = vmemoapplet | 5 | TARGET = vmemoapplet |
6 | DESTDIR =$(OPIEDIR)/plugins/applets | 6 | DESTDIR =$(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/applets/volumeapplet/volumeapplet.pro b/core/applets/volumeapplet/volumeapplet.pro index d30567c..68d9eff 100644 --- a/core/applets/volumeapplet/volumeapplet.pro +++ b/core/applets/volumeapplet/volumeapplet.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS= volume.h volumeappletimpl.h oledbox.h | 3 | HEADERS= volume.h volumeappletimpl.h oledbox.h |
4 | SOURCES= volume.cpp volumeappletimpl.cpp oledbox.cpp | 4 | SOURCES= volume.cpp volumeappletimpl.cpp oledbox.cpp |
5 | TARGET = volumeapplet | 5 | TARGET = volumeapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += ../$(OPIEDIR)/include | 8 | DEPENDPATH += ../$(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp index d6f93da..0ac043b 100644 --- a/core/launcher/applauncher.cpp +++ b/core/launcher/applauncher.cpp | |||
@@ -541,17 +541,21 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais | |||
541 | slist.append( list[j].utf8() ); | 541 | slist.append( list[j].utf8() ); |
542 | 542 | ||
543 | const char **args = new const char *[slist.count() + 1]; | 543 | const char **args = new const char *[slist.count() + 1]; |
544 | for ( j = 0; j < slist.count(); j++ ) | 544 | for ( j = 0; j < slist.count(); j++ ) |
545 | args[j] = slist.at(j); | 545 | args[j] = slist.at(j); |
546 | args[j] = NULL; | 546 | args[j] = NULL; |
547 | 547 | ||
548 | #ifndef Q_OS_WIN32 | 548 | #ifndef Q_OS_WIN32 |
549 | #ifdef Q_OS_MACX | ||
550 | if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".dylib" ) ) { | ||
551 | #else | ||
549 | if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".so" ) ) { | 552 | if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".so" ) ) { |
553 | #endif /* Q_OS_MACX */ | ||
550 | qDebug( "Quick launching: %s", args[0] ); | 554 | qDebug( "Quick launching: %s", args[0] ); |
551 | if ( getuid() == 0 ) | 555 | if ( getuid() == 0 ) |
552 | setpriority( PRIO_PROCESS, qlPid, 0 ); | 556 | setpriority( PRIO_PROCESS, qlPid, 0 ); |
553 | QCString qlch("QPE/QuickLauncher-"); | 557 | QCString qlch("QPE/QuickLauncher-"); |
554 | qlch += QString::number(qlPid); | 558 | qlch += QString::number(qlPid); |
555 | QCopEnvelope env( qlch, "execute(QStrList)" ); | 559 | QCopEnvelope env( qlch, "execute(QStrList)" ); |
556 | env << slist; | 560 | env << slist; |
557 | runningApps[qlPid] = QString(args[0]); | 561 | runningApps[qlPid] = QString(args[0]); |
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp index 8f3e812..62e316c 100644 --- a/core/launcher/inputmethods.cpp +++ b/core/launcher/inputmethods.cpp | |||
@@ -222,17 +222,21 @@ void InputMethods::unloadMethod( QValueList<InputMethod>& list ) { | |||
222 | for (it = list.begin(); it != list.end(); ++it ) | 222 | for (it = list.begin(); it != list.end(); ++it ) |
223 | (*it).releaseInterface(); | 223 | (*it).releaseInterface(); |
224 | 224 | ||
225 | } | 225 | } |
226 | 226 | ||
227 | 227 | ||
228 | QStringList InputMethods::plugins()const { | 228 | QStringList InputMethods::plugins()const { |
229 | QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; | 229 | QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; |
230 | #ifdef Q_OS_MACX | ||
231 | QDir dir( path, "lib*.dylib" ); | ||
232 | #else | ||
230 | QDir dir( path, "lib*.so" ); | 233 | QDir dir( path, "lib*.so" ); |
234 | #endif /* Q_OS_MACX */ | ||
231 | return dir.entryList(); | 235 | return dir.entryList(); |
232 | } | 236 | } |
233 | 237 | ||
234 | void InputMethods::installTranslator( const QString& type ) { | 238 | void InputMethods::installTranslator( const QString& type ) { |
235 | QStringList langs = Global::languageList(); | 239 | QStringList langs = Global::languageList(); |
236 | QStringList::ConstIterator lit; | 240 | QStringList::ConstIterator lit; |
237 | for ( lit= langs.begin(); lit!=langs.end(); ++lit) { | 241 | for ( lit= langs.begin(); lit!=langs.end(); ++lit) { |
238 | QString lang = *lit; | 242 | QString lang = *lit; |
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp index 579c78c..63f8d05 100644 --- a/core/launcher/irserver.cpp +++ b/core/launcher/irserver.cpp | |||
@@ -31,17 +31,21 @@ | |||
31 | #include <qdir.h> | 31 | #include <qdir.h> |
32 | 32 | ||
33 | IrServer::IrServer( QObject *parent, const char *name ) | 33 | IrServer::IrServer( QObject *parent, const char *name ) |
34 | : QObject( parent, name ), obexIface(0) | 34 | : QObject( parent, name ), obexIface(0) |
35 | { | 35 | { |
36 | lib = 0; | 36 | lib = 0; |
37 | obexIface = 0; | 37 | obexIface = 0; |
38 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; | 38 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; |
39 | #ifdef Q_OS_MACX | ||
40 | QDir dir( path, "lib*.dylib" ); | ||
41 | #else | ||
39 | QDir dir( path, "lib*.so" ); | 42 | QDir dir( path, "lib*.so" ); |
43 | #endif /* Q_OS_MACX */ | ||
40 | QStringList list = dir.entryList(); | 44 | QStringList list = dir.entryList(); |
41 | QStringList::Iterator it; | 45 | QStringList::Iterator it; |
42 | for ( it = list.begin(); it != list.end(); ++it ) { | 46 | for ( it = list.begin(); it != list.end(); ++it ) { |
43 | QLibrary *trylib = new QLibrary( path + *it ); | 47 | QLibrary *trylib = new QLibrary( path + *it ); |
44 | //qDebug("trying lib %s", (path + (*it)).latin1() ); | 48 | //qDebug("trying lib %s", (path + (*it)).latin1() ); |
45 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { | 49 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { |
46 | lib = trylib; | 50 | lib = trylib; |
47 | //qDebug("found obex lib" ); | 51 | //qDebug("found obex lib" ); |
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 74965df..5416d33 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -271,17 +271,19 @@ int initApplication( int argc, char ** argv ) | |||
271 | } | 271 | } |
272 | } | 272 | } |
273 | 273 | ||
274 | int rv = a.exec(); | 274 | int rv = a.exec(); |
275 | 275 | ||
276 | qDebug("exiting..."); | 276 | qDebug("exiting..."); |
277 | delete s; | 277 | delete s; |
278 | 278 | ||
279 | #ifndef Q_OS_MACX | ||
279 | ODevice::inst()->setSoftSuspend( false ); | 280 | ODevice::inst()->setSoftSuspend( false ); |
281 | #endif | ||
280 | 282 | ||
281 | return rv; | 283 | return rv; |
282 | } | 284 | } |
283 | 285 | ||
284 | static const char *pidfile_path = "/var/run/opie.pid"; | 286 | static const char *pidfile_path = "/var/run/opie.pid"; |
285 | 287 | ||
286 | void create_pidfile ( ) | 288 | void create_pidfile ( ) |
287 | { | 289 | { |
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp index 4f149a5..bf34368 100644 --- a/core/launcher/packageslave.cpp +++ b/core/launcher/packageslave.cpp | |||
@@ -1,12 +1,12 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
@@ -14,84 +14,328 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "packageslave.h" | 21 | #include "packageslave.h" |
22 | #include <qtopia/qprocess.h> | ||
22 | 23 | ||
23 | #include <qpe/process.h> | 24 | #ifdef Q_WS_QWS |
24 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qtopia/qcopenvelope_qws.h> |
26 | #endif | ||
25 | 27 | ||
26 | #include <qdatastream.h> | 28 | #include <qdatastream.h> |
29 | #ifdef Q_WS_QWS | ||
27 | #include <qcopchannel_qws.h> | 30 | #include <qcopchannel_qws.h> |
31 | #endif | ||
28 | 32 | ||
33 | #include <qtextstream.h> | ||
34 | #include <qdir.h> | ||
35 | |||
36 | #include <stdlib.h> | ||
37 | #include <sys/stat.h> // mkdir() | ||
38 | |||
39 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | ||
29 | #include <unistd.h> | 40 | #include <unistd.h> |
41 | #include <sys/vfs.h> | ||
42 | #include <mntent.h> | ||
43 | #elif defined(Q_OS_WIN32) | ||
44 | #include <windows.h> | ||
45 | #include <winbase.h> | ||
46 | #elif defined(Q_OS_MACX) | ||
47 | #include <unistd.h> | ||
48 | #endif | ||
49 | |||
30 | 50 | ||
31 | PackageSlave::PackageSlave( QObject *parent, char* name ) | 51 | PackageHandler::PackageHandler( QObject *parent, char* name ) |
32 | : QObject( parent, name ), packageChannel( 0 ) | 52 | : QObject( parent, name ), packageChannel( 0 ), currentProcess( 0 ), mNoSpaceLeft( FALSE ) |
33 | { | 53 | { |
34 | // setup qcop channel | 54 | // setup qcop channel |
55 | #ifndef QT_NO_COP | ||
35 | packageChannel = new QCopChannel( "QPE/Package", this ); | 56 | packageChannel = new QCopChannel( "QPE/Package", this ); |
36 | connect( packageChannel, SIGNAL( received(const QCString &, const QByteArray &) ), | 57 | connect( packageChannel, SIGNAL( received(const QCString &, const QByteArray &) ), |
37 | this, SLOT( qcopMessage( const QCString &, const QByteArray &) ) ); | 58 | this, SLOT( qcopMessage( const QCString &, const QByteArray &) ) ); |
59 | #endif | ||
38 | } | 60 | } |
39 | 61 | ||
40 | void PackageSlave::qcopMessage( const QCString &msg, const QByteArray &data ) | 62 | void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) |
41 | { | 63 | { |
42 | QDataStream stream( data, IO_ReadOnly ); | 64 | QDataStream stream( data, IO_ReadOnly ); |
43 | 65 | ||
44 | if ( msg == "installPackage(QString)" ) { | 66 | if ( msg == "installPackage(QString)" ) { |
45 | QString file; | 67 | QString file; |
46 | stream >> file; | 68 | stream >> file; |
47 | installPackage( file ); | 69 | installPackage( file ); |
48 | } | 70 | } else if ( msg == "removePackage(QString)" ) { |
49 | else if ( msg == "removePackage(QString)" ) { | ||
50 | QString file; | 71 | QString file; |
51 | stream >> file; | 72 | stream >> file; |
52 | removePackage( file ); | 73 | removePackage( file ); |
74 | } else if ( msg == "addPackageFiles(QString,QString)" ) { | ||
75 | QString location, listfile; | ||
76 | stream >> location >> listfile; | ||
77 | addPackageFiles( location, listfile); | ||
78 | } else if ( msg == "addPackages(QString)" ) { | ||
79 | QString location; | ||
80 | stream >> location; | ||
81 | addPackages( location ); | ||
82 | } else if ( msg == "cleanupPackageFiles(QString)" ) { | ||
83 | QString listfile; | ||
84 | stream >> listfile; | ||
85 | cleanupPackageFiles( listfile ); | ||
86 | } else if ( msg == "cleanupPackages(QString)" ) { | ||
87 | QString location; | ||
88 | stream >> location; | ||
89 | cleanupPackages( location ); | ||
90 | } else if ( msg == "prepareInstall(QString,QString)" ) { | ||
91 | QString size, path; | ||
92 | stream >> size; | ||
93 | stream >> path; | ||
94 | prepareInstall( size, path ); | ||
53 | } | 95 | } |
54 | } | 96 | } |
55 | 97 | ||
56 | void PackageSlave::installPackage( const QString &package ) | 98 | void PackageHandler::installPackage( const QString &package ) |
57 | { | 99 | { |
58 | Process proc( QStringList() << "ipkg" << "install" << package ); | 100 | if ( mNoSpaceLeft ) { |
101 | mNoSpaceLeft = FALSE; | ||
102 | // Don't emit that for now, I still couldn't test it (Wener) | ||
103 | //sendReply( "installFailed(QString)", package ); | ||
104 | //return; | ||
105 | } | ||
106 | |||
107 | currentProcess = new QProcess( QStringList() << "ipkg" << "install" << package ); // No tr | ||
108 | connect( currentProcess, SIGNAL( processExited() ), SLOT( iProcessExited() ) ); | ||
109 | connect( currentProcess, SIGNAL( readyReadStdout() ), SLOT( readyReadStdout() ) ); | ||
110 | connect( currentProcess, SIGNAL( readyReadStderr() ), SLOT( readyReadStderr() ) ); | ||
111 | currentPackage = package; | ||
59 | 112 | ||
113 | currentProcessError=""; | ||
60 | sendReply( "installStarted(QString)", package ); | 114 | sendReply( "installStarted(QString)", package ); |
115 | currentProcess->start(); | ||
116 | } | ||
117 | |||
118 | void PackageHandler::removePackage( const QString &package ) | ||
119 | { | ||
120 | currentProcess = new QProcess( QStringList() << "ipkg" << "remove" << package ); // No tr | ||
121 | connect( currentProcess, SIGNAL( processExited() ), SLOT( rmProcessExited() ) ); | ||
122 | connect( currentProcess, SIGNAL( readyReadStdout() ), SLOT( readyReadStdout() ) ); | ||
123 | connect( currentProcess, SIGNAL( readyReadStderr() ), SLOT( readyReadStderr() ) ); | ||
124 | currentPackage = package; | ||
125 | |||
126 | currentProcessError=""; | ||
127 | sendReply( "removeStarted(QString)", package ); | ||
128 | currentProcess->start(); | ||
129 | } | ||
130 | |||
131 | void PackageHandler::sendReply( const QCString& msg, const QString& arg ) | ||
132 | { | ||
133 | #ifndef QT_NO_COP | ||
134 | QCopEnvelope e( "QPE/Desktop", msg ); | ||
135 | e << arg; | ||
136 | #endif | ||
137 | } | ||
138 | |||
139 | void PackageHandler::addPackageFiles( const QString &location, | ||
140 | const QString &listfile ) | ||
141 | { | ||
142 | QFile f(listfile); | ||
143 | #ifndef Q_OS_WIN32 | ||
144 | //make a copy so we can remove the symlinks later | ||
145 | mkdir( ("/usr/lib/ipkg/info/"+location).ascii(), 0777 ); | ||
146 | system(("cp " + f.name() + " /usr/lib/ipkg/info/"+location).ascii()); | ||
147 | #else | ||
148 | QDir d; | ||
149 | //#### revise | ||
150 | qDebug("Copy file at %s: %s", __FILE__, __LINE__ ); | ||
151 | d.mkdir(("/usr/lib/ipkg/info/" + location).ascii()); | ||
152 | system(("copy " + f.name() + " /usr/lib/ipkg/info/"+location).ascii()); | ||
153 | #endif | ||
154 | |||
155 | |||
156 | if ( f.open(IO_ReadOnly) ) { | ||
157 | QTextStream ts(&f); | ||
158 | |||
159 | QString s; | ||
160 | while ( !ts.eof() ) { // until end of file... | ||
161 | s = ts.readLine(); // line of text excluding '\n' | ||
162 | // for s, do link/mkdir. | ||
163 | if ( s.right(1) == "/" ) { | ||
164 | qDebug("do mkdir for %s", s.ascii()); | ||
165 | #ifndef Q_OS_WIN32 | ||
166 | mkdir( s.ascii(), 0777 ); | ||
167 | //possible optimization: symlink directories | ||
168 | //that don't exist already. -- Risky. | ||
169 | #else | ||
170 | d.mkdir( s.ascii()); | ||
171 | #endif | ||
172 | |||
173 | } else { | ||
174 | #ifndef Q_OS_WIN32 | ||
175 | qDebug("do symlink for %s", s.ascii()); | ||
176 | symlink( (location + s).ascii(), s.ascii() ); | ||
177 | #else | ||
178 | qDebug("Copy file instead of a symlink for WIN32"); | ||
179 | if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE)) | ||
180 | qWarning("Unable to create symlinkfor %s", | ||
181 | (location + s).ascii()); | ||
182 | #endif | ||
183 | } | ||
184 | } | ||
185 | f.close(); | ||
186 | } | ||
187 | } | ||
61 | 188 | ||
62 | QString output; | 189 | void PackageHandler::addPackages( const QString &location ) |
63 | if ( proc.exec( "", output ) ) { | 190 | { |
64 | sendReply( "installDone(QString)", package ); | 191 | // get list of *.list in location/usr/lib/ipkg/info/*.list |
192 | QDir dir(location + "/usr/lib/ipkg/info", "*.list", // No tr | ||
193 | QDir::Name, QDir::Files); | ||
194 | if ( !dir.exists() ) | ||
195 | return; | ||
196 | |||
197 | QStringList packages = dir.entryList(); | ||
198 | for ( QStringList::Iterator it = packages.begin(); | ||
199 | it != packages.end(); ++it ) { | ||
200 | addPackageFiles( location, *it ); | ||
65 | } | 201 | } |
202 | } | ||
203 | |||
204 | |||
205 | void PackageHandler::cleanupPackageFiles( const QString &listfile ) | ||
206 | { | ||
207 | QFile f(listfile); | ||
208 | |||
209 | if ( f.open(IO_ReadOnly) ) { | ||
210 | QTextStream ts(&f); | ||
211 | |||
212 | QString s; | ||
213 | while ( !ts.eof() ) { // until end of file... | ||
214 | s = ts.readLine(); // line of text excluding '\n' | ||
215 | // for s, do link/mkdir. | ||
216 | if ( s.right(1) == "/" ) { | ||
217 | //should rmdir if empty, after all files have been removed | ||
218 | } else { | ||
219 | #ifndef Q_OS_WIN32 | ||
220 | qDebug("remove symlink for %s", s.ascii()); | ||
221 | //check if it is a symlink first (don't remove /etc/passwd...) | ||
222 | char buf[10]; //we don't care about the contents | ||
223 | if ( ::readlink( s.ascii(),buf, 10 >= 0 ) ) | ||
224 | ::unlink( s.ascii() ); | ||
225 | #else | ||
226 | // ### revise | ||
227 | qWarning("Unable to remove symlink %s:%s", __FILE__, __LINE__); | ||
228 | #endif | ||
229 | } | ||
230 | } | ||
231 | f.close(); | ||
232 | |||
233 | //remove the list file | ||
234 | ::unlink( listfile.ascii() ); | ||
235 | |||
236 | } | ||
237 | } | ||
238 | |||
239 | void PackageHandler::cleanupPackages( const QString &location ) | ||
240 | { | ||
241 | // get list of *.list in location/usr/lib/ipkg/info/*.list | ||
242 | QDir dir( "/usr/lib/ipkg/info/"+location, "*.list", // No tr | ||
243 | QDir::Name, QDir::Files); | ||
244 | if ( !dir.exists() ) | ||
245 | return; | ||
246 | |||
247 | QStringList packages = dir.entryList(); | ||
248 | for ( QStringList::Iterator it = packages.begin(); | ||
249 | it != packages.end(); ++it ) { | ||
250 | cleanupPackageFiles( *it ); | ||
251 | } | ||
252 | |||
253 | //remove the backup directory | ||
254 | //### | ||
255 | } | ||
256 | |||
257 | void PackageHandler::prepareInstall( const QString& size, const QString& path ) | ||
258 | { | ||
259 | // Check whether there will be enough space to install the next package. | ||
260 | bool ok; | ||
261 | unsigned int s = size.toUInt( &ok ); | ||
262 | |||
263 | if ( !ok ) | ||
264 | return; | ||
265 | |||
266 | // Shamelessly stolen from the sysinfo application (Werner) | ||
267 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | ||
268 | struct statfs fs; | ||
269 | if ( statfs( path.latin1(), &fs ) == 0 ) | ||
270 | if ( s > fs.f_bsize * fs.f_bavail ) { | ||
271 | //qDebug("############### Not enough space left ###############"); | ||
272 | mNoSpaceLeft = TRUE; | ||
273 | } | ||
274 | #endif | ||
275 | } | ||
276 | |||
277 | void PackageHandler::iProcessExited() | ||
278 | { | ||
279 | if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 ) | ||
280 | sendReply( "installDone(QString)", currentPackage ); | ||
66 | else { | 281 | else { |
67 | sendReply( "installFailed(QString)", package ); | 282 | #ifndef QT_NO_COP |
283 | QCopEnvelope e( "QPE/Desktop", "installFailed(QString,int,QString)" ); | ||
284 | e << currentPackage << currentProcess->exitStatus() | ||
285 | << currentProcessError; | ||
286 | #endif | ||
68 | } | 287 | } |
288 | |||
289 | delete currentProcess; | ||
290 | currentProcess = 0; | ||
291 | |||
292 | #ifndef QT_NO_COP | ||
69 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 293 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
70 | QString lf = QString::null; | 294 | QString lf = QString::null; |
71 | e << lf; | 295 | e << lf; |
72 | unlink( package ); | 296 | #endif |
297 | unlink( currentPackage ); | ||
73 | } | 298 | } |
74 | 299 | ||
75 | void PackageSlave::removePackage( const QString &package ) | 300 | void PackageHandler::rmProcessExited() |
76 | { | 301 | { |
77 | Process proc( QStringList() << "ipkg" << "remove" << package ); | 302 | if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 ) |
303 | sendReply( "removeDone(QString)", currentPackage ); | ||
304 | else | ||
305 | sendReply( "removeFailed(QString)", currentPackage ); | ||
78 | 306 | ||
79 | sendReply( "removeStarted(QString)", package ); | 307 | #ifndef QT_NO_COP |
80 | |||
81 | QString output; | ||
82 | if ( proc.exec( "", output ) ) { | ||
83 | sendReply( "removeDone(QString)", package ); | ||
84 | } | ||
85 | else { | ||
86 | sendReply( "removeFailed(QString)", package ); | ||
87 | } | ||
88 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 308 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
89 | QString lf = QString::null; | 309 | QString lf = QString::null; |
90 | e << lf; | 310 | e << lf; |
311 | #endif | ||
91 | } | 312 | } |
92 | 313 | ||
93 | void PackageSlave::sendReply( const QCString& msg, const QString& arg ) | 314 | void PackageHandler::readyReadStdout() |
94 | { | 315 | { |
95 | QCopEnvelope e( "QPE/Desktop", msg ); | 316 | while ( currentProcess->canReadLineStdout() ) { |
96 | e << arg; | 317 | QString line = currentProcess->readLineStdout(); |
318 | currentProcessError.append("OUT:"+line); | ||
319 | if ( line.contains( "Unpacking" ) ) // No tr | ||
320 | sendReply( "installStep(QString)", "one" ); // No tr | ||
321 | else if ( line.contains( "Configuring" ) ) // No tr | ||
322 | sendReply( "installStep(QString)", "two" ); // No tr | ||
323 | } | ||
324 | } | ||
325 | |||
326 | void PackageHandler::readyReadStderr() | ||
327 | { | ||
328 | while ( currentProcess->canReadLineStderr() ) { | ||
329 | QString line = currentProcess->readLineStderr(); | ||
330 | currentProcessError.append("ERR:"+line); | ||
331 | } | ||
332 | } | ||
333 | |||
334 | void PackageHandler::redoPackages() | ||
335 | { | ||
336 | //get list of filesystems | ||
337 | |||
338 | //call cleanupPackages for the ones that have disappeared | ||
339 | |||
340 | //call addPackageFiles for the new ones | ||
97 | } | 341 | } |
diff --git a/core/launcher/qprocess_unix.cpp b/core/launcher/qprocess_unix.cpp index a07bf64..19a8c93 100644 --- a/core/launcher/qprocess_unix.cpp +++ b/core/launcher/qprocess_unix.cpp | |||
@@ -45,16 +45,19 @@ | |||
45 | #include <signal.h> | 45 | #include <signal.h> |
46 | #include <sys/socket.h> | 46 | #include <sys/socket.h> |
47 | #include <sys/ioctl.h> | 47 | #include <sys/ioctl.h> |
48 | #include <sys/wait.h> | 48 | #include <sys/wait.h> |
49 | #include <sys/fcntl.h> | 49 | #include <sys/fcntl.h> |
50 | 50 | ||
51 | #include <errno.h> | 51 | #include <errno.h> |
52 | 52 | ||
53 | #ifdef Q_OS_MACX | ||
54 | #include <sys/time.h> | ||
55 | #endif | ||
53 | #include <sys/resource.h> | 56 | #include <sys/resource.h> |
54 | 57 | ||
55 | #ifdef __MIPSEL__ | 58 | #ifdef __MIPSEL__ |
56 | # ifndef SOCK_DGRAM | 59 | # ifndef SOCK_DGRAM |
57 | # define SOCK_DGRAM 1 | 60 | # define SOCK_DGRAM 1 |
58 | # endif | 61 | # endif |
59 | # ifndef SOCK_STREAM | 62 | # ifndef SOCK_STREAM |
60 | # define SOCK_STREAM 2 | 63 | # define SOCK_STREAM 2 |
diff --git a/core/launcher/server.pro b/core/launcher/server.pro index 93baeb4..0513536 100644 --- a/core/launcher/server.pro +++ b/core/launcher/server.pro | |||
@@ -110,11 +110,16 @@ SOURCES += server.cpp \ | |||
110 | INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate | 110 | INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate |
111 | DEPENDPATH+= $(OPIEDIR)/core/apps/calibrate | 111 | DEPENDPATH+= $(OPIEDIR)/core/apps/calibrate |
112 | 112 | ||
113 | INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync | 113 | INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync |
114 | DEPENDPATH+= $(OPIEDIR)/rsync | 114 | DEPENDPATH+= $(OPIEDIR)/rsync |
115 | 115 | ||
116 | TARGET = qpe | 116 | TARGET = qpe |
117 | 117 | ||
118 | LIBS+= -lcrypt -lqpe -lopie | 118 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) |
119 | contains( CONFTEST, y ){ | ||
120 | LIBS += -lqpe -lopie | ||
121 | }else{ | ||
122 | LIBS+= -lcrypt -lqpe -lopie | ||
123 | } | ||
119 | 124 | ||
120 | include ( $(OPIEDIR)/include.pro ) | 125 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index 014418d..08ae885 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp | |||
@@ -251,17 +251,21 @@ void StartMenu::loadApplets() | |||
251 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 | 251 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 |
252 | // removed in the remerge PluginManager could handle it | 252 | // removed in the remerge PluginManager could handle it |
253 | // we don't currently use it -zecke | 253 | // we don't currently use it -zecke |
254 | 254 | ||
255 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 255 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
256 | 256 | ||
257 | QString lang = getenv( "LANG" ); | 257 | QString lang = getenv( "LANG" ); |
258 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 258 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
259 | #ifdef Q_OS_MACX | ||
260 | QDir dir( path, "lib*.dylib" ); | ||
261 | #else | ||
259 | QDir dir( path, "lib*.so" ); | 262 | QDir dir( path, "lib*.so" ); |
263 | #endif /* Q_OS_MACX */ | ||
260 | QStringList list = dir.entryList(); | 264 | QStringList list = dir.entryList(); |
261 | QStringList::Iterator it; | 265 | QStringList::Iterator it; |
262 | int napplets=0; | 266 | int napplets=0; |
263 | MenuApplet* *xapplets = new MenuApplet*[list.count()]; | 267 | MenuApplet* *xapplets = new MenuApplet*[list.count()]; |
264 | for ( it = list.begin(); it != list.end(); ++it ) { | 268 | for ( it = list.begin(); it != list.end(); ++it ) { |
265 | if ( exclude.find( *it ) != exclude.end() ) | 269 | if ( exclude.find( *it ) != exclude.end() ) |
266 | continue; | 270 | continue; |
267 | MenuAppletInterface *iface = 0; | 271 | MenuAppletInterface *iface = 0; |
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 6122770..691f6b8 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -97,24 +97,29 @@ void SysTray::addApplets() | |||
97 | hide(); | 97 | hide(); |
98 | #ifndef QT_NO_COMPONENTS | 98 | #ifndef QT_NO_COMPONENTS |
99 | Config cfg( "Taskbar" ); | 99 | Config cfg( "Taskbar" ); |
100 | cfg.setGroup( "Applets" ); | 100 | cfg.setGroup( "Applets" ); |
101 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 101 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
102 | 102 | ||
103 | QString lang = getenv( "LANG" ); | 103 | QString lang = getenv( "LANG" ); |
104 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 104 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
105 | #ifdef Q_OS_MACX | ||
106 | QDir dir( path, "lib*.dylib" ); | ||
107 | #else | ||
105 | QDir dir( path, "lib*.so" ); | 108 | QDir dir( path, "lib*.so" ); |
109 | #endif /* Q_OS_MACX */ | ||
106 | QStringList list = dir.entryList(); | 110 | QStringList list = dir.entryList(); |
107 | QStringList::Iterator it; | 111 | QStringList::Iterator it; |
108 | int napplets=0; | 112 | int napplets=0; |
109 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; | 113 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; |
110 | for ( it = list.begin(); it != list.end(); ++it ) { | 114 | for ( it = list.begin(); it != list.end(); ++it ) { |
111 | if ( exclude.find( *it ) != exclude.end() ) | 115 | if ( exclude.find( *it ) != exclude.end() ) |
112 | continue; | 116 | continue; |
117 | qWarning( "Found Applet: %s", (*it).latin1() ); | ||
113 | TaskbarAppletInterface *iface = 0; | 118 | TaskbarAppletInterface *iface = 0; |
114 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 119 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
115 | if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { | 120 | if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { |
116 | TaskbarApplet *applet = new TaskbarApplet; | 121 | TaskbarApplet *applet = new TaskbarApplet; |
117 | applets[napplets++] = applet; | 122 | applets[napplets++] = applet; |
118 | applet->library = lib; | 123 | applet->library = lib; |
119 | applet->iface = iface; | 124 | applet->iface = iface; |
120 | 125 | ||
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index c69df2d..439e110 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp | |||
@@ -23,18 +23,21 @@ | |||
23 | #include <qtopia/qpeapplication.h> | 23 | #include <qtopia/qpeapplication.h> |
24 | 24 | ||
25 | #ifndef Q_OS_WIN32 | 25 | #ifndef Q_OS_WIN32 |
26 | #include <pwd.h> | 26 | #include <pwd.h> |
27 | #include <sys/types.h> | 27 | #include <sys/types.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
30 | #include <time.h> | 30 | #include <time.h> |
31 | |||
32 | #ifndef Q_OS_MACX | ||
31 | #include <shadow.h> | 33 | #include <shadow.h> |
32 | #include <crypt.h> | 34 | #include <crypt.h> |
35 | #endif /* Q_OS_MACX */ | ||
33 | 36 | ||
34 | #else | 37 | #else |
35 | #include <stdlib.h> | 38 | #include <stdlib.h> |
36 | #include <time.h> | 39 | #include <time.h> |
37 | #endif | 40 | #endif |
38 | 41 | ||
39 | 42 | ||
40 | #if defined(_OS_LINUX_) | 43 | #if defined(_OS_LINUX_) |
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.pro b/core/multimedia/opieplayer/wavplugin/wavplugin.pro index 0366542..db41ad4 100644 --- a/core/multimedia/opieplayer/wavplugin/wavplugin.pro +++ b/core/multimedia/opieplayer/wavplugin/wavplugin.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS = wavplugin.h wavpluginimpl.h | 3 | HEADERS = wavplugin.h wavpluginimpl.h |
4 | SOURCES = wavplugin.cpp wavpluginimpl.cpp | 4 | SOURCES = wavplugin.cpp wavpluginimpl.cpp |
5 | TARGET = wavplugin | 5 | TARGET = wavplugin |
6 | DESTDIR = $(OPIEDIR)/plugins/codecs | 6 | DESTDIR = $(OPIEDIR)/plugins/codecs |
7 | INCLUDEPATH += $(OPIEDIR)/include .. | 7 | INCLUDEPATH += $(OPIEDIR)/include .. |
8 | DEPENDPATH += ../$(OPIEDIR)/include .. | 8 | DEPENDPATH += ../$(OPIEDIR)/include .. |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
diff --git a/core/pim/today/plugins/addressbook/addressbook.pro b/core/pim/today/plugins/addressbook/addressbook.pro index 4ebbc9e..54aaff2 100644 --- a/core/pim/today/plugins/addressbook/addressbook.pro +++ b/core/pim/today/plugins/addressbook/addressbook.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG -= moc | 2 | CONFIG -= moc |
3 | CONFIG += qt release | 3 | CONFIG += qt plugin release |
4 | 4 | ||
5 | # Input | 5 | # Input |
6 | HEADERS = addressplugin.h addresspluginimpl.h addresspluginconfig.h \ | 6 | HEADERS = addressplugin.h addresspluginimpl.h addresspluginconfig.h \ |
7 | addresspluginwidget.h | 7 | addresspluginwidget.h |
8 | SOURCES = addressplugin.cpp addresspluginimpl.cpp addresspluginconfig.cpp \ | 8 | SOURCES = addressplugin.cpp addresspluginimpl.cpp addresspluginconfig.cpp \ |
9 | addresspluginwidget.cpp | 9 | addresspluginwidget.cpp |
10 | 10 | ||
11 | INCLUDEPATH += $(OPIEDIR)/include \ | 11 | INCLUDEPATH += $(OPIEDIR)/include \ |
diff --git a/core/pim/today/plugins/datebook/datebook.pro b/core/pim/today/plugins/datebook/datebook.pro index e0a1dcb..2139f63 100644 --- a/core/pim/today/plugins/datebook/datebook.pro +++ b/core/pim/today/plugins/datebook/datebook.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG -= moc | 2 | CONFIG -= moc |
3 | CONFIG += qt release | 3 | CONFIG += qt plugin release |
4 | # Input | 4 | # Input |
5 | HEADERS = datebookplugin.h datebookpluginimpl.h datebookpluginconfig.h \ | 5 | HEADERS = datebookplugin.h datebookpluginimpl.h datebookpluginconfig.h \ |
6 | datebookevent.h datebookpluginwidget.h | 6 | datebookevent.h datebookpluginwidget.h |
7 | SOURCES = datebookplugin.cpp datebookpluginimpl.cpp datebookpluginconfig.cpp \ | 7 | SOURCES = datebookplugin.cpp datebookpluginimpl.cpp datebookpluginconfig.cpp \ |
8 | datebookevent.cpp datebookpluginwidget.cpp | 8 | datebookevent.cpp datebookpluginwidget.cpp |
9 | 9 | ||
10 | INCLUDEPATH += $(OPIEDIR)/include \ | 10 | INCLUDEPATH += $(OPIEDIR)/include \ |
11 | ../ ../library | 11 | ../ ../library |
diff --git a/core/pim/today/plugins/mail/mail.pro b/core/pim/today/plugins/mail/mail.pro index 70c484d..421b3a5 100644 --- a/core/pim/today/plugins/mail/mail.pro +++ b/core/pim/today/plugins/mail/mail.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG -= moc | 2 | CONFIG -= moc |
3 | CONFIG += qt release | 3 | CONFIG += qt plugin release |
4 | 4 | ||
5 | # Input | 5 | # Input |
6 | HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h | 6 | HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h |
7 | SOURCES = mailplugin.cpp mailpluginimpl.cpp mailpluginwidget.cpp | 7 | SOURCES = mailplugin.cpp mailpluginimpl.cpp mailpluginwidget.cpp |
8 | 8 | ||
9 | INCLUDEPATH += $(OPIEDIR)/include \ | 9 | INCLUDEPATH += $(OPIEDIR)/include \ |
10 | ../ ../library | 10 | ../ ../library |
11 | DEPENDPATH += $(OPIEDIR)/include \ | 11 | DEPENDPATH += $(OPIEDIR)/include \ |
diff --git a/core/pim/today/plugins/todolist/todolist.pro b/core/pim/today/plugins/todolist/todolist.pro index 31a6a27..c8730bb 100644 --- a/core/pim/today/plugins/todolist/todolist.pro +++ b/core/pim/today/plugins/todolist/todolist.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG -= moc | 2 | CONFIG -= moc |
3 | CONFIG += qt release | 3 | CONFIG += qt plugin release |
4 | 4 | ||
5 | # Input | 5 | # Input |
6 | HEADERS = todoplugin.h todopluginimpl.h todopluginconfig.h \ | 6 | HEADERS = todoplugin.h todopluginimpl.h todopluginconfig.h \ |
7 | todopluginwidget.h | 7 | todopluginwidget.h |
8 | SOURCES = todoplugin.cpp todopluginimpl.cpp todopluginconfig.cpp \ | 8 | SOURCES = todoplugin.cpp todopluginimpl.cpp todopluginconfig.cpp \ |
9 | todopluginwidget.cpp | 9 | todopluginwidget.cpp |
10 | 10 | ||
11 | INCLUDEPATH += $(OPIEDIR)/include \ | 11 | INCLUDEPATH += $(OPIEDIR)/include \ |
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index f213943..cb18c1c 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -169,21 +169,28 @@ void Today::loadPlugins() { | |||
169 | delete (*tit).guiBox; | 169 | delete (*tit).guiBox; |
170 | (*tit).library->unload(); | 170 | (*tit).library->unload(); |
171 | delete (*tit).library; | 171 | delete (*tit).library; |
172 | } | 172 | } |
173 | pluginList.clear(); | 173 | pluginList.clear(); |
174 | } | 174 | } |
175 | 175 | ||
176 | QString path = QPEApplication::qpeDir() + "/plugins/today"; | 176 | QString path = QPEApplication::qpeDir() + "/plugins/today"; |
177 | qWarning("Searching for Plugins in: %s", path.latin1()); | ||
178 | #ifdef Q_OS_MACX | ||
179 | QDir dir( path, "lib*.dylib" ); | ||
180 | #else | ||
177 | QDir dir( path, "lib*.so" ); | 181 | QDir dir( path, "lib*.so" ); |
182 | #endif | ||
178 | 183 | ||
179 | QStringList list = dir.entryList(); | 184 | QStringList list = dir.entryList(); |
180 | QStringList::Iterator it; | 185 | QStringList::Iterator it; |
181 | 186 | ||
187 | qWarning("Found: %d entries !", list.count() ); | ||
188 | |||
182 | QMap<QString, TodayPlugin> tempList; | 189 | QMap<QString, TodayPlugin> tempList; |
183 | 190 | ||
184 | for ( it = list.begin(); it != list.end(); ++it ) { | 191 | for ( it = list.begin(); it != list.end(); ++it ) { |
185 | QInterfacePtr<TodayPluginInterface> iface; | 192 | QInterfacePtr<TodayPluginInterface> iface; |
186 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 193 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
187 | 194 | ||
188 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 195 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); |
189 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 196 | if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
diff --git a/core/qws/transferserver.cpp b/core/qws/transferserver.cpp index 0337a94..239c824 100644 --- a/core/qws/transferserver.cpp +++ b/core/qws/transferserver.cpp | |||
@@ -18,33 +18,45 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #define _XOPEN_SOURCE | 20 | #define _XOPEN_SOURCE |
21 | #include <pwd.h> | 21 | #include <pwd.h> |
22 | #include <sys/types.h> | 22 | #include <sys/types.h> |
23 | #include <unistd.h> | 23 | #include <unistd.h> |
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include <time.h> | 25 | #include <time.h> |
26 | |||
27 | #ifndef Q_OS_MACX | ||
26 | #include <shadow.h> | 28 | #include <shadow.h> |
29 | #endif /* Q_OS_MACX */ | ||
27 | 30 | ||
28 | /* we need the _OS_LINUX stuff first ! */ | 31 | /* we need the _OS_LINUX stuff first ! */ |
29 | #include <qglobal.h> | 32 | #include <qglobal.h> |
30 | 33 | ||
31 | #ifndef _OS_LINUX_ | 34 | #ifndef _OS_LINUX_ |
35 | // Is anybody able to review this ? The include "uuid/uuid.h" couldn't be found | ||
36 | // anywhere ? Therfore I removed it completely.. | ||
37 | // I think it should be made permanentyl !? (eilers) | ||
38 | #warning "Where should uuid/uuid.h be found ? Removed this part .. (eilers)" | ||
39 | #if 0 | ||
32 | 40 | ||
33 | extern "C" | 41 | extern "C" |
34 | { | 42 | { |
35 | #include <uuid/uuid.h> | 43 | #include <uuid/uuid.h> |
36 | #define UUID_H_INCLUDED | 44 | #define UUID_H_INCLUDED |
37 | } | 45 | } |
38 | 46 | ||
47 | #endif | ||
48 | |||
39 | #endif // not defined linux | 49 | #endif // not defined linux |
40 | 50 | ||
41 | #if defined(_OS_LINUX_) | 51 | #if defined(_OS_LINUX_) |
42 | #include <shadow.h> | 52 | #include <shadow.h> |
53 | #elif defined(Q_OS_MACX) | ||
54 | #include <stdlib.h> | ||
43 | #endif | 55 | #endif |
44 | 56 | ||
45 | #include <qdir.h> | 57 | #include <qdir.h> |
46 | #include <qfile.h> | 58 | #include <qfile.h> |
47 | #include <qtextstream.h> | 59 | #include <qtextstream.h> |
48 | #include <qdatastream.h> | 60 | #include <qdatastream.h> |
49 | #include <qmessagebox.h> | 61 | #include <qmessagebox.h> |
50 | #include <qstringlist.h> | 62 | #include <qstringlist.h> |
@@ -86,39 +98,46 @@ void TransferServer::newConnection( int socket ) | |||
86 | * to generate a QUUid for us | 98 | * to generate a QUUid for us |
87 | */ | 99 | */ |
88 | namespace | 100 | namespace |
89 | { | 101 | { |
90 | struct UidGen | 102 | struct UidGen |
91 | { | 103 | { |
92 | QString uuid(); | 104 | QString uuid(); |
93 | }; | 105 | }; |
94 | #if !defined(_OS_LINUX_) | 106 | #if defined(Q_OS_MACX) |
95 | |||
96 | QString UidGen::uuid() | 107 | QString UidGen::uuid() |
97 | { | 108 | { |
98 | uuid_t uuid; | 109 | srandom( random() ); |
99 | uuid_generate( uuid ); | 110 | QString numStr = QString::number( random() ); |
100 | return QUUid( uuid ).toString(); | 111 | |
112 | return "{" + numStr + "}"; | ||
101 | } | 113 | } |
102 | #else | 114 | #elif defined(_OS_LINUX_) |
103 | /* | 115 | /* |
104 | * linux got a /proc/sys/kernel/random/uuid file | 116 | * linux got a /proc/sys/kernel/random/uuid file |
105 | * it'll generate the uuids for us | 117 | * it'll generate the uuids for us |
106 | */ | 118 | */ |
107 | QString UidGen::uuid() | 119 | QString UidGen::uuid() |
108 | { | 120 | { |
109 | QFile file( "/proc/sys/kernel/random/uuid" ); | 121 | QFile file( "/proc/sys/kernel/random/uuid" ); |
110 | if (!file.open(IO_ReadOnly ) ) | 122 | if (!file.open(IO_ReadOnly ) ) |
111 | return QString::null; | 123 | return QString::null; |
112 | 124 | ||
113 | QTextStream stream(&file); | 125 | QTextStream stream(&file); |
114 | 126 | ||
115 | return "{" + stream.read().stripWhiteSpace() + "}"; | 127 | return "{" + stream.read().stripWhiteSpace() + "}"; |
116 | } | 128 | } |
129 | #else | ||
130 | QString UidGen::uuid() | ||
131 | { | ||
132 | uuid_t uuid; | ||
133 | ::uuid_generate( uuid ); | ||
134 | return QUUid( uuid ).toString(); | ||
135 | } | ||
117 | #endif | 136 | #endif |
118 | } | 137 | } |
119 | 138 | ||
120 | QString SyncAuthentication::serverId() | 139 | QString SyncAuthentication::serverId() |
121 | { | 140 | { |
122 | Config cfg("Security"); | 141 | Config cfg("Security"); |
123 | cfg.setGroup("Sync"); | 142 | cfg.setGroup("Sync"); |
124 | QString r = cfg.readEntry("serverid"); | 143 | QString r = cfg.readEntry("serverid"); |
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp index 5a9fada..6fca621 100644 --- a/core/settings/launcher/menusettings.cpp +++ b/core/settings/launcher/menusettings.cpp | |||
@@ -74,17 +74,21 @@ MenuSettings::MenuSettings ( QWidget *parent, const char *name ) | |||
74 | 74 | ||
75 | void MenuSettings::init ( ) | 75 | void MenuSettings::init ( ) |
76 | { | 76 | { |
77 | Config cfg ( "StartMenu" ); | 77 | Config cfg ( "StartMenu" ); |
78 | cfg. setGroup ( "Applets" ); | 78 | cfg. setGroup ( "Applets" ); |
79 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 79 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
80 | 80 | ||
81 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 81 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
82 | #ifdef Q_OS_MACX | ||
83 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); | ||
84 | #else | ||
82 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 85 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
86 | #endif /* Q_OS_MACX */ | ||
83 | 87 | ||
84 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 88 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
85 | QString name; | 89 | QString name; |
86 | QPixmap icon; | 90 | QPixmap icon; |
87 | MenuAppletInterface *iface = 0; | 91 | MenuAppletInterface *iface = 0; |
88 | 92 | ||
89 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 93 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
90 | lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface ); | 94 | lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface ); |
diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp index b3e302a..d03ea49 100644 --- a/core/settings/launcher/taskbarsettings.cpp +++ b/core/settings/launcher/taskbarsettings.cpp | |||
@@ -70,55 +70,72 @@ TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) | |||
70 | 70 | ||
71 | void TaskbarSettings::init ( ) | 71 | void TaskbarSettings::init ( ) |
72 | { | 72 | { |
73 | Config cfg ( "Taskbar" ); | 73 | Config cfg ( "Taskbar" ); |
74 | cfg. setGroup ( "Applets" ); | 74 | cfg. setGroup ( "Applets" ); |
75 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 75 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
76 | 76 | ||
77 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 77 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
78 | #ifdef Q_OS_MACX | ||
79 | QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); | ||
80 | #else | ||
78 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 81 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
82 | #endif /* Q_OS_MACX */ | ||
79 | 83 | ||
80 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 84 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
81 | QString name; | 85 | QString name; |
82 | QPixmap icon; | 86 | QPixmap icon; |
83 | TaskbarNamedAppletInterface *iface = 0; | 87 | TaskbarNamedAppletInterface *iface = 0; |
84 | 88 | ||
89 | qWarning("Load applet: %s", (*it).latin1() ); | ||
85 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 90 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
86 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); | 91 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); |
92 | qWarning("<1>"); | ||
87 | if ( iface ) { | 93 | if ( iface ) { |
94 | qWarning("<2>"); | ||
88 | QString lang = getenv( "LANG" ); | 95 | QString lang = getenv( "LANG" ); |
89 | QTranslator *trans = new QTranslator ( qApp ); | 96 | QTranslator *trans = new QTranslator ( qApp ); |
90 | QString type = (*it). left ((*it). find (".")); | 97 | QString type = (*it). left ((*it). find (".")); |
91 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; | 98 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; |
92 | if ( trans-> load ( tfn )) | 99 | if ( trans-> load ( tfn )) |
93 | qApp-> installTranslator ( trans ); | 100 | qApp-> installTranslator ( trans ); |
94 | else | 101 | else |
95 | delete trans; | 102 | delete trans; |
96 | name = iface-> name ( ); | 103 | name = iface-> name ( ); |
97 | icon = iface-> icon ( ); | 104 | icon = iface-> icon ( ); |
98 | iface-> release ( ); | 105 | iface-> release ( ); |
99 | } | 106 | } |
107 | qWarning("<3>"); | ||
100 | if ( !iface ) { | 108 | if ( !iface ) { |
109 | qWarning("<4>"); | ||
101 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); | 110 | lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); |
102 | 111 | ||
103 | if ( iface ) { | 112 | if ( iface ) { |
113 | qWarning("<5>"); | ||
104 | name = (*it). mid ( 3 ); | 114 | name = (*it). mid ( 3 ); |
115 | qWarning("Found applet: %s", name.latin1() ); | ||
116 | #ifdef Q_OS_MACX | ||
117 | int sep = name. find( ".dylib" ); | ||
118 | #else | ||
105 | int sep = name. find( ".so" ); | 119 | int sep = name. find( ".so" ); |
120 | #endif /* Q_OS_MACX */ | ||
106 | if ( sep > 0 ) | 121 | if ( sep > 0 ) |
107 | name. truncate ( sep ); | 122 | name. truncate ( sep ); |
108 | sep = name. find ( "applet" ); | 123 | sep = name. find ( "applet" ); |
109 | if ( sep == (int) name.length ( ) - 6 ) | 124 | if ( sep == (int) name.length ( ) - 6 ) |
110 | name. truncate ( sep ); | 125 | name. truncate ( sep ); |
111 | name[0] = name[0]. upper ( ); | 126 | name[0] = name[0]. upper ( ); |
112 | iface-> release ( ); | 127 | iface-> release ( ); |
113 | } | 128 | } |
114 | } | 129 | } |
130 | qWarning("<6>"); | ||
115 | 131 | ||
116 | if ( iface ) { | 132 | if ( iface ) { |
133 | qWarning("<7>"); | ||
117 | QCheckListItem *item; | 134 | QCheckListItem *item; |
118 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); | 135 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); |
119 | if ( !icon. isNull ( )) | 136 | if ( !icon. isNull ( )) |
120 | item-> setPixmap ( 0, icon ); | 137 | item-> setPixmap ( 0, icon ); |
121 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); | 138 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); |
122 | m_applets [*it] = item; | 139 | m_applets [*it] = item; |
123 | } | 140 | } |
124 | lib-> unload ( ); | 141 | lib-> unload ( ); |