-rw-r--r-- | core/launcher/applauncher.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp index a8779a5..c3584ad 100644 --- a/core/launcher/applauncher.cpp +++ b/core/launcher/applauncher.cpp | |||
@@ -439,97 +439,97 @@ bool AppLauncher::isRunning(const QString &app) | |||
439 | return TRUE; | 439 | return TRUE; |
440 | } | 440 | } |
441 | } | 441 | } |
442 | 442 | ||
443 | return FALSE; | 443 | return FALSE; |
444 | } | 444 | } |
445 | 445 | ||
446 | bool AppLauncher::executeBuiltin(const QString &c, const QString &document) | 446 | bool AppLauncher::executeBuiltin(const QString &c, const QString &document) |
447 | { | 447 | { |
448 | Global::Command* builtin = OGlobal::builtinCommands(); | 448 | Global::Command* builtin = OGlobal::builtinCommands(); |
449 | QGuardedPtr<QWidget> *running = OGlobal::builtinRunning(); | 449 | QGuardedPtr<QWidget> *running = OGlobal::builtinRunning(); |
450 | 450 | ||
451 | // Attempt to execute the app using a builtin class for the app | 451 | // Attempt to execute the app using a builtin class for the app |
452 | if (builtin) { | 452 | if (builtin) { |
453 | for (int i = 0; builtin[i].file; i++) { | 453 | for (int i = 0; builtin[i].file; i++) { |
454 | if ( builtin[i].file == c ) { | 454 | if ( builtin[i].file == c ) { |
455 | if ( running[i] ) { | 455 | if ( running[i] ) { |
456 | if ( !document.isNull() && builtin[i].documentary ) | 456 | if ( !document.isNull() && builtin[i].documentary ) |
457 | Global::setDocument(running[i], document); | 457 | Global::setDocument(running[i], document); |
458 | running[i]->raise(); | 458 | running[i]->raise(); |
459 | running[i]->show(); | 459 | running[i]->show(); |
460 | running[i]->setActiveWindow(); | 460 | running[i]->setActiveWindow(); |
461 | } else { | 461 | } else { |
462 | running[i] = builtin[i].func( builtin[i].maximized ); | 462 | running[i] = builtin[i].func( builtin[i].maximized ); |
463 | } | 463 | } |
464 | #ifndef QT_NO_COP | 464 | #ifndef QT_NO_COP |
465 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); | 465 | QCopEnvelope e("QPE/System", "notBusy(QString)" ); |
466 | e << c; // that was quick ;-) | 466 | e << c; // that was quick ;-) |
467 | #endif | 467 | #endif |
468 | return TRUE; | 468 | return TRUE; |
469 | } | 469 | } |
470 | } | 470 | } |
471 | } | 471 | } |
472 | 472 | ||
473 | // Convert the command line in to a list of arguments | 473 | // Convert the command line in to a list of arguments |
474 | QStringList list = QStringList::split(QRegExp(" *"),c); | 474 | QStringList list = QStringList::split(QRegExp(" *"),c); |
475 | QString ap=list[0]; | 475 | QString ap=list[0]; |
476 | 476 | ||
477 | if ( ap == "suspend" ) { // No tr | 477 | if ( ap == "suspend" ) { // No tr |
478 | QWSServer::processKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); | 478 | QWSServer::processKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); |
479 | return TRUE; | 479 | return TRUE; |
480 | } | 480 | } |
481 | 481 | ||
482 | return FALSE; | 482 | return FALSE; |
483 | } | 483 | } |
484 | 484 | ||
485 | bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise) | 485 | bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise) |
486 | { | 486 | { |
487 | qWarning("AppLauncher::execute"); | 487 | qWarning("AppLauncher::execute '%s' '%s'", (const char*) c, (const char*) docParam ); |
488 | // Convert the command line in to a list of arguments | 488 | // Convert the command line in to a list of arguments |
489 | QStringList list = QStringList::split(QRegExp(" *"),c); | 489 | QStringList list = QStringList::split(QRegExp(" *"),c); |
490 | if ( !docParam.isEmpty() ) | 490 | if ( !docParam.isEmpty() ) |
491 | list.append( docParam ); | 491 | list.append( docParam ); |
492 | 492 | ||
493 | QString appName = list[0]; | 493 | QString appName = list[0]; |
494 | if ( isRunning(appName) ) { | 494 | if ( isRunning(appName) ) { |
495 | QCString channel = "QPE/Application/"; | 495 | QCString channel = "QPE/Application/"; |
496 | channel += appName.latin1(); | 496 | channel += appName.latin1(); |
497 | 497 | ||
498 | // Need to lock it to avoid race conditions with QPEApplication::processQCopFile | 498 | // Need to lock it to avoid race conditions with QPEApplication::processQCopFile |
499 | QFile f(QString::fromLatin1("/tmp/qcop-msg-") + appName); | 499 | QFile f(QString::fromLatin1("/tmp/qcop-msg-") + appName); |
500 | if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) { | 500 | if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) { |
501 | #ifndef Q_OS_WIN32 | 501 | #ifndef Q_OS_WIN32 |
502 | flock(f.handle(), LOCK_EX); | 502 | flock(f.handle(), LOCK_EX); |
503 | #endif | 503 | #endif |
504 | 504 | ||
505 | QDataStream ds(&f); | 505 | QDataStream ds(&f); |
506 | QByteArray b; | 506 | QByteArray b; |
507 | QDataStream bstream(b, IO_WriteOnly); | 507 | QDataStream bstream(b, IO_WriteOnly); |
508 | if ( !f.size() ) { | 508 | if ( !f.size() ) { |
509 | ds << channel << QCString("raise()") << b; | 509 | ds << channel << QCString("raise()") << b; |
510 | if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) { | 510 | if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) { |
511 | int id = startTimer(RAISE_TIMEOUT_MS); | 511 | int id = startTimer(RAISE_TIMEOUT_MS); |
512 | waitingHeartbeat.insert( appName, id ); | 512 | waitingHeartbeat.insert( appName, id ); |
513 | } | 513 | } |
514 | } | 514 | } |
515 | if ( !docParam.isEmpty() ) { | 515 | if ( !docParam.isEmpty() ) { |
516 | bstream << docParam; | 516 | bstream << docParam; |
517 | ds << channel << QCString("setDocument(QString)") << b; | 517 | ds << channel << QCString("setDocument(QString)") << b; |
518 | } | 518 | } |
519 | 519 | ||
520 | f.flush(); | 520 | f.flush(); |
521 | #ifndef Q_OS_WIN32 | 521 | #ifndef Q_OS_WIN32 |
522 | flock(f.handle(), LOCK_UN); | 522 | flock(f.handle(), LOCK_UN); |
523 | #endif | 523 | #endif |
524 | f.close(); | 524 | f.close(); |
525 | } | 525 | } |
526 | if ( QCopChannel::isRegistered(channel) ) // avoid unnecessary warnings | 526 | if ( QCopChannel::isRegistered(channel) ) // avoid unnecessary warnings |
527 | QCopChannel::send(channel,"QPEProcessQCop()"); | 527 | QCopChannel::send(channel,"QPEProcessQCop()"); |
528 | 528 | ||
529 | return TRUE; | 529 | return TRUE; |
530 | } | 530 | } |
531 | 531 | ||
532 | #ifdef QT_NO_QWS_MULTIPROCESS | 532 | #ifdef QT_NO_QWS_MULTIPROCESS |
533 | QMessageBox::warning( 0, tr("Error"), tr("<qt>Could not find the application %1</qt>").arg(c), | 533 | QMessageBox::warning( 0, tr("Error"), tr("<qt>Could not find the application %1</qt>").arg(c), |
534 | tr("OK"), 0, 0, 0, 1 ); | 534 | tr("OK"), 0, 0, 0, 1 ); |
535 | #else | 535 | #else |