From 89bf0723eefc1e66a104fe8135f1a5389f021442 Mon Sep 17 00:00:00 2001 From: sandman Date: Sun, 24 Nov 2002 18:21:41 +0000 Subject: - 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) --- (limited to 'library/global.cpp') diff --git a/library/global.cpp b/library/global.cpp index 9b3c51e..42c2729 100644 --- a/library/global.cpp +++ b/library/global.cpp @@ -604,6 +604,18 @@ void Global::invoke(const QString &c) } 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 ); @@ -613,6 +625,10 @@ void Global::invoke(const QString &c) ::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 -- cgit v0.9.0.2