Diffstat (limited to 'core/launcher/applauncher.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/applauncher.cpp | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp index 5a5517c..7000346 100644 --- a/core/launcher/applauncher.cpp +++ b/core/launcher/applauncher.cpp @@ -29,5 +29,20 @@ #endif + +#include "applauncher.h" +#include "documentlist.h" + +/* OPIE */ +#include <opie2/odebug.h> #include <opie2/oglobal.h> +#include <qtopia/qcopenvelope_qws.h> +#include <qtopia/qpeapplication.h> +using namespace Opie::Core; -#ifndef Q_OS_WIN32 +/* QT */ +#include <qtimer.h> +#include <qwindowsystem_qws.h> +#include <qmessagebox.h> +#include <qfileinfo.h> + +/* STD */ #include <sys/stat.h> @@ -39,8 +54,2 @@ #include <errno.h> -#else -#include <process.h> -#include <windows.h> -#include <winbase.h> -#endif - #include <signal.h> @@ -49,14 +58,2 @@ -#include <qtimer.h> -#include <qwindowsystem_qws.h> -#include <qmessagebox.h> -#include <qfileinfo.h> - -#include <qtopia/qcopenvelope_qws.h> -#include <qtopia/qpeapplication.h> - -#include "applauncher.h" -#include "documentlist.h" - -using namespace Opie::Core; const int AppLauncher::RAISE_TIMEOUT_MS = 5000; @@ -129,3 +126,3 @@ void AppLauncher::newQcopChannel(const QString& channelName) { -// qDebug("channel %s added", channelName.data() ); +// odebug << "channel " << channelName.data() << " added" << oendl; QString prefix("QPE/Application/"); @@ -143,3 +140,3 @@ void AppLauncher::newQcopChannel(const QString& channelName) } else if (channelName.startsWith("QPE/QuickLauncher-")) { - qDebug("Registered %s", channelName.latin1()); + odebug << "Registered " << channelName << "" << oendl; int pid = channelName.mid(18).toInt(); @@ -182,3 +179,3 @@ void AppLauncher::received(const QCString& msg, const QByteArray& data) if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) { - //qDebug( "Raising: %s", appName.latin1() ); + //odebug << "Raising: " << appName << "" << oendl; QCString channel = "QPE/Application/"; @@ -219,3 +216,3 @@ void AppLauncher::received(const QCString& msg, const QByteArray& data) stream >> appName; - qDebug("Got a heartbeat from %s", appName.latin1()); + odebug << "Got a heartbeat from " << appName << "" << oendl; QMap<QString,int>::Iterator it = waitingHeartbeat.find(appName); @@ -242,3 +239,3 @@ void AppLauncher::signalHandler(int) /* if (pid == 0 || &status == 0 ) { - qDebug("hmm, could not get return value from signal"); + odebug << "hmm, could not get return value from signal" << oendl; } @@ -247,3 +244,3 @@ void AppLauncher::signalHandler(int) #else - qDebug("Unhandled signal see by AppLauncher::signalHandler(int)"); + odebug << "Unhandled signal see by AppLauncher::signalHandler(int)" << oendl; #endif @@ -275,3 +272,3 @@ void AppLauncher::timerEvent( QTimerEvent *e ) - // qDebug("Checking in on %s", appKillerName.latin1()); + // odebug << "Checking in on " << appKillerName << "" << oendl; @@ -286,3 +283,3 @@ void AppLauncher::timerEvent( QTimerEvent *e ) if (appKillerBox->exec() == QMessageBox::Yes) { - // qDebug("Killing the app!!! Bwuhahahaha!"); + // odebug << "Killing the app!!! Bwuhahahaha!" << oendl; int pid = pidForName(appKillerName); @@ -317,3 +314,3 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus) if ( sigPid == qlPid ) { - qDebug( "quicklauncher stopped" ); + odebug << "quicklauncher stopped" << oendl; qlPid = 0; @@ -325,5 +322,5 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus) if ( sigPid == -1 ) - qDebug("non-qtopia application exited (disregarded)"); + odebug << "non-qtopia application exited (disregarded)" << oendl; else - qDebug("==== no pid matching %d in list, definite bug", sigPid); + odebug << "==== no pid matching " << sigPid << " in list, definite bug" << oendl; */ @@ -371,3 +368,3 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus) for (it = runningApps.begin(); it != runningApps.end(); ++it) { - qDebug("running according to internal list: %s, with pid %d", (*it).data(), it.key() ); + odebug << "running according to internal list: " << (*it).data() << ", with pid " << it.key() << "" << oendl; } @@ -405,3 +402,3 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus) emit terminated(sigPid, appName); - qWarning("Re executing obmitted for %s", appName.latin1() ); + owarn << "Re executing obmitted for " << appName << "" << oendl; // execute( appName, QString::null ); @@ -419,3 +416,3 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus) { - qDebug("Unhandled signal : AppLauncher::sigStopped(int sigPid, int sigStatus)"); + odebug << "Unhandled signal : AppLauncher::sigStopped(int sigPid, int sigStatus)" << oendl; } @@ -430,3 +427,3 @@ bool AppLauncher::isRunning(const QString &app) if ( t == -1 ) { - qDebug("appLauncher bug, %s believed running, but pid %d is not existing", app.data(), it.key() ); + odebug << "appLauncher bug, " << app.data() << " believed running, but pid " << it.key() << " is not existing" << oendl; runningApps.remove( it.key() ); @@ -483,3 +480,3 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais { - qWarning("AppLauncher::execute '%s' '%s'", (const char*) c, (const char*) docParam ); + owarn << "AppLauncher::execute '" << c << "' '" << docParam << "'" << oendl; // Convert the command line in to a list of arguments @@ -550,3 +547,3 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais #endif /* Q_OS_MACX */ - qDebug( "Quick launching: %s", args[0] ); + odebug << "Quick launching: " << args[0] << "" << oendl; if ( getuid() == 0 ) @@ -586,3 +583,3 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais if (!proc->start()){ - qDebug("Unable to start application %s", args[0]); + odebug << "Unable to start application " << args[0] << "" << oendl; }else{ @@ -596,3 +593,3 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais }else{ - qDebug("Unable to read process inforation #1 for %s", args[0]); + odebug << "Unable to read process inforation #1 for " << args[0] << "" << oendl; } @@ -600,3 +597,3 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais }else{ - qDebug("Unable to create process for application %s", args[0]); + odebug << "Unable to create process for application " << args[0] << "" << oendl; return FALSE; @@ -680,3 +677,3 @@ void AppLauncher::processExited() #ifdef Q_OS_WIN32 - qDebug("AppLauncher::processExited()"); + odebug << "AppLauncher::processExited()" << oendl; bool found = FALSE; @@ -684,3 +681,3 @@ void AppLauncher::processExited() if (!proc){ - qDebug("Interanl error NULL proc"); + odebug << "Interanl error NULL proc" << oendl; return; @@ -689,3 +686,3 @@ void AppLauncher::processExited() QString appName = proc->arguments()[0]; - qDebug("Removing application %s", appName.latin1()); + odebug << "Removing application " << appName << "" << oendl; runningAppsProc.remove(proc); @@ -716,3 +713,3 @@ void AppLauncher::processExited() }else{ - qDebug("Internal error application %s not listed as running", appName.latin1()); + odebug << "Internal error application " << appName << " not listed as running" << oendl; } |