summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/global.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/library/global.cpp b/library/global.cpp
index 42c2729..2162e02 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -577,68 +577,66 @@ void Global::invoke(const QString &c)
577 577
578#ifdef QT_NO_QWS_MULTIPROCESS 578#ifdef QT_NO_QWS_MULTIPROCESS
579 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 ); 579 QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 );
580#else 580#else
581 581
582 QStrList slist; 582 QStrList slist;
583 unsigned int j; 583 unsigned int j;
584 for ( j = 0; j < list.count(); j++ ) 584 for ( j = 0; j < list.count(); j++ )
585 slist.append( list[j].utf8() ); 585 slist.append( list[j].utf8() );
586 586
587 const char **args = new (const char *)[slist.count() + 1]; 587 const char **args = new (const char *)[slist.count() + 1];
588 for ( j = 0; j < slist.count(); j++ ) 588 for ( j = 0; j < slist.count(); j++ )
589 args[j] = slist.at(j); 589 args[j] = slist.at(j);
590 args[j] = NULL; 590 args[j] = NULL;
591 591
592#if !defined(QT_NO_COP) 592#if !defined(QT_NO_COP)
593 // an attempt to show a wait... 593 // an attempt to show a wait...
594 // more logic should be used, but this will be fine for the moment... 594 // more logic should be used, but this will be fine for the moment...
595 QCopEnvelope ( "QPE/System", "busy()" ); 595 QCopEnvelope ( "QPE/System", "busy()" );
596#endif 596#endif
597 597
598#ifdef HAVE_QUICKEXEC 598#ifdef HAVE_QUICKEXEC
599 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; 599 QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so";
600 qDebug("libfile = %s", libexe.latin1() ); 600 qDebug("libfile = %s", libexe.latin1() );
601 if ( QFile::exists( libexe ) ) { 601 if ( QFile::exists( libexe ) ) {
602 qDebug("calling quickexec %s", libexe.latin1() ); 602 qDebug("calling quickexec %s", libexe.latin1() );
603 quickexecv( libexe.utf8().data(), (const char **)args ); 603 quickexecv( libexe.utf8().data(), (const char **)args );
604 } else 604 } else
605#endif 605#endif
606 { 606 {
607 char *oldpre = ::getenv ( "LD_PRELOAD" ); 607 char *oldpre = ::getenv ( "LD_PRELOAD" );
608 608
609 extern bool opie_block_style;
610
611 QString newpre = QPEApplication::qpeDir ( ) + "/lib/libpreload.so"; 609 QString newpre = QPEApplication::qpeDir ( ) + "/lib/libpreload.so";
612 if ( opie_block_style && QFile::exists ( newpre )) { 610 if ( QFile::exists ( newpre )) {
613 if ( oldpre && oldpre [0] ) 611 if ( oldpre && oldpre [0] )
614 newpre = newpre + ":" + oldpre; 612 newpre = newpre + ":" + oldpre;
615 ::setenv ( "LD_PRELOAD", newpre. latin1( ), 1 ); 613 ::setenv ( "LD_PRELOAD", newpre. latin1( ), 1 );
616 qDebug ( "\nPRELOADING\n" ); 614 qDebug ( "\nPRELOADING\n" );
617 } 615 }
618 616
619 if ( !::vfork() ) { 617 if ( !::vfork() ) {
620 for ( int fd = 3; fd < 100; fd++ ) 618 for ( int fd = 3; fd < 100; fd++ )
621 ::close( fd ); 619 ::close( fd );
622 ::setpgid( ::getpid(), ::getppid() ); 620 ::setpgid( ::getpid(), ::getppid() );
623 // Try bindir first, so that foo/bar works too 621 // Try bindir first, so that foo/bar works too
624 ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); 622 ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args );
625 ::execvp( args[0], (char * const *)args ); 623 ::execvp( args[0], (char * const *)args );
626 _exit( -1 ); 624 _exit( -1 );
627 } 625 }
628 if ( oldpre ) 626 if ( oldpre )
629 ::setenv ( "LD_PRELOAD", oldpre, 1 ); 627 ::setenv ( "LD_PRELOAD", oldpre, 1 );
630 else 628 else
631 ::unsetenv ( "LD_PRELOAD" ); 629 ::unsetenv ( "LD_PRELOAD" );
632 } 630 }
633 StartingAppList::add( list[0] ); 631 StartingAppList::add( list[0] );
634#endif //QT_NO_QWS_MULTIPROCESS 632#endif //QT_NO_QWS_MULTIPROCESS
635} 633}
636 634
637 635
638/*! 636/*!
639 Executes the application identfied by \a c, passing \a 637 Executes the application identfied by \a c, passing \a
640 document if it isn't null. 638 document if it isn't null.
641 639
642 Note that a better approach might be to send a QCop message to the 640 Note that a better approach might be to send a QCop message to the
643 application's QPE/Application/\e{appname} channel. 641 application's QPE/Application/\e{appname} channel.
644*/ 642*/