author | sandman <sandman> | 2002-11-24 18:21:41 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-11-24 18:21:41 (UTC) |
commit | 89bf0723eefc1e66a104fe8135f1a5389f021442 (patch) (side-by-side diff) | |
tree | a7db1ba8fa34d8226fe9baa9e7c488c86ad95445 /library/global.cpp | |
parent | ee62e73ddc29a5015c4a3e569be90dbfce4652c6 (diff) | |
download | opie-89bf0723eefc1e66a104fe8135f1a5389f021442.zip opie-89bf0723eefc1e66a104fe8135f1a5389f021442.tar.gz opie-89bf0723eefc1e66a104fe8135f1a5389f021442.tar.bz2 |
- LD_PRELOADing of libpreload.so in case the user selected [x] Force style
settings in appearance
- Some code to NOT style some applications, based on the binary name (also
selectable in appearance)
-rw-r--r-- | library/global.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/library/global.cpp b/library/global.cpp index 9b3c51e..42c2729 100644 --- a/library/global.cpp +++ b/library/global.cpp @@ -591,41 +591,57 @@ void Global::invoke(const QString &c) #if !defined(QT_NO_COP) // an attempt to show a wait... // more logic should be used, but this will be fine for the moment... QCopEnvelope ( "QPE/System", "busy()" ); #endif #ifdef HAVE_QUICKEXEC QString libexe = qpeDir()+"/binlib/lib"+args[0] + ".so"; qDebug("libfile = %s", libexe.latin1() ); if ( QFile::exists( libexe ) ) { qDebug("calling quickexec %s", libexe.latin1() ); quickexecv( libexe.utf8().data(), (const char **)args ); } else #endif { + char *oldpre = ::getenv ( "LD_PRELOAD" ); + + extern bool opie_block_style; + + QString newpre = QPEApplication::qpeDir ( ) + "/lib/libpreload.so"; + if ( opie_block_style && QFile::exists ( newpre )) { + if ( oldpre && oldpre [0] ) + newpre = newpre + ":" + oldpre; + ::setenv ( "LD_PRELOAD", newpre. latin1( ), 1 ); + qDebug ( "\nPRELOADING\n" ); + } + if ( !::vfork() ) { for ( int fd = 3; fd < 100; fd++ ) ::close( fd ); ::setpgid( ::getpid(), ::getppid() ); // Try bindir first, so that foo/bar works too ::execv( qpeDir()+"/bin/"+args[0], (char * const *)args ); ::execvp( args[0], (char * const *)args ); _exit( -1 ); } + if ( oldpre ) + ::setenv ( "LD_PRELOAD", oldpre, 1 ); + else + ::unsetenv ( "LD_PRELOAD" ); } StartingAppList::add( list[0] ); #endif //QT_NO_QWS_MULTIPROCESS } /*! Executes the application identfied by \a c, passing \a document if it isn't null. Note that a better approach might be to send a QCop message to the application's QPE/Application/\e{appname} channel. */ void Global::execute( const QString &c, const QString& document ) { if ( qApp->type() != QApplication::GuiServer ) { |