summaryrefslogtreecommitdiff
authoralwin <alwin>2004-02-21 13:24:51 (UTC)
committer alwin <alwin>2004-02-21 13:24:51 (UTC)
commit76b70b355d2c1c32c0f74e844e0654e39db2a175 (patch) (unidiff)
tree63b32f2e0e9cdcb38e5d23ccfc51b7989894297d
parent814c3c8957f25d1436ce0b63c4201bbd2f340e7f (diff)
downloadopie-76b70b355d2c1c32c0f74e844e0654e39db2a175.zip
opie-76b70b355d2c1c32c0f74e844e0654e39db2a175.tar.gz
opie-76b70b355d2c1c32c0f74e844e0654e39db2a175.tar.bz2
qcop-msg related stuff don't use tmpDirPath 'cause it isn't that good IMHO
first: content of $TEMP can change due login - so it may run into problems when searching for qcop-msg-* files second: TEMP will set by user. The user can set it to a wrong value so cop would fail. But we can mostly guarantee that /tmp will exists.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/applauncher.cpp4
-rw-r--r--core/launcher/main.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index f161e98..a8779a5 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -400,13 +400,13 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
400 QString str = tr("<qt><b>%1</b> was terminated due to signal code %2</qt>").arg( app->name() ).arg( sig ); 400 QString str = tr("<qt><b>%1</b> was terminated due to signal code %2</qt>").arg( app->name() ).arg( sig );
401 QMessageBox::information(0, tr("Application terminated"), str ); 401 QMessageBox::information(0, tr("Application terminated"), str );
402 } else { 402 } else {
403 if ( exitStatus == 255 ) { //could not find app (because global returns -1) 403 if ( exitStatus == 255 ) { //could not find app (because global returns -1)
404 QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) ); 404 QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) );
405 } else { 405 } else {
406 QFileInfo fi(OGlobal::tempDirPath() + "qcop-msg-" + appName); 406 QFileInfo fi(QString::fromLatin1("/tmp/qcop-msg-") + appName);
407 if ( fi.exists() && fi.size() ) { 407 if ( fi.exists() && fi.size() ) {
408 emit terminated(sigPid, appName); 408 emit terminated(sigPid, appName);
409 qWarning("Re executing obmitted for %s", appName.latin1() ); 409 qWarning("Re executing obmitted for %s", appName.latin1() );
410 // execute( appName, QString::null ); 410 // execute( appName, QString::null );
411 return; 411 return;
412 } 412 }
@@ -493,13 +493,13 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais
493 QString appName = list[0]; 493 QString appName = list[0];
494 if ( isRunning(appName) ) { 494 if ( isRunning(appName) ) {
495 QCString channel = "QPE/Application/"; 495 QCString channel = "QPE/Application/";
496 channel += appName.latin1(); 496 channel += appName.latin1();
497 497
498 // Need to lock it to avoid race conditions with QPEApplication::processQCopFile 498 // Need to lock it to avoid race conditions with QPEApplication::processQCopFile
499 QFile f(OGlobal::tempDirPath() + "qcop-msg-" + appName); 499 QFile f(QString::fromLatin1("/tmp/qcop-msg-") + appName);
500 if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) { 500 if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) {
501#ifndef Q_OS_WIN32 501#ifndef Q_OS_WIN32
502 flock(f.handle(), LOCK_EX); 502 flock(f.handle(), LOCK_EX);
503#endif 503#endif
504 504
505 QDataStream ds(&f); 505 QDataStream ds(&f);
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index bf06e75..9e53bb0 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -69,13 +69,13 @@
69 69
70using namespace Opie; 70using namespace Opie;
71 71
72 72
73static void cleanup() 73static void cleanup()
74{ 74{
75 QDir dir( OGlobal::tempDirPath(), "qcop-msg-*" ); 75 QDir dir( "/tmp", "qcop-msg-*" );
76 76
77 QStringList stale = dir.entryList(); 77 QStringList stale = dir.entryList();
78 QStringList::Iterator it; 78 QStringList::Iterator it;
79 for ( it = stale.begin(); it != stale.end(); ++it ) { 79 for ( it = stale.begin(); it != stale.end(); ++it ) {
80 dir.remove( *it ); 80 dir.remove( *it );
81 } 81 }