summaryrefslogtreecommitdiff
path: root/core/launcher
authorzecke <zecke>2003-08-28 14:32:22 (UTC)
committer zecke <zecke>2003-08-28 14:32:22 (UTC)
commitf3c6caca7e96488ad9e1873e9c853f11b17a944e (patch) (unidiff)
tree4a83c306c573d5185f20c0f96f89aeffa24e2e1d /core/launcher
parenta069f32d9339fad02af60ac8aa991c3dee011039 (diff)
downloadopie-f3c6caca7e96488ad9e1873e9c853f11b17a944e.zip
opie-f3c6caca7e96488ad9e1873e9c853f11b17a944e.tar.gz
opie-f3c6caca7e96488ad9e1873e9c853f11b17a944e.tar.bz2
Make conpile with Opie
If QuickApps exec fails don't try to start it anytime soon If application fails to start and /tmp/qcop-msg- is present don't try to restart
Diffstat (limited to 'core/launcher') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/applauncher.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index 50c1b71..d6f93da 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -27,7 +27,7 @@
27#ifndef QTOPIA_PROGRAM_MONITOR 27#ifndef QTOPIA_PROGRAM_MONITOR
28#define QTOPIA_PROGRAM_MONITOR 28#define QTOPIA_PROGRAM_MONITOR
29#endif 29#endif
30#include <qtopia/qpeglobal.h> 30#include <qtopia/global.h>
31 31
32#ifndef Q_OS_WIN32 32#ifndef Q_OS_WIN32
33#include <sys/stat.h> 33#include <sys/stat.h>
@@ -61,6 +61,7 @@
61 61
62#include "applauncher.h" 62#include "applauncher.h"
63#include "documentlist.h" 63#include "documentlist.h"
64#include "launcherglobal.h"
64 65
65const int AppLauncher::RAISE_TIMEOUT_MS = 5000; 66const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
66 67
@@ -403,10 +404,11 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
403 if ( exitStatus == 255 ) { //could not find app (because global returns -1) 404 if ( exitStatus == 255 ) { //could not find app (because global returns -1)
404 QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) ); 405 QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) );
405 } else { 406 } else {
406 QFileInfo fi(Global::tempDir() + "qcop-msg-" + appName); 407 QFileInfo fi(Opie::Global::tempDir() + "qcop-msg-" + appName);
407 if ( fi.exists() && fi.size() ) { 408 if ( fi.exists() && fi.size() ) {
408 emit terminated(sigPid, appName); 409 emit terminated(sigPid, appName);
409 execute( appName, QString::null ); 410 qWarning("Re executing obmitted for %s", appName.latin1() );
411 // execute( appName, QString::null );
410 return; 412 return;
411 } 413 }
412 } 414 }
@@ -444,8 +446,8 @@ bool AppLauncher::isRunning(const QString &app)
444 446
445bool AppLauncher::executeBuiltin(const QString &c, const QString &document) 447bool AppLauncher::executeBuiltin(const QString &c, const QString &document)
446{ 448{
447 Global::Command* builtin = Global::builtinCommands(); 449 Global::Command* builtin = Opie::Global::builtinCommands();
448 QGuardedPtr<QWidget> *running = Global::builtinRunning(); 450 QGuardedPtr<QWidget> *running = Opie::Global::builtinRunning();
449 451
450 // Attempt to execute the app using a builtin class for the app 452 // Attempt to execute the app using a builtin class for the app
451 if (builtin) { 453 if (builtin) {
@@ -483,6 +485,7 @@ bool AppLauncher::executeBuiltin(const QString &c, const QString &document)
483 485
484bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise) 486bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise)
485{ 487{
488 qWarning("AppLauncher::execute");
486 // Convert the command line in to a list of arguments 489 // Convert the command line in to a list of arguments
487 QStringList list = QStringList::split(QRegExp(" *"),c); 490 QStringList list = QStringList::split(QRegExp(" *"),c);
488 if ( !docParam.isEmpty() ) 491 if ( !docParam.isEmpty() )
@@ -494,7 +497,7 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais
494 channel += appName.latin1(); 497 channel += appName.latin1();
495 498
496 // Need to lock it to avoid race conditions with QPEApplication::processQCopFile 499 // Need to lock it to avoid race conditions with QPEApplication::processQCopFile
497 QFile f(Global::tempDir() + "qcop-msg-" + appName); 500 QFile f(Opie::Global::tempDir() + "qcop-msg-" + appName);
498 if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) { 501 if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) {
499#ifndef Q_OS_WIN32 502#ifndef Q_OS_WIN32
500 flock(f.handle(), LOCK_EX); 503 flock(f.handle(), LOCK_EX);
@@ -528,7 +531,7 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais
528 } 531 }
529 532
530#ifdef QT_NO_QWS_MULTIPROCESS 533#ifdef QT_NO_QWS_MULTIPROCESS
531 QMessageBox::warning( 0, tr("Error"), tr("Could not find the application %1").arg(c), 534 QMessageBox::warning( 0, tr("Error"), tr("<qt>Could not find the application %1</qt>").arg(c),
532 tr("OK"), 0, 0, 0, 1 ); 535 tr("OK"), 0, 0, 0, 1 );
533#else 536#else
534 537
@@ -635,6 +638,10 @@ int AppLauncher::pidForName( const QString &appName )
635 638
636void AppLauncher::createQuickLauncher() 639void AppLauncher::createQuickLauncher()
637{ 640{
641 static bool disabled = FALSE;
642 if (disabled)
643 return;
644
638 qlReady = FALSE; 645 qlReady = FALSE;
639 qlPid = ::vfork(); 646 qlPid = ::vfork();
640 if ( !qlPid ) { 647 if ( !qlPid ) {
@@ -648,6 +655,8 @@ void AppLauncher::createQuickLauncher()
648 setenv( "LD_BIND_NOW", "1", 1 ); 655 setenv( "LD_BIND_NOW", "1", 1 );
649 ::execv( QPEApplication::qpeDir()+"bin/quicklauncher", args ); 656 ::execv( QPEApplication::qpeDir()+"bin/quicklauncher", args );
650 ::execvp( "quicklauncher", args ); 657 ::execvp( "quicklauncher", args );
658 delete []args;
659 disabled = TRUE;
651 _exit( -1 ); 660 _exit( -1 );
652 } else if ( qlPid == -1 ) { 661 } else if ( qlPid == -1 ) {
653 qlPid = 0; 662 qlPid = 0;