From f80b38b2e348b588bf7560161d7551e6bd4939c0 Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 21 Feb 2004 11:32:55 +0000 Subject: Move to LibOpie2 remove launcher global and use OGlobal --- diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp index 0db99dd..f161e98 100644 --- a/core/launcher/applauncher.cpp +++ b/core/launcher/applauncher.cpp @@ -27,7 +27,7 @@ #ifndef QTOPIA_PROGRAM_MONITOR #define QTOPIA_PROGRAM_MONITOR #endif -#include +#include #ifndef Q_OS_WIN32 #include @@ -61,7 +61,6 @@ #include "applauncher.h" #include "documentlist.h" -#include "launcherglobal.h" const int AppLauncher::RAISE_TIMEOUT_MS = 5000; @@ -404,7 +403,7 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus) if ( exitStatus == 255 ) { //could not find app (because global returns -1) QMessageBox::information(0, tr("Application not found"), tr("Could not locate application %1").arg( app->exec() ) ); } else { - QFileInfo fi(Opie::Global::tempDir() + "qcop-msg-" + appName); + QFileInfo fi(OGlobal::tempDirPath() + "qcop-msg-" + appName); if ( fi.exists() && fi.size() ) { emit terminated(sigPid, appName); qWarning("Re executing obmitted for %s", appName.latin1() ); @@ -446,8 +445,8 @@ bool AppLauncher::isRunning(const QString &app) bool AppLauncher::executeBuiltin(const QString &c, const QString &document) { - Global::Command* builtin = Opie::Global::builtinCommands(); - QGuardedPtr *running = Opie::Global::builtinRunning(); + Global::Command* builtin = OGlobal::builtinCommands(); + QGuardedPtr *running = OGlobal::builtinRunning(); // Attempt to execute the app using a builtin class for the app if (builtin) { @@ -497,7 +496,7 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais channel += appName.latin1(); // Need to lock it to avoid race conditions with QPEApplication::processQCopFile - QFile f(Opie::Global::tempDir() + "qcop-msg-" + appName); + QFile f(OGlobal::tempDirPath() + "qcop-msg-" + appName); if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) { #ifndef Q_OS_WIN32 flock(f.handle(), LOCK_EX); diff --git a/core/launcher/config.in b/core/launcher/config.in index 2d9c1c2..db39210 100644 --- a/core/launcher/config.in +++ b/core/launcher/config.in @@ -1,16 +1,16 @@ config LAUNCHER boolean "opie-taskbar (program launcher qpe for Opie)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI if LAUNCHER config PRELOAD boolean default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LAUNCHER + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LAUNCHER config LAUNCHER_CORE boolean default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LAUNCHER && PRELOAD + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LAUNCHER && PRELOAD endif diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index ece6931..440bf1e 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp @@ -19,12 +19,12 @@ **********************************************************************/ #include "documentlist.h" #include "serverinterface.h" -#include "launcherglobal.h" + +#include #include #include #include -#include #include #include #include @@ -90,7 +90,10 @@ public: }; -DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs, +/* + * scandocs will be read from Config + */ +DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/, QObject *parent, const char *name ) : QObject( parent, name ) { @@ -269,7 +272,7 @@ void DocumentList::linkChanged( QString arg ) { //qDebug( "linkchanged( %s )", arg.latin1() ); - if ( arg.isNull() || Opie::Global::isAppLnkFileName( arg ) ) { + if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) { reloadAppLnks(); } else { diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index 988e432..bf06e75 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp @@ -27,13 +27,14 @@ #include "stabmon.h" #include "launcher.h" #include "firstuse.h" -#include "launcherglobal.h" + +#include #include #include #include //#include -#include + #include #include @@ -64,14 +65,14 @@ #endif #include -#include +#include using namespace Opie; static void cleanup() { - QDir dir( Opie::Global::tempDir(), "qcop-msg-*" ); + QDir dir( OGlobal::tempDirPath(), "qcop-msg-*" ); QStringList stale = dir.entryList(); QStringList::Iterator it; diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp index 9cb56ce..b45f0cc 100644 --- a/core/launcher/qcopbridge.cpp +++ b/core/launcher/qcopbridge.cpp @@ -21,11 +21,13 @@ #include "qcopbridge.h" #include "transferserver.h" +#include + #ifdef Q_WS_QWS #include #endif #include -#include + #include #include @@ -55,7 +57,6 @@ #include #endif -#include "launcherglobal.h" //#define INSECURE @@ -325,7 +326,7 @@ void QCopBridgePI::sendDesktopMessage( const QCString &msg, const QByteArray& da writeBlock(hdr,sizeof(hdr)-1); writeBlock(msg,msg.length()); writeBlock(" ",1); - QByteArray b64 = Opie::Global::encodeBase64(data); + QByteArray b64 = OGlobal::encodeBase64(data); writeBlock(b64.data(),b64.size()); writeBlock("\r\n",2); diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp index 48770e8..1146dcd 100644 --- a/core/launcher/screensaver.cpp +++ b/core/launcher/screensaver.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include using namespace Opie; diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp index b9580c7..32fcdd0 100644 --- a/core/launcher/server.cpp +++ b/core/launcher/server.cpp @@ -51,8 +51,8 @@ #include //#include -#include -#include +#include +#include #include #include diff --git a/core/launcher/server.pro b/core/launcher/server.pro index 0513536..f82c741 100644 --- a/core/launcher/server.pro +++ b/core/launcher/server.pro @@ -46,7 +46,6 @@ HEADERS += server.h \ $$(OPIEDIR)/rsync/qrsync.h \ syncdialog.h \ serverapp.h \ - launcherglobal.h \ qprocess.h \ screensaver.h @@ -101,7 +100,6 @@ SOURCES += server.cpp \ $$(OPIEDIR)/rsync/qrsync.cpp \ syncdialog.cpp \ serverapp.cpp \ - launcherglobal.cpp \ qprocess.cpp \ qprocess_unix.cpp \ screensaver.cpp @@ -115,11 +113,12 @@ DEPENDPATH += $(OPIEDIR)/rsync TARGET = qpe +#needs OWait and ODevice CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) contains( CONFTEST, y ){ - LIBS += -lqpe -lopie + LIBS += -lqpe -lopiecore2 -lopieui2 }else{ - LIBS += -lcrypt -lqpe -lopie + LIBS += -lcrypt -lqpe -lopiecore2 -lopieui2 } include ( $(OPIEDIR)/include.pro ) diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index b84eed8..c199063 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp @@ -354,7 +354,6 @@ void StartMenu::loadApplets() while ( napplets-- ) { MenuApplet *applet = xapplets[napplets]; - applet->popup = applet->iface->popup( this ); // menuApplets got an id < -1 @@ -384,6 +383,7 @@ void StartMenu::addApplets(QPopupMenu* pop) { applet->id = pop->insertItem( applet->iface->icon(), applet->iface->text() ); + dict.insert( applet->id, new MenuApplet( *applet ) ); } /* need to update the key */ diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index 9519d11..9cb9d7a 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp @@ -19,7 +19,7 @@ **********************************************************************/ //#define _XOPEN_SOURCE -#include +#include #include #ifndef Q_OS_WIN32 @@ -32,7 +32,7 @@ #ifndef Q_OS_MACX #include #include -#endif /* Q_OS_MACX */ +#endif /* Q_OS_MACX */ #else #include @@ -63,7 +63,6 @@ #include #endif -#include "launcherglobal.h" #include "transferserver.h" #include @@ -114,7 +113,7 @@ QString SyncAuthentication::serverId() QString r = cfg.readEntry("serverid"); if ( r.isEmpty() ) { - r = Opie::Global::uuid(); + r = OGlobal::generateUuid(); cfg.writeEntry("serverid", r ); } return r; @@ -193,18 +192,18 @@ bool SyncAuthentication::checkPassword( const QString& password ) static int lastdenial=0; static int denials=0; int now = time(0); - + Config cfg("Security"); - cfg.setGroup("Sync"); + cfg.setGroup("Sync"); QString syncapp = cfg.readEntry("syncapp","Qtopia"); - + //No password needed if the user really wants it if (syncapp == "IntelliSync") { return TRUE; - } - + } + // Detect old Qtopia Desktop (no password) - if ( password.isEmpty() ) { + if ( password.isEmpty() ) { if ( denials < 3 || now > lastdenial+600 ) { QMessageBox unauth( tr("Sync Connection"), @@ -219,17 +218,17 @@ bool SyncAuthentication::checkPassword( const QString& password ) denials++; lastdenial=now; - } + } return FALSE; - - } + + } // Second, check sync password... static int lock=0; if ( lock ) return FALSE; - ++lock; + ++lock; /* * we need to support old Sync software and QtopiaDesktop diff --git a/core/launcher/wait.cpp b/core/launcher/wait.cpp index ab53a07..34ffd1a 100644 --- a/core/launcher/wait.cpp +++ b/core/launcher/wait.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include -- cgit v0.9.0.2