summaryrefslogtreecommitdiff
path: root/core/launcher/applauncher.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/applauncher.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/applauncher.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index 0db99dd..f161e98 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -18,25 +18,25 @@
**
**********************************************************************/
#ifndef QTOPIA_INTERNAL_PRELOADACCESS
#define QTOPIA_INTERNAL_PRELOADACCESS
#endif
#ifndef QTOPIA_INTERNAL_FILEOPERATIONS
#define QTOPIA_INTERNAL_FILEOPERATIONS
#endif
#ifndef QTOPIA_PROGRAM_MONITOR
#define QTOPIA_PROGRAM_MONITOR
#endif
-#include <qtopia/global.h>
+#include <opie2/oglobal.h>
#ifndef Q_OS_WIN32
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/file.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <errno.h>
#else
#include <process.h>
#include <windows.h>
@@ -52,25 +52,24 @@
#include <qmessagebox.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qtopia/qcopenvelope_qws.h>
#include <qtopia/applnk.h>
#include <qtopia/qpeapplication.h>
#include <qtopia/config.h>
#include <qtopia/global.h>
#include "applauncher.h"
#include "documentlist.h"
-#include "launcherglobal.h"
const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
//---------------------------------------------------------------------------
static AppLauncher* appLauncherPtr;
const int appStopEventID = 1290;
class AppStoppedEvent : public QCustomEvent
{
public:
@@ -395,25 +394,25 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
case SIGTRAP: sig = "SIGTRAP"; break;
default: sig = QString("Unkown %1").arg(exitStatus);
}
if ( preloadDisabled )
sig += tr("<qt><p>Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.</qt>");
QString str = tr("<qt><b>%1</b> was terminated due to signal code %2</qt>").arg( app->name() ).arg( sig );
QMessageBox::information(0, tr("Application terminated"), str );
} else {
if ( exitStatus == 255 ) { //could not find app (because global returns -1)
QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) );
} else {
- QFileInfo fi(Opie::Global::tempDir() + "qcop-msg-" + appName);
+ QFileInfo fi(OGlobal::tempDirPath() + "qcop-msg-" + appName);
if ( fi.exists() && fi.size() ) {
emit terminated(sigPid, appName);
qWarning("Re executing obmitted for %s", appName.latin1() );
// execute( appName, QString::null );
return;
}
}
}
#endif
emit terminated(sigPid, appName);
@@ -437,26 +436,26 @@ bool AppLauncher::isRunning(const QString &app)
return FALSE;
}
#endif
return TRUE;
}
}
return FALSE;
}
bool AppLauncher::executeBuiltin(const QString &c, const QString &document)
{
- Global::Command* builtin = Opie::Global::builtinCommands();
- QGuardedPtr<QWidget> *running = Opie::Global::builtinRunning();
+ Global::Command* builtin = OGlobal::builtinCommands();
+ QGuardedPtr<QWidget> *running = OGlobal::builtinRunning();
// Attempt to execute the app using a builtin class for the app
if (builtin) {
for (int i = 0; builtin[i].file; i++) {
if ( builtin[i].file == c ) {
if ( running[i] ) {
if ( !document.isNull() && builtin[i].documentary )
Global::setDocument(running[i], document);
running[i]->raise();
running[i]->show();
running[i]->setActiveWindow();
} else {
@@ -488,25 +487,25 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais
qWarning("AppLauncher::execute");
// Convert the command line in to a list of arguments
QStringList list = QStringList::split(QRegExp(" *"),c);
if ( !docParam.isEmpty() )
list.append( docParam );
QString appName = list[0];
if ( isRunning(appName) ) {
QCString channel = "QPE/Application/";
channel += appName.latin1();
// Need to lock it to avoid race conditions with QPEApplication::processQCopFile
- QFile f(Opie::Global::tempDir() + "qcop-msg-" + appName);
+ QFile f(OGlobal::tempDirPath() + "qcop-msg-" + appName);
if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) {
#ifndef Q_OS_WIN32
flock(f.handle(), LOCK_EX);
#endif
QDataStream ds(&f);
QByteArray b;
QDataStream bstream(b, IO_WriteOnly);
if ( !f.size() ) {
ds << channel << QCString("raise()") << b;
if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) {
int id = startTimer(RAISE_TIMEOUT_MS);