author | eilers <eilers> | 2003-11-03 16:52:18 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-11-03 16:52:18 (UTC) |
commit | d34dc773591a2d467c68875a68a671d6a809f861 (patch) (side-by-side diff) | |
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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = battery.h batterystatus.h batteryappletimpl.h SOURCES = battery.cpp batterystatus.cpp batteryappletimpl.cpp TARGET = batteryapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = cardmon.h cardmonimpl.h SOURCES = cardmon.cpp cardmonimpl.cpp TARGET = cardmonapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = clipboard.h clipboardappletimpl.h SOURCES = clipboard.cpp clipboardappletimpl.cpp TARGET = clipboardapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = clock.h clockappletimpl.h SOURCES = clock.cpp clockappletimpl.cpp TARGET = clockapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = home.h SOURCES = home.cpp TARGET = homeapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = irda.h irdaappletimpl.h SOURCES = irda.cpp irdaappletimpl.cpp TARGET = irdaapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = logout.h SOURCES = logout.cpp TARGET = logoutapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = restart.h restartappletimpl.h SOURCES = restart.cpp restartappletimpl.cpp TARGET = restartapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = restart.h SOURCES = restart.cpp TARGET = restartapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugn warn_on release HEADERS = rotate.h SOURCES = rotate.cpp TARGET = rotateapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = screenshot.h inputDialog.h screenshotappletimpl.h SOURCES = screenshot.cpp inputDialog.cpp screenshotappletimpl.cpp TARGET = screenshotapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = suspend.h SOURCES = suspend.cpp TARGET = suspendapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = vmemo.h vmemoimpl.h adpcm.h SOURCES = vmemo.cpp vmemoimpl.cpp adpcm.c TARGET = vmemoapplet 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = volume.h volumeappletimpl.h oledbox.h SOURCES = volume.cpp volumeappletimpl.cpp oledbox.cpp TARGET = volumeapplet 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 @@ -546,7 +546,11 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais args[j] = NULL; #ifndef Q_OS_WIN32 +#ifdef Q_OS_MACX + if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".dylib" ) ) { +#else if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".so" ) ) { +#endif /* Q_OS_MACX */ qDebug( "Quick launching: %s", args[0] ); if ( getuid() == 0 ) setpriority( PRIO_PROCESS, qlPid, 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 @@ -227,7 +227,11 @@ void InputMethods::unloadMethod( QValueList<InputMethod>& list ) { QStringList InputMethods::plugins()const { QString path = QPEApplication::qpeDir() + "/plugins/inputmethods"; +#ifdef Q_OS_MACX + QDir dir( path, "lib*.dylib" ); +#else QDir dir( path, "lib*.so" ); +#endif /* Q_OS_MACX */ return dir.entryList(); } 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 @@ -36,7 +36,11 @@ IrServer::IrServer( QObject *parent, const char *name ) lib = 0; obexIface = 0; QString path = QPEApplication::qpeDir() + "/plugins/obex/"; +#ifdef Q_OS_MACX + QDir dir( path, "lib*.dylib" ); +#else QDir dir( path, "lib*.so" ); +#endif /* Q_OS_MACX */ QStringList list = dir.entryList(); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { 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 @@ -276,7 +276,9 @@ int initApplication( int argc, char ** argv ) qDebug("exiting..."); delete s; +#ifndef Q_OS_MACX ODevice::inst()->setSoftSuspend( false ); +#endif return rv; } 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,7 +1,7 @@ /********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** -** This file is part of Qtopia Environment. +** This file is part of the Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software @@ -19,25 +19,47 @@ **********************************************************************/ #include "packageslave.h" +#include <qtopia/qprocess.h> -#include <qpe/process.h> -#include <qpe/qcopenvelope_qws.h> +#ifdef Q_WS_QWS +#include <qtopia/qcopenvelope_qws.h> +#endif #include <qdatastream.h> +#ifdef Q_WS_QWS #include <qcopchannel_qws.h> +#endif +#include <qtextstream.h> +#include <qdir.h> + +#include <stdlib.h> +#include <sys/stat.h> // mkdir() + +#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) #include <unistd.h> +#include <sys/vfs.h> +#include <mntent.h> +#elif defined(Q_OS_WIN32) +#include <windows.h> +#include <winbase.h> +#elif defined(Q_OS_MACX) +#include <unistd.h> +#endif + -PackageSlave::PackageSlave( QObject *parent, char* name ) - : QObject( parent, name ), packageChannel( 0 ) +PackageHandler::PackageHandler( QObject *parent, char* name ) + : QObject( parent, name ), packageChannel( 0 ), currentProcess( 0 ), mNoSpaceLeft( FALSE ) { // setup qcop channel +#ifndef QT_NO_COP packageChannel = new QCopChannel( "QPE/Package", this ); connect( packageChannel, SIGNAL( received(const QCString &, const QByteArray &) ), this, SLOT( qcopMessage( const QCString &, const QByteArray &) ) ); +#endif } -void PackageSlave::qcopMessage( const QCString &msg, const QByteArray &data ) +void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) { QDataStream stream( data, IO_ReadOnly ); @@ -45,53 +67,275 @@ void PackageSlave::qcopMessage( const QCString &msg, const QByteArray &data ) QString file; stream >> file; installPackage( file ); - } - else if ( msg == "removePackage(QString)" ) { + } else if ( msg == "removePackage(QString)" ) { QString file; stream >> file; removePackage( file ); + } else if ( msg == "addPackageFiles(QString,QString)" ) { + QString location, listfile; + stream >> location >> listfile; + addPackageFiles( location, listfile); + } else if ( msg == "addPackages(QString)" ) { + QString location; + stream >> location; + addPackages( location ); + } else if ( msg == "cleanupPackageFiles(QString)" ) { + QString listfile; + stream >> listfile; + cleanupPackageFiles( listfile ); + } else if ( msg == "cleanupPackages(QString)" ) { + QString location; + stream >> location; + cleanupPackages( location ); + } else if ( msg == "prepareInstall(QString,QString)" ) { + QString size, path; + stream >> size; + stream >> path; + prepareInstall( size, path ); } } -void PackageSlave::installPackage( const QString &package ) +void PackageHandler::installPackage( const QString &package ) { - Process proc( QStringList() << "ipkg" << "install" << package ); + if ( mNoSpaceLeft ) { + mNoSpaceLeft = FALSE; + // Don't emit that for now, I still couldn't test it (Wener) + //sendReply( "installFailed(QString)", package ); + //return; + } + + currentProcess = new QProcess( QStringList() << "ipkg" << "install" << package ); // No tr + connect( currentProcess, SIGNAL( processExited() ), SLOT( iProcessExited() ) ); + connect( currentProcess, SIGNAL( readyReadStdout() ), SLOT( readyReadStdout() ) ); + connect( currentProcess, SIGNAL( readyReadStderr() ), SLOT( readyReadStderr() ) ); + currentPackage = package; + currentProcessError=""; sendReply( "installStarted(QString)", package ); + currentProcess->start(); +} + +void PackageHandler::removePackage( const QString &package ) +{ + currentProcess = new QProcess( QStringList() << "ipkg" << "remove" << package ); // No tr + connect( currentProcess, SIGNAL( processExited() ), SLOT( rmProcessExited() ) ); + connect( currentProcess, SIGNAL( readyReadStdout() ), SLOT( readyReadStdout() ) ); + connect( currentProcess, SIGNAL( readyReadStderr() ), SLOT( readyReadStderr() ) ); + currentPackage = package; + + currentProcessError=""; + sendReply( "removeStarted(QString)", package ); + currentProcess->start(); +} + +void PackageHandler::sendReply( const QCString& msg, const QString& arg ) +{ +#ifndef QT_NO_COP + QCopEnvelope e( "QPE/Desktop", msg ); + e << arg; +#endif +} + +void PackageHandler::addPackageFiles( const QString &location, + const QString &listfile ) +{ + QFile f(listfile); +#ifndef Q_OS_WIN32 + //make a copy so we can remove the symlinks later + mkdir( ("/usr/lib/ipkg/info/"+location).ascii(), 0777 ); + system(("cp " + f.name() + " /usr/lib/ipkg/info/"+location).ascii()); +#else + QDir d; + //#### revise + qDebug("Copy file at %s: %s", __FILE__, __LINE__ ); + d.mkdir(("/usr/lib/ipkg/info/" + location).ascii()); + system(("copy " + f.name() + " /usr/lib/ipkg/info/"+location).ascii()); +#endif + + + if ( f.open(IO_ReadOnly) ) { + QTextStream ts(&f); + + QString s; + while ( !ts.eof() ) { // until end of file... + s = ts.readLine(); // line of text excluding '\n' + // for s, do link/mkdir. + if ( s.right(1) == "/" ) { + qDebug("do mkdir for %s", s.ascii()); +#ifndef Q_OS_WIN32 + mkdir( s.ascii(), 0777 ); + //possible optimization: symlink directories + //that don't exist already. -- Risky. +#else + d.mkdir( s.ascii()); +#endif + + } else { +#ifndef Q_OS_WIN32 + qDebug("do symlink for %s", s.ascii()); + symlink( (location + s).ascii(), s.ascii() ); +#else + qDebug("Copy file instead of a symlink for WIN32"); + if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE)) + qWarning("Unable to create symlinkfor %s", + (location + s).ascii()); +#endif + } + } + f.close(); + } +} - QString output; - if ( proc.exec( "", output ) ) { - sendReply( "installDone(QString)", package ); +void PackageHandler::addPackages( const QString &location ) +{ + // get list of *.list in location/usr/lib/ipkg/info/*.list + QDir dir(location + "/usr/lib/ipkg/info", "*.list", // No tr + QDir::Name, QDir::Files); + if ( !dir.exists() ) + return; + + QStringList packages = dir.entryList(); + for ( QStringList::Iterator it = packages.begin(); + it != packages.end(); ++it ) { + addPackageFiles( location, *it ); } +} + + +void PackageHandler::cleanupPackageFiles( const QString &listfile ) +{ + QFile f(listfile); + + if ( f.open(IO_ReadOnly) ) { + QTextStream ts(&f); + + QString s; + while ( !ts.eof() ) { // until end of file... + s = ts.readLine(); // line of text excluding '\n' + // for s, do link/mkdir. + if ( s.right(1) == "/" ) { + //should rmdir if empty, after all files have been removed + } else { +#ifndef Q_OS_WIN32 + qDebug("remove symlink for %s", s.ascii()); + //check if it is a symlink first (don't remove /etc/passwd...) + char buf[10]; //we don't care about the contents + if ( ::readlink( s.ascii(),buf, 10 >= 0 ) ) + ::unlink( s.ascii() ); +#else + // ### revise + qWarning("Unable to remove symlink %s:%s", __FILE__, __LINE__); +#endif + } + } + f.close(); + + //remove the list file + ::unlink( listfile.ascii() ); + + } +} + +void PackageHandler::cleanupPackages( const QString &location ) +{ + // get list of *.list in location/usr/lib/ipkg/info/*.list + QDir dir( "/usr/lib/ipkg/info/"+location, "*.list", // No tr + QDir::Name, QDir::Files); + if ( !dir.exists() ) + return; + + QStringList packages = dir.entryList(); + for ( QStringList::Iterator it = packages.begin(); + it != packages.end(); ++it ) { + cleanupPackageFiles( *it ); + } + + //remove the backup directory + //### +} + +void PackageHandler::prepareInstall( const QString& size, const QString& path ) +{ + // Check whether there will be enough space to install the next package. + bool ok; + unsigned int s = size.toUInt( &ok ); + + if ( !ok ) + return; + + // Shamelessly stolen from the sysinfo application (Werner) +#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) + struct statfs fs; + if ( statfs( path.latin1(), &fs ) == 0 ) + if ( s > fs.f_bsize * fs.f_bavail ) { + //qDebug("############### Not enough space left ###############"); + mNoSpaceLeft = TRUE; + } +#endif +} + +void PackageHandler::iProcessExited() +{ + if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 ) + sendReply( "installDone(QString)", currentPackage ); else { - sendReply( "installFailed(QString)", package ); +#ifndef QT_NO_COP + QCopEnvelope e( "QPE/Desktop", "installFailed(QString,int,QString)" ); + e << currentPackage << currentProcess->exitStatus() + << currentProcessError; +#endif } + + delete currentProcess; + currentProcess = 0; + +#ifndef QT_NO_COP QCopEnvelope e("QPE/System", "linkChanged(QString)"); QString lf = QString::null; e << lf; - unlink( package ); +#endif + unlink( currentPackage ); } -void PackageSlave::removePackage( const QString &package ) +void PackageHandler::rmProcessExited() { - Process proc( QStringList() << "ipkg" << "remove" << package ); + if ( currentProcess->normalExit() && currentProcess->exitStatus() == 0 ) + sendReply( "removeDone(QString)", currentPackage ); + else + sendReply( "removeFailed(QString)", currentPackage ); - sendReply( "removeStarted(QString)", package ); - - QString output; - if ( proc.exec( "", output ) ) { - sendReply( "removeDone(QString)", package ); - } - else { - sendReply( "removeFailed(QString)", package ); - } +#ifndef QT_NO_COP QCopEnvelope e("QPE/System", "linkChanged(QString)"); QString lf = QString::null; e << lf; +#endif } -void PackageSlave::sendReply( const QCString& msg, const QString& arg ) +void PackageHandler::readyReadStdout() { - QCopEnvelope e( "QPE/Desktop", msg ); - e << arg; + while ( currentProcess->canReadLineStdout() ) { + QString line = currentProcess->readLineStdout(); + currentProcessError.append("OUT:"+line); + if ( line.contains( "Unpacking" ) ) // No tr + sendReply( "installStep(QString)", "one" ); // No tr + else if ( line.contains( "Configuring" ) ) // No tr + sendReply( "installStep(QString)", "two" ); // No tr + } +} + +void PackageHandler::readyReadStderr() +{ + while ( currentProcess->canReadLineStderr() ) { + QString line = currentProcess->readLineStderr(); + currentProcessError.append("ERR:"+line); + } +} + +void PackageHandler::redoPackages() +{ + //get list of filesystems + + //call cleanupPackages for the ones that have disappeared + + //call addPackageFiles for the new ones } 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 @@ -50,6 +50,9 @@ #include <errno.h> +#ifdef Q_OS_MACX +#include <sys/time.h> +#endif #include <sys/resource.h> #ifdef __MIPSEL__ 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 @@ -115,6 +115,11 @@ DEPENDPATH += $(OPIEDIR)/rsync TARGET = qpe -LIBS += -lcrypt -lqpe -lopie +CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) +contains( CONFTEST, y ){ + LIBS += -lqpe -lopie +}else{ + LIBS += -lcrypt -lqpe -lopie +} 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 @@ -256,7 +256,11 @@ void StartMenu::loadApplets() QString lang = getenv( "LANG" ); QString path = QPEApplication::qpeDir() + "/plugins/applets"; +#ifdef Q_OS_MACX + QDir dir( path, "lib*.dylib" ); +#else QDir dir( path, "lib*.so" ); +#endif /* Q_OS_MACX */ QStringList list = dir.entryList(); QStringList::Iterator it; int napplets=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 @@ -102,7 +102,11 @@ void SysTray::addApplets() QString lang = getenv( "LANG" ); QString path = QPEApplication::qpeDir() + "/plugins/applets"; +#ifdef Q_OS_MACX + QDir dir( path, "lib*.dylib" ); +#else QDir dir( path, "lib*.so" ); +#endif /* Q_OS_MACX */ QStringList list = dir.entryList(); QStringList::Iterator it; int napplets=0; @@ -110,6 +114,7 @@ void SysTray::addApplets() for ( it = list.begin(); it != list.end(); ++it ) { if ( exclude.find( *it ) != exclude.end() ) continue; + qWarning( "Found Applet: %s", (*it).latin1() ); TaskbarAppletInterface *iface = 0; QLibrary *lib = new QLibrary( path + "/" + *it ); if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 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 @@ -28,8 +28,11 @@ #include <unistd.h> #include <stdlib.h> #include <time.h> + +#ifndef Q_OS_MACX #include <shadow.h> #include <crypt.h> +#endif /* Q_OS_MACX */ #else #include <stdlib.h> 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,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on release +CONFIG += qt plugin warn_on release HEADERS = wavplugin.h wavpluginimpl.h SOURCES = wavplugin.cpp wavpluginimpl.cpp TARGET = wavplugin 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,6 +1,6 @@ TEMPLATE = lib CONFIG -= moc -CONFIG += qt release +CONFIG += qt plugin release # Input HEADERS = addressplugin.h addresspluginimpl.h addresspluginconfig.h \ 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,6 +1,6 @@ TEMPLATE = lib CONFIG -= moc -CONFIG += qt release +CONFIG += qt plugin release # Input HEADERS = datebookplugin.h datebookpluginimpl.h datebookpluginconfig.h \ datebookevent.h datebookpluginwidget.h 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,6 +1,6 @@ TEMPLATE = lib CONFIG -= moc -CONFIG += qt release +CONFIG += qt plugin release # Input HEADERS = mailplugin.h mailpluginimpl.h mailpluginwidget.h 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,6 +1,6 @@ TEMPLATE = lib CONFIG -= moc -CONFIG += qt release +CONFIG += qt plugin release # Input HEADERS = todoplugin.h todopluginimpl.h todopluginconfig.h \ 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 @@ -174,11 +174,18 @@ void Today::loadPlugins() { } QString path = QPEApplication::qpeDir() + "/plugins/today"; + qWarning("Searching for Plugins in: %s", path.latin1()); +#ifdef Q_OS_MACX + QDir dir( path, "lib*.dylib" ); +#else QDir dir( path, "lib*.so" ); +#endif QStringList list = dir.entryList(); QStringList::Iterator it; + qWarning("Found: %d entries !", list.count() ); + QMap<QString, TodayPlugin> tempList; for ( it = list.begin(); it != list.end(); ++it ) { 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 @@ -23,12 +23,20 @@ #include <unistd.h> #include <stdlib.h> #include <time.h> + +#ifndef Q_OS_MACX #include <shadow.h> +#endif /* Q_OS_MACX */ /* we need the _OS_LINUX stuff first ! */ #include <qglobal.h> #ifndef _OS_LINUX_ +// Is anybody able to review this ? The include "uuid/uuid.h" couldn't be found +// anywhere ? Therfore I removed it completely.. +// I think it should be made permanentyl !? (eilers) +#warning "Where should uuid/uuid.h be found ? Removed this part .. (eilers)" +#if 0 extern "C" { @@ -36,10 +44,14 @@ extern "C" #define UUID_H_INCLUDED } +#endif + #endif // not defined linux #if defined(_OS_LINUX_) #include <shadow.h> +#elif defined(Q_OS_MACX) +#include <stdlib.h> #endif #include <qdir.h> @@ -91,15 +103,15 @@ struct UidGen { QString uuid(); }; -#if !defined(_OS_LINUX_) - +#if defined(Q_OS_MACX) QString UidGen::uuid() { - uuid_t uuid; - uuid_generate( uuid ); - return QUUid( uuid ).toString(); + srandom( random() ); + QString numStr = QString::number( random() ); + + return "{" + numStr + "}"; } -#else +#elif defined(_OS_LINUX_) /* * linux got a /proc/sys/kernel/random/uuid file * it'll generate the uuids for us @@ -114,6 +126,13 @@ QString UidGen::uuid() return "{" + stream.read().stripWhiteSpace() + "}"; } +#else +QString UidGen::uuid() +{ + uuid_t uuid; + ::uuid_generate( uuid ); + return QUUid( uuid ).toString(); +} #endif } 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 @@ -79,7 +79,11 @@ void MenuSettings::init ( ) QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; +#ifdef Q_OS_MACX + QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); +#else QStringList list = QDir ( path, "lib*.so" ). entryList ( ); +#endif /* Q_OS_MACX */ for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { QString name; 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 @@ -75,16 +75,23 @@ void TaskbarSettings::init ( ) QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; +#ifdef Q_OS_MACX + QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); +#else QStringList list = QDir ( path, "lib*.so" ). entryList ( ); +#endif /* Q_OS_MACX */ for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { QString name; QPixmap icon; TaskbarNamedAppletInterface *iface = 0; + qWarning("Load applet: %s", (*it).latin1() ); QLibrary *lib = new QLibrary ( path + "/" + *it ); lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); + qWarning("<1>"); if ( iface ) { + qWarning("<2>"); QString lang = getenv( "LANG" ); QTranslator *trans = new QTranslator ( qApp ); QString type = (*it). left ((*it). find (".")); @@ -97,12 +104,20 @@ void TaskbarSettings::init ( ) icon = iface-> icon ( ); iface-> release ( ); } + qWarning("<3>"); if ( !iface ) { + qWarning("<4>"); lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); if ( iface ) { + qWarning("<5>"); name = (*it). mid ( 3 ); + qWarning("Found applet: %s", name.latin1() ); +#ifdef Q_OS_MACX + int sep = name. find( ".dylib" ); +#else int sep = name. find( ".so" ); +#endif /* Q_OS_MACX */ if ( sep > 0 ) name. truncate ( sep ); sep = name. find ( "applet" ); @@ -112,8 +127,10 @@ void TaskbarSettings::init ( ) iface-> release ( ); } } + qWarning("<6>"); if ( iface ) { + qWarning("<7>"); QCheckListItem *item; item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); if ( !icon. isNull ( )) |