summaryrefslogtreecommitdiff
path: root/library/global.cpp
Side-by-side diff
Diffstat (limited to 'library/global.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/global.cpp2
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
@@ -460,97 +460,97 @@ void Global::invoke(const QString &c)
return;
}
// XXX should unlock file /tmp/qcop-msg-ap
//see if it is being started
if ( StartingAppList::isStarting( ap ) ) {
QCopEnvelope e("QPE/System", "notBusy(QString)" );
e << ap;
return;
}
#endif
#ifdef QT_NO_QWS_MULTIPROCESS
QMessageBox::warning( 0, "Error", "Could not find the application " + c, "Ok", 0, 0, 0, 1 );
#else
QStrList slist;
unsigned int j;
for ( j = 0; j < list.count(); j++ )
slist.append( list[j].utf8() );
const char **args = new (const char *)[slist.count() + 1];
for ( j = 0; j < slist.count(); j++ )
args[j] = slist.at(j);
args[j] = NULL;
#if defined(Q_WS_QWS) && !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
{
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 );
+ _exit( -1 );
}
}
StartingAppList::add( list[0] );
#endif //QT_NO_QWS_MULTIPROCESS
}
/*!
Executes application identfied by \a c, passing \a document.
Note that you might be better off sending a QCop message to
the application's QPE/Application/<i>appname</i> channel.
*/
void Global::execute( const QString &c, const QString& document )
{
if ( qApp->type() != QApplication::GuiServer ) {
// ask the server to do the work
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
if ( document.isNull() ) {
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << c;
} else {
QCopEnvelope e( "QPE/System", "execute(QString,QString)" );
e << c << document;
}
#endif
return;
}
// Attempt to execute the app using a builtin class for the app first
// else try and find it in the bin directory
if (builtin) {
for (int i = 0; builtin[i].file; i++) {
if ( builtin[i].file == c ) {
if ( running[i] ) {
if ( !document.isNull() && builtin[i].documentary )
setDocument(running[i], document);
running[i]->raise();
running[i]->show();
running[i]->setActiveWindow();
} else {
running[i] = builtin[i].func( builtin[i].maximized );
}
QCopEnvelope e("QPE/System", "notBusy(QString)" );
e << c; // that was quick ;-)
return;
}
}
}