-rw-r--r-- | library/global.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/library/global.cpp b/library/global.cpp index 7bdd0b1..1895006 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -531,25 +531,27 @@ void Global::terminate( const AppLnk* app ) | |||
531 | */ | 531 | */ |
532 | void Global::invoke(const QString &c) | 532 | void Global::invoke(const QString &c) |
533 | { | 533 | { |
534 | // Convert the command line in to a list of arguments | 534 | // Convert the command line in to a list of arguments |
535 | QStringList list = QStringList::split(QRegExp(" *"),c); | 535 | QStringList list = QStringList::split(QRegExp(" *"),c); |
536 | 536 | ||
537 | #if !defined(QT_NO_COP) | 537 | #if !defined(QT_NO_COP) |
538 | QString ap=list[0]; | 538 | QString ap=list[0]; |
539 | // see if the application is already running | 539 | // see if the application is already running |
540 | // XXX should lock file /tmp/qcop-msg-ap | 540 | // XXX should lock file /tmp/qcop-msg-ap |
541 | if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { | 541 | if ( QCopChannel::isRegistered( ("QPE/Application/" + ap).latin1() ) ) { |
542 | // If the channel is already register, the app is already running, so show it. | 542 | // If the channel is already register, the app is already running, so show it. |
543 | { QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); } | 543 | { |
544 | QCopEnvelope env( ("QPE/Application/" + ap).latin1(), "raise()" ); | ||
545 | } | ||
544 | 546 | ||
545 | //QCopEnvelope e("QPE/System", "notBusy(QString)" ); | 547 | //QCopEnvelope e("QPE/System", "notBusy(QString)" ); |
546 | //e << ap; | 548 | //e << ap; |
547 | return; | 549 | return; |
548 | } | 550 | } |
549 | // XXX should unlock file /tmp/qcop-msg-ap | 551 | // XXX should unlock file /tmp/qcop-msg-ap |
550 | //see if it is being started | 552 | //see if it is being started |
551 | if ( StartingAppList::isStarting( ap ) ) { | 553 | if ( StartingAppList::isStarting( ap ) ) { |
552 | // FIXME take it out for now, since it leads to a much to short showing of wait if | 554 | // FIXME take it out for now, since it leads to a much to short showing of wait if |
553 | // some entry is clicked. | 555 | // some entry is clicked. |
554 | // Real cause is that ::execute is called twice for document tab. But it would need some larger changes | 556 | // Real cause is that ::execute is called twice for document tab. But it would need some larger changes |
555 | // to fix that, and with future syncs with qtopia 1.6 it will change anyway big time since somebody there | 557 | // to fix that, and with future syncs with qtopia 1.6 it will change anyway big time since somebody there |
@@ -564,24 +566,25 @@ void Global::invoke(const QString &c) | |||
564 | #ifdef QT_NO_QWS_MULTIPROCESS | 566 | #ifdef QT_NO_QWS_MULTIPROCESS |
565 | QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); | 567 | QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); |
566 | #else | 568 | #else |
567 | 569 | ||
568 | QStrList slist; | 570 | QStrList slist; |
569 | unsigned int j; | 571 | unsigned int j; |
570 | for ( j = 0; j < list.count(); j++ ) | 572 | for ( j = 0; j < list.count(); j++ ) |
571 | slist.append( list[j].utf8() ); | 573 | slist.append( list[j].utf8() ); |
572 | 574 | ||
573 | const char **args = new const char *[slist.count() + 1]; | 575 | const char **args = new const char *[slist.count() + 1]; |
574 | for ( j = 0; j < slist.count(); j++ ) | 576 | for ( j = 0; j < slist.count(); j++ ) |
575 | args[j] = slist.at(j); | 577 | args[j] = slist.at(j); |
578 | |||
576 | args[j] = NULL; | 579 | args[j] = NULL; |
577 | 580 | ||
578 | #if !defined(QT_NO_COP) | 581 | #if !defined(QT_NO_COP) |
579 | // an attempt to show a wait... | 582 | // an attempt to show a wait... |
580 | // more logic should be used, but this will be fine for the moment... | 583 | // more logic should be used, but this will be fine for the moment... |
581 | QCopEnvelope ( "QPE/System", "busy()" ); | 584 | QCopEnvelope ( "QPE/System", "busy()" ); |
582 | #endif | 585 | #endif |
583 | 586 | ||
584 | #ifdef HAVE_QUICKEXEC | 587 | #ifdef HAVE_QUICKEXEC |
585 | #ifdef Q_OS_MACX | 588 | #ifdef Q_OS_MACX |
586 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".dylib"; | 589 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".dylib"; |
587 | #else | 590 | #else |
@@ -638,24 +641,25 @@ void Global::invoke(const QString &c) | |||
638 | continue; | 641 | continue; |
639 | 642 | ||
640 | break; // success | 643 | break; // success |
641 | } | 644 | } |
642 | ::close ( pfd [0] ); | 645 | ::close ( pfd [0] ); |
643 | } | 646 | } |
644 | } | 647 | } |
645 | if ( success ) | 648 | if ( success ) |
646 | StartingAppList::add( list[0] ); | 649 | StartingAppList::add( list[0] ); |
647 | else | 650 | else |
648 | QMessageBox::warning( 0, "Error", "Could not start the application " + c, "Ok", 0, 0, 0, 1 ); | 651 | QMessageBox::warning( 0, "Error", "Could not start the application " + c, "Ok", 0, 0, 0, 1 ); |
649 | } | 652 | } |
653 | delete [] args; | ||
650 | #endif //QT_NO_QWS_MULTIPROCESS | 654 | #endif //QT_NO_QWS_MULTIPROCESS |
651 | } | 655 | } |
652 | 656 | ||
653 | 657 | ||
654 | /*! | 658 | /*! |
655 | Executes the application identfied by \a c, passing \a | 659 | Executes the application identfied by \a c, passing \a |
656 | document if it isn't null. | 660 | document if it isn't null. |
657 | 661 | ||
658 | Note that a better approach might be to send a QCop message to the | 662 | Note that a better approach might be to send a QCop message to the |
659 | application's QPE/Application/\e{appname} channel. | 663 | application's QPE/Application/\e{appname} channel. |
660 | */ | 664 | */ |
661 | void Global::execute( const QString &c, const QString& document ) | 665 | void Global::execute( const QString &c, const QString& document ) |