Diffstat (limited to 'core/launcher/applauncher.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/applauncher.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 | |||
@@ -525,49 +525,53 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais | |||
525 | f.close(); | 525 | f.close(); |
526 | } | 526 | } |
527 | if ( QCopChannel::isRegistered(channel) ) // avoid unnecessary warnings | 527 | if ( QCopChannel::isRegistered(channel) ) // avoid unnecessary warnings |
528 | QCopChannel::send(channel,"QPEProcessQCop()"); | 528 | QCopChannel::send(channel,"QPEProcessQCop()"); |
529 | 529 | ||
530 | return TRUE; | 530 | return TRUE; |
531 | } | 531 | } |
532 | 532 | ||
533 | #ifdef QT_NO_QWS_MULTIPROCESS | 533 | #ifdef QT_NO_QWS_MULTIPROCESS |
534 | QMessageBox::warning( 0, tr("Error"), tr("<qt>Could not find the application %1</qt>").arg(c), | 534 | QMessageBox::warning( 0, tr("Error"), tr("<qt>Could not find the application %1</qt>").arg(c), |
535 | tr("OK"), 0, 0, 0, 1 ); | 535 | tr("OK"), 0, 0, 0, 1 ); |
536 | #else | 536 | #else |
537 | 537 | ||
538 | QStrList slist; | 538 | QStrList slist; |
539 | unsigned j; | 539 | unsigned j; |
540 | for ( j = 0; j < list.count(); j++ ) | 540 | for ( j = 0; j < list.count(); j++ ) |
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]); |
558 | emit launched(qlPid, QString(args[0])); | 562 | emit launched(qlPid, QString(args[0])); |
559 | QCopEnvelope e("QPE/System", "busy()"); | 563 | QCopEnvelope e("QPE/System", "busy()"); |
560 | qlPid = 0; | 564 | qlPid = 0; |
561 | qlReady = FALSE; | 565 | qlReady = FALSE; |
562 | QTimer::singleShot( getuid() == 0 ? 800 : 1500, this, SLOT(createQuickLauncher()) ); | 566 | QTimer::singleShot( getuid() == 0 ? 800 : 1500, this, SLOT(createQuickLauncher()) ); |
563 | } else { | 567 | } else { |
564 | int pid = ::vfork(); | 568 | int pid = ::vfork(); |
565 | if ( !pid ) { | 569 | if ( !pid ) { |
566 | for ( int fd = 3; fd < 100; fd++ ) | 570 | for ( int fd = 3; fd < 100; fd++ ) |
567 | ::close( fd ); | 571 | ::close( fd ); |
568 | ::setpgid( ::getpid(), ::getppid() ); | 572 | ::setpgid( ::getpid(), ::getppid() ); |
569 | // Try bindir first, so that foo/bar works too | 573 | // Try bindir first, so that foo/bar works too |
570 | ::execv( QPEApplication::qpeDir()+"bin/"+args[0], (char * const *)args ); | 574 | ::execv( QPEApplication::qpeDir()+"bin/"+args[0], (char * const *)args ); |
571 | ::execvp( args[0], (char * const *)args ); | 575 | ::execvp( args[0], (char * const *)args ); |
572 | _exit( -1 ); | 576 | _exit( -1 ); |
573 | } | 577 | } |