author | kergoth <kergoth> | 2002-01-31 18:35:48 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-31 18:35:48 (UTC) |
commit | 2802e5a2b474101a50bf95e707061ca5542876fd (patch) (unidiff) | |
tree | a1015514ef9e48df091903cccf0d3174e272f663 /library/global.cpp | |
parent | 48a922e687e82dc8ebe2bc3cb17dcaa8dcae62bd (diff) | |
download | opie-2802e5a2b474101a50bf95e707061ca5542876fd.zip opie-2802e5a2b474101a50bf95e707061ca5542876fd.tar.gz opie-2802e5a2b474101a50bf95e707061ca5542876fd.tar.bz2 |
*** empty log message ***
-rw-r--r-- | library/global.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/global.cpp b/library/global.cpp index e5fc2b3..fd7579a 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -476,65 +476,65 @@ void Global::invoke(const QString &c) | |||
476 | QStrList slist; | 476 | QStrList slist; |
477 | unsigned int j; | 477 | unsigned int j; |
478 | for ( j = 0; j < list.count(); j++ ) | 478 | for ( j = 0; j < list.count(); j++ ) |
479 | slist.append( list[j].utf8() ); | 479 | slist.append( list[j].utf8() ); |
480 | 480 | ||
481 | const char **args = new (const char *)[slist.count() + 1]; | 481 | const char **args = new (const char *)[slist.count() + 1]; |
482 | for ( j = 0; j < slist.count(); j++ ) | 482 | for ( j = 0; j < slist.count(); j++ ) |
483 | args[j] = slist.at(j); | 483 | args[j] = slist.at(j); |
484 | args[j] = NULL; | 484 | args[j] = NULL; |
485 | 485 | ||
486 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 486 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
487 | // an attempt to show a wait... | 487 | // an attempt to show a wait... |
488 | // more logic should be used, but this will be fine for the moment... | 488 | // more logic should be used, but this will be fine for the moment... |
489 | QCopEnvelope ( "QPE/System", "busy()" ); | 489 | QCopEnvelope ( "QPE/System", "busy()" ); |
490 | #endif | 490 | #endif |
491 | 491 | ||
492 | #ifdef HAVE_QUICKEXEC | 492 | #ifdef HAVE_QUICKEXEC |
493 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; | 493 | QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; |
494 | qDebug("libfile = %s", libexe.latin1() ); | 494 | qDebug("libfile = %s", libexe.latin1() ); |
495 | if ( QFile::exists( libexe ) ) { | 495 | if ( QFile::exists( libexe ) ) { |
496 | qDebug("calling quickexec %s", libexe.latin1() ); | 496 | qDebug("calling quickexec %s", libexe.latin1() ); |
497 | quickexecv( libexe.utf8().data(), (const char **)args ); | 497 | quickexecv( libexe.utf8().data(), (const char **)args ); |
498 | } else | 498 | } else |
499 | #endif | 499 | #endif |
500 | { | 500 | { |
501 | if ( !::vfork() ) { | 501 | if ( !::vfork() ) { |
502 | for ( int fd = 3; fd < 100; fd++ ) | 502 | for ( int fd = 3; fd < 100; fd++ ) |
503 | ::close( fd ); | 503 | ::close( fd ); |
504 | ::setpgid( ::getpid(), ::getppid() ); | 504 | ::setpgid( ::getpid(), ::getppid() ); |
505 | // Try bindir first, so that foo/bar works too | 505 | // Try bindir first, so that foo/bar works too |
506 | ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); | 506 | ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); |
507 | ::execvp( args[0], (char * const *)args ); | 507 | ::execvp( args[0], (char * const *)args ); |
508 | exit( -1 ); | 508 | _exit( -1 ); |
509 | } | 509 | } |
510 | } | 510 | } |
511 | StartingAppList::add( list[0] ); | 511 | StartingAppList::add( list[0] ); |
512 | #endif //QT_NO_QWS_MULTIPROCESS | 512 | #endif //QT_NO_QWS_MULTIPROCESS |
513 | } | 513 | } |
514 | 514 | ||
515 | /*! | 515 | /*! |
516 | Executes application identfied by \a c, passing \a document. | 516 | Executes application identfied by \a c, passing \a document. |
517 | 517 | ||
518 | Note that you might be better off sending a QCop message to | 518 | Note that you might be better off sending a QCop message to |
519 | the application's QPE/Application/<i>appname</i> channel. | 519 | the application's QPE/Application/<i>appname</i> channel. |
520 | */ | 520 | */ |
521 | void Global::execute( const QString &c, const QString& document ) | 521 | void Global::execute( const QString &c, const QString& document ) |
522 | { | 522 | { |
523 | if ( qApp->type() != QApplication::GuiServer ) { | 523 | if ( qApp->type() != QApplication::GuiServer ) { |
524 | // ask the server to do the work | 524 | // ask the server to do the work |
525 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 525 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
526 | if ( document.isNull() ) { | 526 | if ( document.isNull() ) { |
527 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 527 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
528 | e << c; | 528 | e << c; |
529 | } else { | 529 | } else { |
530 | QCopEnvelope e( "QPE/System", "execute(QString,QString)" ); | 530 | QCopEnvelope e( "QPE/System", "execute(QString,QString)" ); |
531 | e << c << document; | 531 | e << c << document; |
532 | } | 532 | } |
533 | #endif | 533 | #endif |
534 | return; | 534 | return; |
535 | } | 535 | } |
536 | 536 | ||
537 | // Attempt to execute the app using a builtin class for the app first | 537 | // Attempt to execute the app using a builtin class for the app first |
538 | // else try and find it in the bin directory | 538 | // else try and find it in the bin directory |
539 | if (builtin) { | 539 | if (builtin) { |
540 | for (int i = 0; builtin[i].file; i++) { | 540 | for (int i = 0; builtin[i].file; i++) { |