summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/applauncher.cpp83
-rw-r--r--core/launcher/documentlist.cpp46
-rw-r--r--core/launcher/firstuse.cpp44
-rw-r--r--core/launcher/inputmethods.cpp34
-rw-r--r--core/launcher/irserver.cpp16
-rw-r--r--core/launcher/launcher.cpp37
-rw-r--r--core/launcher/launcherview.cpp9
-rw-r--r--core/launcher/main.cpp42
-rw-r--r--core/launcher/packageslave.cpp26
-rw-r--r--core/launcher/qcopbridge.cpp23
-rw-r--r--core/launcher/qprocess.cpp14
-rw-r--r--core/launcher/qprocess_unix.cpp93
-rw-r--r--core/launcher/runningappbar.cpp24
-rw-r--r--core/launcher/screensaver.cpp2
-rw-r--r--core/launcher/server.cpp32
-rw-r--r--core/launcher/serverapp.cpp26
-rw-r--r--core/launcher/suspendmonitor.cpp2
-rw-r--r--core/launcher/systray.cpp18
-rw-r--r--core/launcher/taskbar.cpp7
-rw-r--r--core/launcher/transferserver.cpp107
20 files changed, 334 insertions, 351 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index 5a5517c..7000346 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -27,9 +27,24 @@
27#ifndef QTOPIA_PROGRAM_MONITOR 27#ifndef QTOPIA_PROGRAM_MONITOR
28#define QTOPIA_PROGRAM_MONITOR 28#define QTOPIA_PROGRAM_MONITOR
29#endif 29#endif
30
31#include "applauncher.h"
32#include "documentlist.h"
33
34/* OPIE */
35#include <opie2/odebug.h>
30#include <opie2/oglobal.h> 36#include <opie2/oglobal.h>
37#include <qtopia/qcopenvelope_qws.h>
38#include <qtopia/qpeapplication.h>
39using namespace Opie::Core;
31 40
32#ifndef Q_OS_WIN32 41/* QT */
42#include <qtimer.h>
43#include <qwindowsystem_qws.h>
44#include <qmessagebox.h>
45#include <qfileinfo.h>
46
47/* STD */
33#include <sys/stat.h> 48#include <sys/stat.h>
34#include <sys/wait.h> 49#include <sys/wait.h>
35#include <sys/file.h> 50#include <sys/file.h>
@@ -37,28 +52,10 @@
37#include <sys/time.h> 52#include <sys/time.h>
38#include <sys/resource.h> 53#include <sys/resource.h>
39#include <errno.h> 54#include <errno.h>
40#else
41#include <process.h>
42#include <windows.h>
43#include <winbase.h>
44#endif
45
46#include <signal.h> 55#include <signal.h>
47#include <sys/types.h> 56#include <sys/types.h>
48#include <stdlib.h> 57#include <stdlib.h>
49 58
50#include <qtimer.h>
51#include <qwindowsystem_qws.h>
52#include <qmessagebox.h>
53#include <qfileinfo.h>
54
55#include <qtopia/qcopenvelope_qws.h>
56#include <qtopia/qpeapplication.h>
57
58#include "applauncher.h"
59#include "documentlist.h"
60
61using namespace Opie::Core;
62const int AppLauncher::RAISE_TIMEOUT_MS = 5000; 59const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
63 60
64//--------------------------------------------------------------------------- 61//---------------------------------------------------------------------------
@@ -127,7 +124,7 @@ AppLauncher::~AppLauncher()
127 so that we can disable the busy indicators */ 124 so that we can disable the busy indicators */
128void AppLauncher::newQcopChannel(const QString& channelName) 125void AppLauncher::newQcopChannel(const QString& channelName)
129{ 126{
130// qDebug("channel %s added", channelName.data() ); 127// odebug << "channel " << channelName.data() << " added" << oendl;
131 QString prefix("QPE/Application/"); 128 QString prefix("QPE/Application/");
132 if (channelName.startsWith(prefix)) { 129 if (channelName.startsWith(prefix)) {
133 { 130 {
@@ -141,7 +138,7 @@ void AppLauncher::newQcopChannel(const QString& channelName)
141 e << appName; 138 e << appName;
142 } 139 }
143 } else if (channelName.startsWith("QPE/QuickLauncher-")) { 140 } else if (channelName.startsWith("QPE/QuickLauncher-")) {
144 qDebug("Registered %s", channelName.latin1()); 141 odebug << "Registered " << channelName << "" << oendl;
145 int pid = channelName.mid(18).toInt(); 142 int pid = channelName.mid(18).toInt();
146 if (pid == qlPid) 143 if (pid == qlPid)
147 qlReady = TRUE; 144 qlReady = TRUE;
@@ -180,7 +177,7 @@ void AppLauncher::received(const QCString& msg, const QByteArray& data)
180 177
181 if ( !executeBuiltin( appName, QString::null ) ) { 178 if ( !executeBuiltin( appName, QString::null ) ) {
182 if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) { 179 if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) {
183 //qDebug( "Raising: %s", appName.latin1() ); 180 //odebug << "Raising: " << appName << "" << oendl;
184 QCString channel = "QPE/Application/"; 181 QCString channel = "QPE/Application/";
185 channel += appName.latin1(); 182 channel += appName.latin1();
186 183
@@ -217,7 +214,7 @@ void AppLauncher::received(const QCString& msg, const QByteArray& data)
217 } else if ( msg == "appRaised(QString)" ) { 214 } else if ( msg == "appRaised(QString)" ) {
218 QString appName; 215 QString appName;
219 stream >> appName; 216 stream >> appName;
220 qDebug("Got a heartbeat from %s", appName.latin1()); 217 odebug << "Got a heartbeat from " << appName << "" << oendl;
221 QMap<QString,int>::Iterator it = waitingHeartbeat.find(appName); 218 QMap<QString,int>::Iterator it = waitingHeartbeat.find(appName);
222 if ( it != waitingHeartbeat.end() ) { 219 if ( it != waitingHeartbeat.end() ) {
223 killTimer( *it ); 220 killTimer( *it );
@@ -240,12 +237,12 @@ void AppLauncher::signalHandler(int)
240 int status; 237 int status;
241 pid_t pid = waitpid(-1, &status, WNOHANG); 238 pid_t pid = waitpid(-1, &status, WNOHANG);
242/* if (pid == 0 || &status == 0 ) { 239/* if (pid == 0 || &status == 0 ) {
243 qDebug("hmm, could not get return value from signal"); 240 odebug << "hmm, could not get return value from signal" << oendl;
244 } 241 }
245*/ 242*/
246 QApplication::postEvent(appLauncherPtr, new AppStoppedEvent(pid, status) ); 243 QApplication::postEvent(appLauncherPtr, new AppStoppedEvent(pid, status) );
247#else 244#else
248 qDebug("Unhandled signal see by AppLauncher::signalHandler(int)"); 245 odebug << "Unhandled signal see by AppLauncher::signalHandler(int)" << oendl;
249#endif 246#endif
250} 247}
251 248
@@ -273,7 +270,7 @@ void AppLauncher::timerEvent( QTimerEvent *e )
273 killTimer( id ); 270 killTimer( id );
274 waitingHeartbeat.remove( it ); 271 waitingHeartbeat.remove( it );
275 272
276 // qDebug("Checking in on %s", appKillerName.latin1()); 273 // odebug << "Checking in on " << appKillerName << "" << oendl;
277 274
278 // We store this incase the application responds while we're 275 // We store this incase the application responds while we're
279 // waiting for user input so we know not to delete ourselves. 276 // waiting for user input so we know not to delete ourselves.
@@ -284,7 +281,7 @@ void AppLauncher::timerEvent( QTimerEvent *e )
284 QMessageBox::No | QMessageBox::Default, 281 QMessageBox::No | QMessageBox::Default,
285 QMessageBox::NoButton); 282 QMessageBox::NoButton);
286 if (appKillerBox->exec() == QMessageBox::Yes) { 283 if (appKillerBox->exec() == QMessageBox::Yes) {
287 // qDebug("Killing the app!!! Bwuhahahaha!"); 284 // odebug << "Killing the app!!! Bwuhahahaha!" << oendl;
288 int pid = pidForName(appKillerName); 285 int pid = pidForName(appKillerName);
289 if ( pid > 0 ) 286 if ( pid > 0 )
290 kill( pid ); 287 kill( pid );
@@ -315,7 +312,7 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
315 QMap<int,QString>::Iterator it = runningApps.find( sigPid ); 312 QMap<int,QString>::Iterator it = runningApps.find( sigPid );
316 if ( it == runningApps.end() ) { 313 if ( it == runningApps.end() ) {
317 if ( sigPid == qlPid ) { 314 if ( sigPid == qlPid ) {
318 qDebug( "quicklauncher stopped" ); 315 odebug << "quicklauncher stopped" << oendl;
319 qlPid = 0; 316 qlPid = 0;
320 qlReady = FALSE; 317 qlReady = FALSE;
321 QFile::remove("/tmp/qcop-msg-quicklauncher" ); 318 QFile::remove("/tmp/qcop-msg-quicklauncher" );
@@ -323,9 +320,9 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
323 } 320 }
324/* 321/*
325 if ( sigPid == -1 ) 322 if ( sigPid == -1 )
326 qDebug("non-qtopia application exited (disregarded)"); 323 odebug << "non-qtopia application exited (disregarded)" << oendl;
327 else 324 else
328 qDebug("==== no pid matching %d in list, definite bug", sigPid); 325 odebug << "==== no pid matching " << sigPid << " in list, definite bug" << oendl;
329*/ 326*/
330 return; 327 return;
331 } 328 }
@@ -369,7 +366,7 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
369/* 366/*
370 // debug info 367 // debug info
371 for (it = runningApps.begin(); it != runningApps.end(); ++it) { 368 for (it = runningApps.begin(); it != runningApps.end(); ++it) {
372 qDebug("running according to internal list: %s, with pid %d", (*it).data(), it.key() ); 369 odebug << "running according to internal list: " << (*it).data() << ", with pid " << it.key() << "" << oendl;
373 } 370 }
374*/ 371*/
375 372
@@ -403,7 +400,7 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
403 QFileInfo fi(QString::fromLatin1("/tmp/qcop-msg-") + appName); 400 QFileInfo fi(QString::fromLatin1("/tmp/qcop-msg-") + appName);
404 if ( fi.exists() && fi.size() ) { 401 if ( fi.exists() && fi.size() ) {
405 emit terminated(sigPid, appName); 402 emit terminated(sigPid, appName);
406 qWarning("Re executing obmitted for %s", appName.latin1() ); 403 owarn << "Re executing obmitted for " << appName << "" << oendl;
407 // execute( appName, QString::null ); 404 // execute( appName, QString::null );
408 return; 405 return;
409 } 406 }
@@ -417,7 +414,7 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
417#else 414#else
418void AppLauncher::sigStopped(int sigPid, int sigStatus) 415void AppLauncher::sigStopped(int sigPid, int sigStatus)
419{ 416{
420 qDebug("Unhandled signal : AppLauncher::sigStopped(int sigPid, int sigStatus)"); 417 odebug << "Unhandled signal : AppLauncher::sigStopped(int sigPid, int sigStatus)" << oendl;
421} 418}
422#endif // Q_OS_WIN32 419#endif // Q_OS_WIN32
423 420
@@ -428,7 +425,7 @@ bool AppLauncher::isRunning(const QString &app)
428#ifdef Q_OS_UNIX 425#ifdef Q_OS_UNIX
429 pid_t t = ::__getpgid( it.key() ); 426 pid_t t = ::__getpgid( it.key() );
430 if ( t == -1 ) { 427 if ( t == -1 ) {
431 qDebug("appLauncher bug, %s believed running, but pid %d is not existing", app.data(), it.key() ); 428 odebug << "appLauncher bug, " << app.data() << " believed running, but pid " << it.key() << " is not existing" << oendl;
432 runningApps.remove( it.key() ); 429 runningApps.remove( it.key() );
433 return FALSE; 430 return FALSE;
434 } 431 }
@@ -481,7 +478,7 @@ bool AppLauncher::executeBuiltin(const QString &c, const QString &document)
481 478
482bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise) 479bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise)
483{ 480{
484 qWarning("AppLauncher::execute '%s' '%s'", (const char*) c, (const char*) docParam ); 481 owarn << "AppLauncher::execute '" << c << "' '" << docParam << "'" << oendl;
485 // Convert the command line in to a list of arguments 482 // Convert the command line in to a list of arguments
486 QStringList list = QStringList::split(QRegExp(" *"),c); 483 QStringList list = QStringList::split(QRegExp(" *"),c);
487 QStringList arglist = QStringList::split(QRegExp(" *"),docParam); 484 QStringList arglist = QStringList::split(QRegExp(" *"),docParam);
@@ -548,7 +545,7 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais
548#else 545#else
549 if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".so" ) ) { 546 if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".so" ) ) {
550#endif /* Q_OS_MACX */ 547#endif /* Q_OS_MACX */
551 qDebug( "Quick launching: %s", args[0] ); 548 odebug << "Quick launching: " << args[0] << "" << oendl;
552 if ( getuid() == 0 ) 549 if ( getuid() == 0 )
553 setpriority( PRIO_PROCESS, qlPid, 0 ); 550 setpriority( PRIO_PROCESS, qlPid, 0 );
554 QCString qlch("QPE/QuickLauncher-"); 551 QCString qlch("QPE/QuickLauncher-");
@@ -584,7 +581,7 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais
584 proc->addArgument(args[i]); 581 proc->addArgument(args[i]);
585 connect(proc, SIGNAL(processExited()), this, SLOT(processExited())); 582 connect(proc, SIGNAL(processExited()), this, SLOT(processExited()));
586 if (!proc->start()){ 583 if (!proc->start()){
587 qDebug("Unable to start application %s", args[0]); 584 odebug << "Unable to start application " << args[0] << "" << oendl;
588 }else{ 585 }else{
589 PROCESS_INFORMATION *procInfo = (PROCESS_INFORMATION *)proc->processIdentifier(); 586 PROCESS_INFORMATION *procInfo = (PROCESS_INFORMATION *)proc->processIdentifier();
590 if (procInfo){ 587 if (procInfo){
@@ -594,11 +591,11 @@ bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRais
594 emit launched(pid, QString(args[0])); 591 emit launched(pid, QString(args[0]));
595 QCopEnvelope e("QPE/System", "busy()"); 592 QCopEnvelope e("QPE/System", "busy()");
596 }else{ 593 }else{
597 qDebug("Unable to read process inforation #1 for %s", args[0]); 594 odebug << "Unable to read process inforation #1 for " << args[0] << "" << oendl;
598 } 595 }
599 } 596 }
600 }else{ 597 }else{
601 qDebug("Unable to create process for application %s", args[0]); 598 odebug << "Unable to create process for application " << args[0] << "" << oendl;
602 return FALSE; 599 return FALSE;
603 } 600 }
604#endif 601#endif
@@ -678,16 +675,16 @@ void AppLauncher::createQuickLauncher()
678void AppLauncher::processExited() 675void AppLauncher::processExited()
679{ 676{
680#ifdef Q_OS_WIN32 677#ifdef Q_OS_WIN32
681 qDebug("AppLauncher::processExited()"); 678 odebug << "AppLauncher::processExited()" << oendl;
682 bool found = FALSE; 679 bool found = FALSE;
683 QProcess *proc = (QProcess *) sender(); 680 QProcess *proc = (QProcess *) sender();
684 if (!proc){ 681 if (!proc){
685 qDebug("Interanl error NULL proc"); 682 odebug << "Interanl error NULL proc" << oendl;
686 return; 683 return;
687 } 684 }
688 685
689 QString appName = proc->arguments()[0]; 686 QString appName = proc->arguments()[0];
690 qDebug("Removing application %s", appName.latin1()); 687 odebug << "Removing application " << appName << "" << oendl;
691 runningAppsProc.remove(proc); 688 runningAppsProc.remove(proc);
692 689
693 QMap<QString,int>::Iterator hbit = waitingHeartbeat.find(appName); 690 QMap<QString,int>::Iterator hbit = waitingHeartbeat.find(appName);
@@ -714,7 +711,7 @@ void AppLauncher::processExited()
714 emit terminated(it.key(), it.data()); 711 emit terminated(it.key(), it.data());
715 runningApps.remove(it.key()); 712 runningApps.remove(it.key());
716 }else{ 713 }else{
717 qDebug("Internal error application %s not listed as running", appName.latin1()); 714 odebug << "Internal error application " << appName << " not listed as running" << oendl;
718 } 715 }
719 716
720#endif 717#endif
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 3e0a96c..92b8c25 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -21,8 +21,9 @@
21#include "serverinterface.h" 21#include "serverinterface.h"
22#include "mediadlg.h" 22#include "mediadlg.h"
23 23
24/* OPIE */
24#include <opie2/oglobal.h> 25#include <opie2/oglobal.h>
25 26#include <opie2/odebug.h>
26#include <qtopia/config.h> 27#include <qtopia/config.h>
27#include <qtopia/mimetype.h> 28#include <qtopia/mimetype.h>
28#include <qtopia/resource.h> 29#include <qtopia/resource.h>
@@ -33,7 +34,9 @@
33#ifdef Q_WS_QWS 34#ifdef Q_WS_QWS
34#include <qtopia/qcopenvelope_qws.h> 35#include <qtopia/qcopenvelope_qws.h>
35#endif 36#endif
37using namespace Opie::Core;
36 38
39/* QT */
37#include <qtimer.h> 40#include <qtimer.h>
38#include <qfileinfo.h> 41#include <qfileinfo.h>
39#include <qtextstream.h> 42#include <qtextstream.h>
@@ -47,7 +50,6 @@
47#include <qpixmap.h> 50#include <qpixmap.h>
48 51
49 52
50using namespace Opie::Core;
51AppLnkSet *DocumentList::appLnkSet = 0; 53AppLnkSet *DocumentList::appLnkSet = 0;
52 54
53static const int MAX_SEARCH_DEPTH = 10; 55static const int MAX_SEARCH_DEPTH = 10;
@@ -108,7 +110,7 @@ DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/,
108 Config cfg( "Launcher" ); 110 Config cfg( "Launcher" );
109 cfg.setGroup( "DocTab" ); 111 cfg.setGroup( "DocTab" );
110 d->scanDocs = cfg.readBoolEntry( "Enable", true ); 112 d->scanDocs = cfg.readBoolEntry( "Enable", true );
111 qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); 113 odebug << "DocumentList::DocumentList() : scanDocs = " << d->scanDocs << "" << oendl;
112 114
113 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); 115 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
114} 116}
@@ -141,7 +143,7 @@ void DocumentList::start()
141 143
142void DocumentList::pause() 144void DocumentList::pause()
143{ 145{
144 //qDebug("pause %i", d->tid); 146 //odebug << "pause " << d->tid << "" << oendl;
145 killTimer( d->tid ); 147 killTimer( d->tid );
146 d->tid = 0; 148 d->tid = 0;
147} 149}
@@ -151,7 +153,7 @@ void DocumentList::resume()
151{ 153{
152 if ( d->tid == 0 ) { 154 if ( d->tid == 0 ) {
153 d->tid = startTimer( 20 ); 155 d->tid = startTimer( 20 );
154 //qDebug("resumed %i", d->tid); 156 //odebug << "resumed " << d->tid << "" << oendl;
155 } 157 }
156} 158}
157 159
@@ -177,7 +179,7 @@ void DocumentList::resendWorker()
177 179
178void DocumentList::rescan() 180void DocumentList::rescan()
179{ 181{
180 //qDebug("rescan"); 182 //odebug << "rescan" << oendl;
181 pause(); 183 pause();
182 d->initialize(); 184 d->initialize();
183 resume(); 185 resume();
@@ -232,7 +234,7 @@ void DocumentList::reloadAppLnks()
232 bgPm = img.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() ); 234 bgPm = img.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() );
233 } 235 }
234 236
235 //qDebug("adding type %s", (*ittypes).latin1()); 237 //odebug << "adding type " << (*ittypes) << "" << oendl;
236 238
237 // ### our current launcher expects docs tab to be last 239 // ### our current launcher expects docs tab to be last
238 d->serverGui->typeAdded( *ittypes, name.isNull() ? (*ittypes) : name, pm, bgPm ); 240 d->serverGui->typeAdded( *ittypes, name.isNull() ? (*ittypes) : name, pm, bgPm );
@@ -241,7 +243,7 @@ void DocumentList::reloadAppLnks()
241 } 243 }
242 } 244 }
243 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) { 245 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) {
244 //qDebug("removing type %s", (*ittypes).latin1()); 246 //odebug << "removing type " << (*ittypes) << "" << oendl;
245 d->serverGui->typeRemoved(*ittypes); 247 d->serverGui->typeRemoved(*ittypes);
246 } 248 }
247 prevTypeList = types; 249 prevTypeList = types;
@@ -274,7 +276,7 @@ void DocumentList::reloadDocLnks()
274 276
275void DocumentList::linkChanged( QString arg ) 277void DocumentList::linkChanged( QString arg )
276{ 278{
277 //qDebug( "linkchanged( %s )", arg.latin1() ); 279 //odebug << "linkchanged( " << arg << " )" << oendl;
278 280
279 if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) { 281 if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) {
280 reloadAppLnks(); 282 reloadAppLnks();
@@ -287,20 +289,20 @@ void DocumentList::linkChanged( QString arg )
287 ++it; 289 ++it;
288 if ( ( doc->linkFileKnown() && doc->linkFile() == arg ) 290 if ( ( doc->linkFileKnown() && doc->linkFile() == arg )
289 || ( doc->fileKnown() && doc->file() == arg ) ) { 291 || ( doc->fileKnown() && doc->file() == arg ) ) {
290 //qDebug( "found old link" ); 292 //odebug << "found old link" << oendl;
291 DocLnk* dl = new DocLnk( arg ); 293 DocLnk* dl = new DocLnk( arg );
292 // add new one if it exists and matches the mimetype 294 // add new one if it exists and matches the mimetype
293 if ( d->store( dl ) ) { 295 if ( d->store( dl ) ) {
294 // Existing link has been changed, send old link ref and a ref 296 // Existing link has been changed, send old link ref and a ref
295 // to the new link 297 // to the new link
296 //qDebug( "change case" ); 298 //odebug << "change case" << oendl;
297 if ( d->serverGui ) 299 if ( d->serverGui )
298 d->serverGui->documentChanged( *doc, *dl ); 300 d->serverGui->documentChanged( *doc, *dl );
299 301
300 } else { 302 } else {
301 // Link has been removed or doesn't match the mimetypes any more 303 // Link has been removed or doesn't match the mimetypes any more
302 // so we aren't interested in it, so take it away from the list 304 // so we aren't interested in it, so take it away from the list
303 //qDebug( "removal case" ); 305 //odebug << "removal case" << oendl;
304 if ( d->serverGui ) 306 if ( d->serverGui )
305 d->serverGui->documentRemoved( *doc ); 307 d->serverGui->documentRemoved( *doc );
306 308
@@ -314,7 +316,7 @@ void DocumentList::linkChanged( QString arg )
314 DocLnk* dl = new DocLnk( arg ); 316 DocLnk* dl = new DocLnk( arg );
315 if ( d->store( dl ) ) { 317 if ( d->store( dl ) ) {
316 // Add if it's a link we are interested in 318 // Add if it's a link we are interested in
317 //qDebug( "add case" ); 319 //odebug << "add case" << oendl;
318 add( *dl ); 320 add( *dl );
319 } 321 }
320 322
@@ -378,12 +380,12 @@ void DocumentList::sendAllDocLinks()
378 contents += QString("Size = %1\n").arg( fi.size() ); // No tr 380 contents += QString("Size = %1\n").arg( fi.size() ); // No tr
379 } 381 }
380 382
381 //qDebug( "sending length %d", contents.length() ); 383 //odebug << "sending length " << contents.length() << "" << oendl;
382#ifndef QT_NO_COP 384#ifndef QT_NO_COP
383 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); 385 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" );
384 e << contents; 386 e << contents;
385#endif 387#endif
386 //qDebug( "================ \n\n%s\n\n===============", contents.latin1() ); 388 //odebug << "================ \n\n" << contents << "\n\n===============" << oendl;
387 389
388 d->needToSendAllDocLinks = false; 390 d->needToSendAllDocLinks = false;
389} 391}
@@ -536,7 +538,7 @@ void DocumentListPrivate::estimatedPercentScanned()
536 } 538 }
537 } 539 }
538 540
539 // qDebug( "overallProgress: %f", overallProgress ); 541 // odebug << "overallProgress: " << overallProgress << "" << oendl;
540 542
541 if ( serverGui ) 543 if ( serverGui )
542 serverGui->documentScanningProgress( (int)overallProgress ); 544 serverGui->documentScanningProgress( (int)overallProgress );
@@ -553,7 +555,7 @@ const QString DocumentListPrivate::nextFile()
553 return QString::null; 555 return QString::null;
554 } else { 556 } else {
555 QDir dir( docPaths[docPathsSearched] ); 557 QDir dir( docPaths[docPathsSearched] );
556 // qDebug("now using base path: %s", docPaths[docPathsSearched].latin1() ); 558 // odebug << "now using base path: " << docPaths[docPathsSearched] << "" << oendl;
557 docPathsSearched++; 559 docPathsSearched++;
558 if ( !dir.exists( ".Qtopia-ignore" ) ) { 560 if ( !dir.exists( ".Qtopia-ignore" ) ) {
559 listDirs[0] = new QDir( dir ); 561 listDirs[0] = new QDir( dir );
@@ -587,7 +589,7 @@ const QString DocumentListPrivate::nextFile()
587 if ( bn != "CVS" && bn != "Qtopia" && bn != "QtPalmtop" ) { 589 if ( bn != "CVS" && bn != "Qtopia" && bn != "QtPalmtop" ) {
588 // go down a depth 590 // go down a depth
589 QDir dir( fi->filePath() ); 591 QDir dir( fi->filePath() );
590 // qDebug("now going in to path: %s", bn.latin1() ); 592 // odebug << "now going in to path: " << bn << "" << oendl;
591 if ( !dir.exists( ".Qtopia-ignore" ) ) { 593 if ( !dir.exists( ".Qtopia-ignore" ) ) {
592 if ( searchDepth < MAX_SEARCH_DEPTH - 1) { 594 if ( searchDepth < MAX_SEARCH_DEPTH - 1) {
593 searchDepth++; 595 searchDepth++;
@@ -628,7 +630,7 @@ bool DocumentListPrivate::store( DocLnk* dl )
628const DocLnk *DocumentListPrivate::iterate() 630const DocLnk *DocumentListPrivate::iterate()
629{ 631{
630 if ( state == Find ) { 632 if ( state == Find ) {
631 //qDebug("state Find"); 633 //odebug << "state Find" << oendl;
632 QString file = nextFile(); 634 QString file = nextFile();
633 while ( !file.isNull() ) { 635 while ( !file.isNull() ) {
634 if ( file.right(8) == ".desktop" ) { // No tr 636 if ( file.right(8) == ".desktop" ) { // No tr
@@ -650,7 +652,7 @@ const DocLnk *DocumentListPrivate::iterate()
650 static int iterationCount; 652 static int iterationCount;
651 653
652 if ( state == RemoveKnownFiles ) { 654 if ( state == RemoveKnownFiles ) {
653 //qDebug("state RemoveKnownFiles"); 655 //odebug << "state RemoveKnownFiles" << oendl;
654 const QList<DocLnk> &list = dls.children(); 656 const QList<DocLnk> &list = dls.children();
655 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) { 657 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) {
656 reference.remove( (*it)->file() ); 658 reference.remove( (*it)->file() );
@@ -664,7 +666,7 @@ const DocLnk *DocumentListPrivate::iterate()
664 } 666 }
665 667
666 if ( state == MakeUnknownFiles ) { 668 if ( state == MakeUnknownFiles ) {
667 //qDebug("state MakeUnknownFiles"); 669 //odebug << "state MakeUnknownFiles" << oendl;
668 for (void* c; (c=dit->current()); ++(*dit) ) { 670 for (void* c; (c=dit->current()); ++(*dit) ) {
669 if ( c == MAGIC_NUMBER ) { 671 if ( c == MAGIC_NUMBER ) {
670 DocLnk* dl = new DocLnk; 672 DocLnk* dl = new DocLnk;
@@ -687,7 +689,7 @@ const DocLnk *DocumentListPrivate::iterate()
687 state = Done; 689 state = Done;
688 } 690 }
689 691
690 //qDebug("state Done"); 692 //odebug << "state Done" << oendl;
691 return NULL; 693 return NULL;
692} 694}
693 695
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp
index 4316648..e9e2d83 100644
--- a/core/launcher/firstuse.cpp
+++ b/core/launcher/firstuse.cpp
@@ -29,16 +29,18 @@
29#include "inputmethods.h" 29#include "inputmethods.h"
30#include "applauncher.h" 30#include "applauncher.h"
31#include "serverapp.h" 31#include "serverapp.h"
32//#include <qtopia/custom.h>
33
34#include "calibrate.h" 32#include "calibrate.h"
35#include "documentlist.h" 33#include "documentlist.h"
36 34
35/* OPIE */
36#include <opie2/odebug.h>
37#include <qtopia/resource.h> 37#include <qtopia/resource.h>
38#include <qtopia/qcopenvelope_qws.h> 38#include <qtopia/qcopenvelope_qws.h>
39#include <qtopia/config.h> 39#include <qtopia/config.h>
40#include <qtopia/fontmanager.h> 40#include <qtopia/fontmanager.h>
41using namespace Opie::Core;
41 42
43/* QT */
42#include <qfile.h> 44#include <qfile.h>
43#include <qpainter.h> 45#include <qpainter.h>
44#include <qsimplerichtext.h> 46#include <qsimplerichtext.h>
@@ -51,7 +53,7 @@
51#include <qgfx_qws.h> 53#include <qgfx_qws.h>
52#endif 54#endif
53 55
54 56/* STD */
55#include <stdlib.h> 57#include <stdlib.h>
56#include <sys/types.h> 58#include <sys/types.h>
57#if defined(Q_OS_LINUX) || defined(_OS_LINUX_) 59#if defined(Q_OS_LINUX) || defined(_OS_LINUX_)
@@ -155,7 +157,7 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
155 taskBar->hide(); 157 taskBar->hide();
156 158
157#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 159#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
158 qDebug("Setting up QCop to QPE/System"); 160 odebug << "Setting up QCop to QPE/System" << oendl;
159 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); 161 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
160 connect(sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), 162 connect(sysChannel, SIGNAL(received(const QCString&,const QByteArray&)),
161 this, SLOT(message(const QCString&,const QByteArray&)) ); 163 this, SLOT(message(const QCString&,const QByteArray&)) );
@@ -223,18 +225,18 @@ void FirstUse::nextDialog()
223 int prevApp = currApp; 225 int prevApp = currApp;
224 do { 226 do {
225 currApp++; 227 currApp++;
226 qDebug( "currApp = %d", currApp ); 228 odebug << "currApp = " << currApp << "" << oendl;
227 if ( settingsTable[currApp].app == 0 ) { 229 if ( settingsTable[currApp].app == 0 ) {
228 if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { 230 if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) {
229 // The last application is still running. 231 // The last application is still running.
230 // Tell it to stop, and when its done we'll come back 232 // Tell it to stop, and when its done we'll come back
231 // to nextDialog and exit. 233 // to nextDialog and exit.
232 qDebug( "Waiting for %s to exit", settingsTable[prevApp].app ); 234 odebug << "Waiting for " << settingsTable[prevApp].app << " to exit" << oendl;
233 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, 235 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app,
234 settingsTable[prevApp].stop ); 236 settingsTable[prevApp].stop );
235 currApp = prevApp; 237 currApp = prevApp;
236 } else { 238 } else {
237 qDebug( "Done!" ); 239 odebug << "Done!" << oendl;
238 Config config( "qpe" ); 240 Config config( "qpe" );
239 config.setGroup( "Startup" ); 241 config.setGroup( "Startup" );
240 config.writeEntry( "FirstUse", FALSE ); 242 config.writeEntry( "FirstUse", FALSE );
@@ -258,12 +260,12 @@ void FirstUse::nextDialog()
258 } while ( !settingsTable[currApp].enabled ); 260 } while ( !settingsTable[currApp].enabled );
259 261
260 if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) { 262 if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) {
261 qDebug( "Shutdown: %s", settingsTable[prevApp].app ); 263 odebug << "Shutdown: " << settingsTable[prevApp].app << "" << oendl;
262 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, 264 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app,
263 settingsTable[prevApp].stop ); 265 settingsTable[prevApp].stop );
264 waitForExit = prevApp; 266 waitForExit = prevApp;
265 } else { 267 } else {
266 qDebug( "Startup: %s", settingsTable[currApp].app ); 268 odebug << "Startup: " << settingsTable[currApp].app << "" << oendl;
267 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app, 269 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app,
268 settingsTable[currApp].start ); 270 settingsTable[currApp].start );
269 waitingForLaunch = TRUE; 271 waitingForLaunch = TRUE;
@@ -285,7 +287,7 @@ void FirstUse::previousDialog()
285 } while ( !settingsTable[currApp].enabled ); 287 } while ( !settingsTable[currApp].enabled );
286 288
287 if ( prevApp >= 0 ) { 289 if ( prevApp >= 0 ) {
288 qDebug( "Shutdown: %s", settingsTable[prevApp].app ); 290 odebug << "Shutdown: " << settingsTable[prevApp].app << "" << oendl;
289 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app, 291 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app,
290 settingsTable[prevApp].stop ); 292 settingsTable[prevApp].stop );
291/* 293/*
@@ -294,7 +296,7 @@ void FirstUse::previousDialog()
294*/ 296*/
295 waitForExit = prevApp; 297 waitForExit = prevApp;
296 } else { 298 } else {
297 qDebug( "Startup: %s", settingsTable[currApp].app ); 299 odebug << "Startup: " << settingsTable[currApp].app << "" << oendl;
298 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app, 300 QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app,
299 settingsTable[currApp].start ); 301 settingsTable[currApp].start );
300 waitingForLaunch = TRUE; 302 waitingForLaunch = TRUE;
@@ -318,9 +320,9 @@ void FirstUse::message(const QCString &msg, const QByteArray &data)
318 320
319void FirstUse::terminated( int, const QString &app ) 321void FirstUse::terminated( int, const QString &app )
320{ 322{
321 qDebug( "--- terminated: %s", app.latin1() ); 323 odebug << "--- terminated: " << app << "" << oendl;
322 if ( waitForExit != -1 && settingsTable[waitForExit].app == app ) { 324 if ( waitForExit != -1 && settingsTable[waitForExit].app == app ) {
323 qDebug( "Startup: %s", settingsTable[currApp].app ); 325 odebug << "Startup: " << settingsTable[currApp].app << "" << oendl;
324 if ( settingsTable[waitForExit].app == "language" ) { // No tr 326 if ( settingsTable[waitForExit].app == "language" ) { // No tr
325 Config config("locale"); 327 Config config("locale");
326 config.setGroup( "Language"); 328 config.setGroup( "Language");
@@ -347,12 +349,12 @@ void FirstUse::terminated( int, const QString &app )
347 349
348void FirstUse::newQcopChannel(const QString& channelName) 350void FirstUse::newQcopChannel(const QString& channelName)
349{ 351{
350 qDebug("channel %s added", channelName.data() ); 352 odebug << "channel " << channelName.data() << " added" << oendl;
351 QString prefix("QPE/Application/"); 353 QString prefix("QPE/Application/");
352 if (channelName.startsWith(prefix)) { 354 if (channelName.startsWith(prefix)) {
353 QString appName = channelName.mid(prefix.length()); 355 QString appName = channelName.mid(prefix.length());
354 if ( currApp >= 0 && appName == settingsTable[currApp].app ) { 356 if ( currApp >= 0 && appName == settingsTable[currApp].app ) {
355 qDebug( "Application: %s started", settingsTable[currApp].app ); 357 odebug << "Application: " << settingsTable[currApp].app << " started" << oendl;
356 waitingForLaunch = FALSE; 358 waitingForLaunch = FALSE;
357 updateButtons(); 359 updateButtons();
358 repaint(); 360 repaint();
@@ -370,12 +372,12 @@ void FirstUse::reloadLanguages()
370 config.setGroup( "Language"); 372 config.setGroup( "Language");
371 QString l = config.readEntry( "Language", "en"); 373 QString l = config.readEntry( "Language", "en");
372 QString cl = getenv("LANG"); 374 QString cl = getenv("LANG");
373 qWarning("language message - " + l); 375 owarn << "language message - " + l << oendl;
374 // setting anyway... 376 // setting anyway...
375 if (l.isNull() ) 377 if (l.isNull() )
376 unsetenv( "LANG" ); 378 unsetenv( "LANG" );
377 else { 379 else {
378 qWarning("and its not null"); 380 owarn << "and its not null" << oendl;
379 setenv( "LANG", l.latin1(), 1 ); 381 setenv( "LANG", l.latin1(), 1 );
380 } 382 }
381#ifndef QT_NO_TRANSLATION 383#ifndef QT_NO_TRANSLATION
@@ -392,9 +394,9 @@ void FirstUse::reloadLanguages()
392 // load translation tables 394 // load translation tables
393 transApp = new QTranslator(qApp); 395 transApp = new QTranslator(qApp);
394 QString tfn = QPEApplication::qpeDir() + "i18n/"+l+"/qpe.qm"; 396 QString tfn = QPEApplication::qpeDir() + "i18n/"+l+"/qpe.qm";
395 qWarning("loading " + tfn); 397 owarn << "loading " + tfn << oendl;
396 if ( transApp->load(tfn) ) { 398 if ( transApp->load(tfn) ) {
397 qWarning("installing translator"); 399 owarn << "installing translator" << oendl;
398 qApp->installTranslator( transApp ); 400 qApp->installTranslator( transApp );
399 } else { 401 } else {
400 delete transApp; 402 delete transApp;
@@ -403,9 +405,9 @@ void FirstUse::reloadLanguages()
403 405
404 transLib = new QTranslator(qApp); 406 transLib = new QTranslator(qApp);
405 tfn = QPEApplication::qpeDir() + "i18n/"+l+"/libqpe.qm"; 407 tfn = QPEApplication::qpeDir() + "i18n/"+l+"/libqpe.qm";
406 qWarning("loading " + tfn); 408 owarn << "loading " + tfn << oendl;
407 if ( transLib->load(tfn) ) { 409 if ( transLib->load(tfn) ) {
408 qWarning("installing translator library"); 410 owarn << "installing translator library" << oendl;
409 qApp->installTranslator( transLib ); 411 qApp->installTranslator( transLib );
410 } else { 412 } else {
411 delete transLib; 413 delete transLib;
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index 19e799a..cef16bf 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -21,31 +21,27 @@
21#define QTOPIA_INTERNAL_LANGLIST 21#define QTOPIA_INTERNAL_LANGLIST
22#include "inputmethods.h" 22#include "inputmethods.h"
23 23
24/* OPIE */
25#include <opie2/odebug.h>
24#include <qtopia/config.h> 26#include <qtopia/config.h>
25#include <qtopia/qpeapplication.h> 27#include <qtopia/qpeapplication.h>
28using namespace Opie::Core;
26 29
30/* QT */
27#include <qpopupmenu.h> 31#include <qpopupmenu.h>
28#include <qtoolbutton.h> 32#include <qtoolbutton.h>
29#include <qwidgetstack.h> 33#include <qwidgetstack.h>
30#include <qlayout.h> 34#include <qlayout.h>
31#include <qdir.h> 35#include <qdir.h>
32#include <stdlib.h>
33#include <qtl.h> 36#include <qtl.h>
34
35#ifdef Q_WS_QWS 37#ifdef Q_WS_QWS
36#include <qwindowsystem_qws.h> 38#include <qwindowsystem_qws.h>
37#include <qwsevent_qws.h> 39#include <qwsevent_qws.h>
38#include <qcopchannel_qws.h> 40#include <qcopchannel_qws.h>
39#endif 41#endif
40 42
41/* ### SingleFloppy if someone is interested? */ 43/* STD */
42#if 0 44#include <stdlib.h>
43#ifdef QT_NO_COMPONENT
44#include "../plugins/inputmethods/handwriting/handwritingimpl.h"
45#include "../plugins/inputmethods/keyboard/keyboardimpl.h"
46#include "../3rdparty/plugins/inputmethods/pickboard/pickboardimpl.h"
47#endif
48#endif
49 45
50/* XPM */ 46/* XPM */
51static const char * tri_xpm[]={ 47static const char * tri_xpm[]={
@@ -262,7 +258,7 @@ void InputMethods::setPreferedHandlers() {
262 if (!inputMethodList.isEmpty() && !current.isEmpty() ) { 258 if (!inputMethodList.isEmpty() && !current.isEmpty() ) {
263 for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it ) 259 for (it = inputMethodList.begin(); it != inputMethodList.end(); ++it )
264 if ( (*it).name() == current ) { 260 if ( (*it).name() == current ) {
265 qWarning("preferred keyboard is %s", current.latin1() ); 261 owarn << "preferred keyboard is " << current << "" << oendl;
266 mkeyboard = &(*it); 262 mkeyboard = &(*it);
267 kbdButton->setPixmap( *mkeyboard->icon() ); 263 kbdButton->setPixmap( *mkeyboard->icon() );
268 break; 264 break;
@@ -305,13 +301,13 @@ void InputMethods::loadInputMethods()
305 input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle ); 301 input.widget = input.extInterface->keyboardWidget( 0, inputWidgetStyle );
306 // may be either a simple, or advanced. 302 // may be either a simple, or advanced.
307 if (input.widget) { 303 if (input.widget) {
308 //qDebug("its a keyboard"); 304 //odebug << "its a keyboard" << oendl;
309 inputMethodList.append( input ); 305 inputMethodList.append( input );
310 } else { 306 } else {
311 //qDebug("its a real im"); 307 //odebug << "its a real im" << oendl;
312 input.widget = input.extInterface->statusWidget( 0, 0 ); 308 input.widget = input.extInterface->statusWidget( 0, 0 );
313 if (input.widget) { 309 if (input.widget) {
314 //qDebug("blah"); 310 //odebug << "blah" << oendl;
315 inputModifierList.append( input ); 311 inputModifierList.append( input );
316 imButton->addWidget(input.widget, inputModifierList.count()); 312 imButton->addWidget(input.widget, inputModifierList.count());
317 } 313 }
@@ -541,7 +537,7 @@ void InputMethods::showKbd( bool on )
541 537
542 if ( inputWidgetStyle & QWidget::WStyle_DialogBorder ) 538 if ( inputWidgetStyle & QWidget::WStyle_DialogBorder )
543 { 539 {
544 qDebug( "InputMethods: reading geometry." ); 540 odebug << "InputMethods: reading geometry." << oendl;
545 Config cfg( "Launcher" ); 541 Config cfg( "Launcher" );
546 cfg.setGroup( "InputMethods" ); 542 cfg.setGroup( "InputMethods" );
547 int l = cfg.readNumEntry( "absX", -1 ); 543 int l = cfg.readNumEntry( "absX", -1 );
@@ -551,7 +547,7 @@ void InputMethods::showKbd( bool on )
551 547
552 if ( l > -1 && t > -1 && w > -1 && h > -1 ) 548 if ( l > -1 && t > -1 && w > -1 && h > -1 )
553 { 549 {
554 qDebug( "InputMethods: config values ( %d, %d, %d, %d ) are ok.", l, t, w, h ); 550 odebug << "InputMethods: config values ( " << l << ", " << t << ", " << w << ", " << h << " ) are ok." << oendl;
555 left = l; 551 left = l;
556 top = t; 552 top = t;
557 width = w; 553 width = w;
@@ -559,12 +555,12 @@ void InputMethods::showKbd( bool on )
559 } 555 }
560 else 556 else
561 { 557 {
562 qDebug( "InputMethods: config values are new or not ok." ); 558 odebug << "InputMethods: config values are new or not ok." << oendl;
563 } 559 }
564 } 560 }
565 else 561 else
566 { 562 {
567 qDebug( "InputMethods: no floating selected." ); 563 odebug << "InputMethods: no floating selected." << oendl;
568 } 564 }
569 mkeyboard->widget->resize( width, height ); 565 mkeyboard->widget->resize( width, height );
570 mkeyboard->widget->move( left, top ); 566 mkeyboard->widget->move( left, top );
@@ -577,7 +573,7 @@ void InputMethods::showKbd( bool on )
577 { 573 {
578 QPoint pos = mkeyboard->widget->pos(); 574 QPoint pos = mkeyboard->widget->pos();
579 QSize siz = mkeyboard->widget->size(); 575 QSize siz = mkeyboard->widget->size();
580 qDebug( "InputMethods: saving geometry." ); 576 odebug << "InputMethods: saving geometry." << oendl;
581 Config cfg( "Launcher" ); 577 Config cfg( "Launcher" );
582 cfg.setGroup( "InputMethods" ); 578 cfg.setGroup( "InputMethods" );
583 cfg.writeEntry( "absX", pos.x() ); 579 cfg.writeEntry( "absX", pos.x() );
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp
index a0e9c16..092eb0c 100644
--- a/core/launcher/irserver.cpp
+++ b/core/launcher/irserver.cpp
@@ -18,15 +18,15 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21
22#include "irserver.h" 21#include "irserver.h"
22#include "obexinterface.h"
23 23
24/* OPIE */
25#include <opie2/odebug.h>
24#include <qtopia/qlibrary.h> 26#include <qtopia/qlibrary.h>
25#include <qtopia/qpeapplication.h> 27#include <qtopia/qpeapplication.h>
26 28
27 29/* QT */
28#include "obexinterface.h"
29
30#include <qdir.h> 30#include <qdir.h>
31 31
32IrServer::IrServer( QObject *parent, const char *name ) 32IrServer::IrServer( QObject *parent, const char *name )
@@ -44,15 +44,15 @@ IrServer::IrServer( QObject *parent, const char *name )
44 QStringList::Iterator it; 44 QStringList::Iterator it;
45 for ( it = list.begin(); it != list.end(); ++it ) { 45 for ( it = list.begin(); it != list.end(); ++it ) {
46 QLibrary *trylib = new QLibrary( path + *it ); 46 QLibrary *trylib = new QLibrary( path + *it );
47 //qDebug("trying lib %s", (path + (*it)).latin1() ); 47 //odebug << "trying lib " << (path + (*it)) << "" << oendl;
48 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) { 48 if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&obexIface ) == QS_OK ) {
49 lib = trylib; 49 lib = trylib;
50 //qDebug("found obex lib" ); 50 //odebug << "found obex lib" << oendl;
51 QString lang = getenv( "LANG" ); 51 QString lang = getenv( "LANG" );
52 QTranslator * trans = new QTranslator(qApp); 52 QTranslator * trans = new QTranslator(qApp);
53 QString type = (*it).left( (*it).find(".") ); 53 QString type = (*it).left( (*it).find(".") );
54 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 54 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
55 //qDebug("tr fpr obex: %s", tfn.latin1() ); 55 //odebug << "tr fpr obex: " << tfn << "" << oendl;
56 if ( trans->load( tfn )) 56 if ( trans->load( tfn ))
57 qApp->installTranslator( trans ); 57 qApp->installTranslator( trans );
58 else 58 else
@@ -64,7 +64,7 @@ IrServer::IrServer( QObject *parent, const char *name )
64 } 64 }
65 } 65 }
66 if ( !lib ) 66 if ( !lib )
67 qDebug("could not load IR plugin" ); 67 odebug << "could not load IR plugin" << oendl;
68} 68}
69 69
70IrServer::~IrServer() 70IrServer::~IrServer()
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 5d0c778..bf2287d 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -18,6 +18,15 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "startmenu.h"
22#include "taskbar.h"
23#include "serverinterface.h"
24#include "launcherview.h"
25#include "launcher.h"
26#include "server.h"
27
28/* OPIE */
29#include <opie2/odebug.h>
21#include <qtopia/global.h> 30#include <qtopia/global.h>
22#ifdef Q_WS_QWS 31#ifdef Q_WS_QWS
23#include <qtopia/qcopenvelope_qws.h> 32#include <qtopia/qcopenvelope_qws.h>
@@ -28,10 +37,13 @@
28#include <qtopia/qpeapplication.h> 37#include <qtopia/qpeapplication.h>
29#include <qtopia/mimetype.h> 38#include <qtopia/mimetype.h>
30#include <qtopia/private/categories.h> 39#include <qtopia/private/categories.h>
31//#include <qtopia/custom.h> 40#define QTOPIA_INTERNAL_FSLP
41#include <qtopia/lnkproperties.h>
32 42
43/* QT */
33#include <qdir.h> 44#include <qdir.h>
34#ifdef Q_WS_QWS 45#ifdef Q_WS_QWS
46#include <qkeyboard_qws.h>
35#include <qwindowsystem_qws.h> 47#include <qwindowsystem_qws.h>
36#endif 48#endif
37#include <qtimer.h> 49#include <qtimer.h>
@@ -50,19 +62,9 @@
50#include <qtextstream.h> 62#include <qtextstream.h>
51#include <qpopupmenu.h> 63#include <qpopupmenu.h>
52 64
53#include "startmenu.h" 65/* STD */
54#include "taskbar.h"
55
56#include "serverinterface.h"
57#include "launcherview.h"
58#include "launcher.h"
59#include "server.h"
60
61#define QTOPIA_INTERNAL_FSLP
62#include <qtopia/lnkproperties.h>
63#include <stdlib.h> 66#include <stdlib.h>
64#include <assert.h> 67#include <assert.h>
65
66#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 68#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
67#include <unistd.h> 69#include <unistd.h>
68#include <stdio.h> 70#include <stdio.h>
@@ -70,11 +72,6 @@
70#include <mntent.h> 72#include <mntent.h>
71#endif 73#endif
72 74
73#ifdef Q_WS_QWS
74#include <qkeyboard_qws.h>
75#include <qpe/lnkproperties.h>
76#endif
77
78 75
79static bool isVisibleWindow( int ); 76static bool isVisibleWindow( int );
80//=========================================================================== 77//===========================================================================
@@ -228,7 +225,7 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm,
228 if ( id == "Documents" ) 225 if ( id == "Documents" )
229 docview = view; 226 docview = view;
230 227
231 qDebug("inserting %s at %d", id.latin1(), n-1 ); 228 odebug << "inserting " << id << " at " << n-1 << "" << oendl;
232 229
233 Config cfg("Launcher"); 230 Config cfg("Launcher");
234 setTabAppearance( tab, cfg ); 231 setTabAppearance( tab, cfg );
@@ -413,7 +410,7 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
413 if ( view(id) ) { 410 if ( view(id) ) {
414 if ( !fam.isEmpty() ) { 411 if ( !fam.isEmpty() ) {
415 view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); 412 view(id)->setViewFont( QFont(fam, size, weight, italic!=0) );
416 qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); 413 odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl;
417 } else { 414 } else {
418 view(id)->clearViewFont(); 415 view(id)->clearViewFont();
419 } 416 }
@@ -684,7 +681,7 @@ void Launcher::applicationRemoved( const QString& type, const AppLnk& app )
684 if ( view ) 681 if ( view )
685 view->removeLink( app.linkFile() ); 682 view->removeLink( app.linkFile() );
686 else 683 else
687 qWarning("removeAppLnk: No view for %s!", type.latin1() ); 684 owarn << "removeAppLnk: No view for " << type << "!" << oendl;
688} 685}
689 686
690void Launcher::allApplicationsRemoved() 687void Launcher::allApplicationsRemoved()
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 6c7d487..71e8753 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -20,13 +20,16 @@
20 20
21#include "launcherview.h" 21#include "launcherview.h"
22 22
23/* OPIE */
24#include <opie2/odebug.h>
23#include <qtopia/qpeapplication.h> 25#include <qtopia/qpeapplication.h>
24#include <qtopia/private/categories.h> 26#include <qtopia/private/categories.h>
25#include <qtopia/categoryselect.h> 27#include <qtopia/categoryselect.h>
26#include <qtopia/mimetype.h> 28#include <qtopia/mimetype.h>
27#include <qtopia/resource.h> 29#include <qtopia/resource.h>
28//#include <qtopia/private/palmtoprecord.h> 30using namespace Opie::Core;
29 31
32/* QT */
30#include <qtimer.h> 33#include <qtimer.h>
31#include <qfileinfo.h> 34#include <qfileinfo.h>
32#include <qiconview.h> 35#include <qiconview.h>
@@ -115,7 +118,7 @@ public:
115 AppLnk* l; 118 AppLnk* l;
116 while ((l=it.current())) { 119 while ((l=it.current())) {
117 ++it; 120 ++it;
118 //qDebug("%p: hidden (should remove)",l); 121 //odebug << "" << l << ": hidden (should remove)" << oendl;
119 } 122 }
120#endif 123#endif
121 } 124 }
@@ -1029,7 +1032,7 @@ void LauncherView::paletteChange( const QPalette &p )
1029 1032
1030void LauncherView::fontChanged(const QFont&) 1033void LauncherView::fontChanged(const QFont&)
1031{ 1034{
1032 qDebug("LauncherView::fontChanged()"); 1035 odebug << "LauncherView::fontChanged()" << oendl;
1033 icons->hideOrShowItems( FALSE ); 1036 icons->hideOrShowItems( FALSE );
1034} 1037}
1035 1038
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 3e7e0d2..a86aca6 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -21,24 +21,35 @@
21#ifndef QTOPIA_INTERNAL_FILEOPERATIONS 21#ifndef QTOPIA_INTERNAL_FILEOPERATIONS
22#define QTOPIA_INTERNAL_FILEOPERATIONS 22#define QTOPIA_INTERNAL_FILEOPERATIONS
23#endif 23#endif
24#ifdef QT_QWS_LOGIN
25#include "../login/qdmdialogimpl.h"
26#endif
27#include "calibrate.h"
24#include "server.h" 28#include "server.h"
25#include "serverapp.h" 29#include "serverapp.h"
26#include "stabmon.h" 30#include "stabmon.h"
27#include "firstuse.h" 31#include "firstuse.h"
28 32
33/* OPIE */
34#include <opie2/odebug.h>
35#include <opie2/odevice.h>
29#include <opie2/oglobal.h> 36#include <opie2/oglobal.h>
30
31#include <qtopia/network.h> 37#include <qtopia/network.h>
32//#include <qtopia/custom.h> 38#include <qtopia/alarmserver.h>
33 39using namespace Opie::Core;
34 40
41/* QT */
35#include <qdir.h> 42#include <qdir.h>
43#include <qmessagebox.h>
36#ifdef QWS 44#ifdef QWS
37#include <qwindowsystem_qws.h> 45#include <qwindowsystem_qws.h>
38#include <qtopia/qcopenvelope_qws.h> 46#include <qtopia/qcopenvelope_qws.h>
39#endif 47#endif
40#include <qtopia/alarmserver.h> 48#ifdef Q_WS_QWS
49#include <qkeyboard_qws.h>
50#endif
41 51
52/* STD */
42#include <stdlib.h> 53#include <stdlib.h>
43#include <stdio.h> 54#include <stdio.h>
44#include <signal.h> 55#include <signal.h>
@@ -48,23 +59,6 @@
48#include <process.h> 59#include <process.h>
49#endif 60#endif
50 61
51#include "calibrate.h"
52
53
54#ifdef QT_QWS_LOGIN
55#include "../login/qdmdialogimpl.h"
56#endif
57
58#ifdef Q_WS_QWS
59#include <qkeyboard_qws.h>
60#endif
61
62#include <qmessagebox.h>
63#include <opie2/odevice.h>
64
65using namespace Opie::Core;
66
67
68static void cleanup() 62static void cleanup()
69{ 63{
70 QDir dir( "/tmp", "qcop-msg-*" ); 64 QDir dir( "/tmp", "qcop-msg-*" );
@@ -121,7 +115,7 @@ static void refreshTimeZoneConfig()
121 zoneID = cfg.readEntry( "Zone" + QString::number( zoneIndex )); 115 zoneID = cfg.readEntry( "Zone" + QString::number( zoneIndex ));
122 curZone = TimeZone( zoneID ); 116 curZone = TimeZone( zoneID );
123 if ( !curZone.isValid() ){ 117 if ( !curZone.isValid() ){
124 qDebug( "initEnvironment() Invalid TimeZone %s", zoneID.latin1() ); 118 odebug << "initEnvironment() Invalid TimeZone " << zoneID << "" << oendl;
125 break; 119 break;
126 } 120 }
127 cfg.writeEntry( "ZoneName" + QString::number( zoneIndex ), curZone.city() ); 121 cfg.writeEntry( "ZoneName" + QString::number( zoneIndex ), curZone.city() );
@@ -269,7 +263,7 @@ int initApplication( int argc, char ** argv )
269 263
270 int rv = a.exec(); 264 int rv = a.exec();
271 265
272 qDebug("exiting..."); 266 odebug << "exiting..." << oendl;
273 delete s; 267 delete s;
274 268
275#ifndef Q_OS_MACX 269#ifndef Q_OS_MACX
@@ -341,7 +335,7 @@ int main( int argc, char ** argv )
341 int retVal = initApplication( argc, argv ); 335 int retVal = initApplication( argc, argv );
342 336
343 if ( DesktopApplication::doRestart ) { 337 if ( DesktopApplication::doRestart ) {
344 qDebug("Trying to restart"); 338 odebug << "Trying to restart" << oendl;
345 execl( (QPEApplication::qpeDir()+"bin\\qpe").latin1(), "qpe", 0 ); 339 execl( (QPEApplication::qpeDir()+"bin\\qpe").latin1(), "qpe", 0 );
346 } 340 }
347 341
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp
index 7e61b0e..a11ac86 100644
--- a/core/launcher/packageslave.cpp
+++ b/core/launcher/packageslave.cpp
@@ -19,28 +19,28 @@
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "packageslave.h" 21#include "packageslave.h"
22#include <qtopia/qprocess.h>
23 22
23/* OPIE */
24#include <opie2/odebug.h>
25#include <qtopia/qprocess.h>
24#ifdef Q_WS_QWS 26#ifdef Q_WS_QWS
25#include <qtopia/qcopenvelope_qws.h> 27#include <qtopia/qcopenvelope_qws.h>
26#endif 28#endif
29using namespace Opie::Core;
27 30
31/* QT */
28#ifdef Q_WS_QWS 32#ifdef Q_WS_QWS
29#include <qcopchannel_qws.h> 33#include <qcopchannel_qws.h>
30#endif 34#endif
31
32#include <qtextstream.h> 35#include <qtextstream.h>
33 36
37/* STD */
34#include <stdlib.h> 38#include <stdlib.h>
35#include <sys/stat.h> // mkdir() 39#include <sys/stat.h> // mkdir()
36
37#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 40#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
38#include <unistd.h> 41#include <unistd.h>
39#include <sys/vfs.h> 42#include <sys/vfs.h>
40#include <mntent.h> 43#include <mntent.h>
41#elif defined(Q_OS_WIN32)
42#include <windows.h>
43#include <winbase.h>
44#elif defined(Q_OS_MACX) 44#elif defined(Q_OS_MACX)
45#include <unistd.h> 45#include <unistd.h>
46#endif 46#endif
@@ -145,7 +145,7 @@ void PackageHandler::addPackageFiles( const QString &location,
145#else 145#else
146 QDir d; 146 QDir d;
147 //#### revise 147 //#### revise
148 qDebug("Copy file at %s: %s", __FILE__, __LINE__ ); 148 odebug << "Copy file at " << __FILE__ << ": " << __LINE__ << "" << oendl;
149 d.mkdir(("/usr/lib/ipkg/info/" + location).ascii()); 149 d.mkdir(("/usr/lib/ipkg/info/" + location).ascii());
150 system(("copy " + f.name() + " /usr/lib/ipkg/info/"+location).ascii()); 150 system(("copy " + f.name() + " /usr/lib/ipkg/info/"+location).ascii());
151#endif 151#endif
@@ -159,7 +159,7 @@ void PackageHandler::addPackageFiles( const QString &location,
159 s = ts.readLine(); // line of text excluding '\n' 159 s = ts.readLine(); // line of text excluding '\n'
160 // for s, do link/mkdir. 160 // for s, do link/mkdir.
161 if ( s.right(1) == "/" ) { 161 if ( s.right(1) == "/" ) {
162 qDebug("do mkdir for %s", s.ascii()); 162 odebug << "do mkdir for " << s.ascii() << "" << oendl;
163#ifndef Q_OS_WIN32 163#ifndef Q_OS_WIN32
164 mkdir( s.ascii(), 0777 ); 164 mkdir( s.ascii(), 0777 );
165 //possible optimization: symlink directories 165 //possible optimization: symlink directories
@@ -170,10 +170,10 @@ void PackageHandler::addPackageFiles( const QString &location,
170 170
171 } else { 171 } else {
172#ifndef Q_OS_WIN32 172#ifndef Q_OS_WIN32
173 qDebug("do symlink for %s", s.ascii()); 173 odebug << "do symlink for " << s.ascii() << "" << oendl;
174 symlink( (location + s).ascii(), s.ascii() ); 174 symlink( (location + s).ascii(), s.ascii() );
175#else 175#else
176 qDebug("Copy file instead of a symlink for WIN32"); 176 odebug << "Copy file instead of a symlink for WIN32" << oendl;
177 if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE)) 177 if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE))
178 qWarning("Unable to create symlinkfor %s", 178 qWarning("Unable to create symlinkfor %s",
179 (location + s).ascii()); 179 (location + s).ascii());
@@ -215,14 +215,14 @@ void PackageHandler::cleanupPackageFiles( const QString &listfile )
215 //should rmdir if empty, after all files have been removed 215 //should rmdir if empty, after all files have been removed
216 } else { 216 } else {
217#ifndef Q_OS_WIN32 217#ifndef Q_OS_WIN32
218 qDebug("remove symlink for %s", s.ascii()); 218 odebug << "remove symlink for " << s.ascii() << "" << oendl;
219 //check if it is a symlink first (don't remove /etc/passwd...) 219 //check if it is a symlink first (don't remove /etc/passwd...)
220 char buf[10]; //we don't care about the contents 220 char buf[10]; //we don't care about the contents
221 if ( ::readlink( s.ascii(),buf, 10 >= 0 ) ) 221 if ( ::readlink( s.ascii(),buf, 10 >= 0 ) )
222 ::unlink( s.ascii() ); 222 ::unlink( s.ascii() );
223 #else 223 #else
224 // ### revise 224 // ### revise
225 qWarning("Unable to remove symlink %s:%s", __FILE__, __LINE__); 225 owarn << "Unable to remove symlink " << __FILE__ << ":" << __LINE__ << "" << oendl;
226#endif 226#endif
227 } 227 }
228 } 228 }
@@ -266,7 +266,7 @@ void PackageHandler::prepareInstall( const QString& size, const QString& path )
266 struct statfs fs; 266 struct statfs fs;
267 if ( statfs( path.latin1(), &fs ) == 0 ) 267 if ( statfs( path.latin1(), &fs ) == 0 )
268 if ( s > fs.f_bsize * fs.f_bavail ) { 268 if ( s > fs.f_bsize * fs.f_bavail ) {
269 //qDebug("############### Not enough space left ###############"); 269 //odebug << "############### Not enough space left ###############" << oendl;
270 mNoSpaceLeft = TRUE; 270 mNoSpaceLeft = TRUE;
271 } 271 }
272#endif 272#endif
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 33df6c4..e339dc7 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -21,21 +21,24 @@
21#include "qcopbridge.h" 21#include "qcopbridge.h"
22#include "transferserver.h" 22#include "transferserver.h"
23 23
24/* OPIE */
25#include <opie2/odebug.h>
24#include <opie2/oglobal.h> 26#include <opie2/oglobal.h>
25
26#ifdef Q_WS_QWS 27#ifdef Q_WS_QWS
27#include <qtopia/qcopenvelope_qws.h> 28#include <qtopia/qcopenvelope_qws.h>
28#endif 29#endif
29#include <qtopia/qpeapplication.h> 30#include <qtopia/qpeapplication.h>
30
31#include <qtopia/version.h> 31#include <qtopia/version.h>
32using namespace Opie::Core;
32 33
34/* QT */
33#include <qtextstream.h> 35#include <qtextstream.h>
34#include <qtimer.h> 36#include <qtimer.h>
35#ifdef Q_WS_QWS 37#ifdef Q_WS_QWS
36#include <qcopchannel_qws.h> 38#include <qcopchannel_qws.h>
37#endif 39#endif
38 40
41/* STD */
39#ifndef _XOPEN_SOURCE 42#ifndef _XOPEN_SOURCE
40#define _XOPEN_SOURCE 43#define _XOPEN_SOURCE
41#endif 44#endif
@@ -49,12 +52,8 @@
49#include <shadow.h> 52#include <shadow.h>
50#endif 53#endif
51 54
52
53//#define INSECURE
54
55const int block_size = 51200; 55const int block_size = 51200;
56 56
57using namespace Opie::Core;
58QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, 57QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
59 const char* name ) 58 const char* name )
60 : QServerSocket( port, 1, parent, name ), 59 : QServerSocket( port, 1, parent, name ),
@@ -62,7 +61,7 @@ QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
62 cardChannel( 0 ) 61 cardChannel( 0 )
63{ 62{
64 if ( !ok() ) 63 if ( !ok() )
65 qWarning( "Failed to bind to port %d", port ); 64 owarn << "Failed to bind to port " << port << "" << oendl;
66 else { 65 else {
67#ifndef QT_NO_COP 66#ifndef QT_NO_COP
68 desktopChannel = new QCopChannel( "QPE/Desktop", this ); 67 desktopChannel = new QCopChannel( "QPE/Desktop", this );
@@ -171,13 +170,13 @@ void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArra
171 170
172 int paren = command.find( "(" ); 171 int paren = command.find( "(" );
173 if ( paren <= 0 ) { 172 if ( paren <= 0 ) {
174 qDebug("DesktopMessage: bad qcop syntax"); 173 odebug << "DesktopMessage: bad qcop syntax" << oendl;
175 return; 174 return;
176 } 175 }
177 176
178 QString params = command.mid( paren + 1 ); 177 QString params = command.mid( paren + 1 );
179 if ( params[params.length()-1] != ')' ) { 178 if ( params[params.length()-1] != ')' ) {
180 qDebug("DesktopMessage: bad qcop syntax"); 179 odebug << "DesktopMessage: bad qcop syntax" << oendl;
181 return; 180 return;
182 } 181 }
183 182
@@ -204,7 +203,7 @@ void QCopBridge::sendDesktopMessageOld( const QCString& command, const QByteArra
204 stream >> i; 203 stream >> i;
205 str = QString::number( i ); 204 str = QString::number( i );
206 } else { 205 } else {
207 qDebug(" cannot route the argument type %s throught the qcop bridge", (*it).latin1() ); 206 odebug << " cannot route the argument type " << (*it) << " throught the qcop bridge" << oendl;
208 return; 207 return;
209 } 208 }
210 QString estr; 209 QString estr;
@@ -332,7 +331,7 @@ void QCopBridgePI::send( const QString& msg )
332 return; 331 return;
333 QTextStream os( this ); 332 QTextStream os( this );
334 os << msg << endl; 333 os << msg << endl;
335 //qDebug( "sending qcop message: %s", msg.latin1() ); 334 //odebug << "sending qcop message: " << msg << "" << oendl;
336} 335}
337 336
338void QCopBridgePI::read() 337void QCopBridgePI::read()
@@ -345,7 +344,7 @@ void QCopBridgePI::read()
345 344
346void QCopBridgePI::process( const QString& message ) 345void QCopBridgePI::process( const QString& message )
347{ 346{
348 //qDebug( "Command: %s", message.latin1() ); 347 //odebug << "Command: " << message << "" << oendl;
349 348
350 // split message using "," as separator 349 // split message using "," as separator
351 QStringList msg = QStringList::split( " ", message ); 350 QStringList msg = QStringList::split( " ", message );
diff --git a/core/launcher/qprocess.cpp b/core/launcher/qprocess.cpp
index 97bd539..3fe1238 100644
--- a/core/launcher/qprocess.cpp
+++ b/core/launcher/qprocess.cpp
@@ -581,28 +581,28 @@ void QProcess::writeToStdin( const QString& buf )
581void QProcess::connectNotify( const char * signal ) 581void QProcess::connectNotify( const char * signal )
582{ 582{
583#if defined(QT_QPROCESS_DEBUG) 583#if defined(QT_QPROCESS_DEBUG)
584 qDebug( "QProcess::connectNotify(): signal %s has been connected", signal ); 584 odebug << "QProcess::connectNotify(): signal " << signal << " has been connected" << oendl;
585#endif 585#endif
586 if ( !ioRedirection ) 586 if ( !ioRedirection )
587 if ( qstrcmp( signal, SIGNAL(readyReadStdout()) )==0 || 587 if ( qstrcmp( signal, SIGNAL(readyReadStdout()) )==0 ||
588 qstrcmp( signal, SIGNAL(readyReadStderr()) )==0 588 qstrcmp( signal, SIGNAL(readyReadStderr()) )==0
589 ) { 589 ) {
590#if defined(QT_QPROCESS_DEBUG) 590#if defined(QT_QPROCESS_DEBUG)
591 qDebug( "QProcess::connectNotify(): set ioRedirection to TRUE" ); 591 odebug << "QProcess::connectNotify(): set ioRedirection to TRUE" << oendl;
592#endif 592#endif
593 setIoRedirection( TRUE ); 593 setIoRedirection( TRUE );
594 return; 594 return;
595 } 595 }
596 if ( !notifyOnExit && qstrcmp( signal, SIGNAL(processExited()) )==0 ) { 596 if ( !notifyOnExit && qstrcmp( signal, SIGNAL(processExited()) )==0 ) {
597#if defined(QT_QPROCESS_DEBUG) 597#if defined(QT_QPROCESS_DEBUG)
598 qDebug( "QProcess::connectNotify(): set notifyOnExit to TRUE" ); 598 odebug << "QProcess::connectNotify(): set notifyOnExit to TRUE" << oendl;
599#endif 599#endif
600 setNotifyOnExit( TRUE ); 600 setNotifyOnExit( TRUE );
601 return; 601 return;
602 } 602 }
603 if ( !wroteToStdinConnected && qstrcmp( signal, SIGNAL(wroteToStdin()) )==0 ) { 603 if ( !wroteToStdinConnected && qstrcmp( signal, SIGNAL(wroteToStdin()) )==0 ) {
604#if defined(QT_QPROCESS_DEBUG) 604#if defined(QT_QPROCESS_DEBUG)
605 qDebug( "QProcess::connectNotify(): set wroteToStdinConnected to TRUE" ); 605 odebug << "QProcess::connectNotify(): set wroteToStdinConnected to TRUE" << oendl;
606#endif 606#endif
607 setWroteStdinConnected( TRUE ); 607 setWroteStdinConnected( TRUE );
608 return; 608 return;
@@ -618,19 +618,19 @@ void QProcess::disconnectNotify( const char * )
618 receivers( SIGNAL(readyReadStderr()) ) ==0 618 receivers( SIGNAL(readyReadStderr()) ) ==0
619 ) { 619 ) {
620#if defined(QT_QPROCESS_DEBUG) 620#if defined(QT_QPROCESS_DEBUG)
621 qDebug( "QProcess::disconnectNotify(): set ioRedirection to FALSE" ); 621 odebug << "QProcess::disconnectNotify(): set ioRedirection to FALSE" << oendl;
622#endif 622#endif
623 setIoRedirection( FALSE ); 623 setIoRedirection( FALSE );
624 } 624 }
625 if ( notifyOnExit && receivers( SIGNAL(processExited()) ) == 0 ) { 625 if ( notifyOnExit && receivers( SIGNAL(processExited()) ) == 0 ) {
626#if defined(QT_QPROCESS_DEBUG) 626#if defined(QT_QPROCESS_DEBUG)
627 qDebug( "QProcess::disconnectNotify(): set notifyOnExit to FALSE" ); 627 odebug << "QProcess::disconnectNotify(): set notifyOnExit to FALSE" << oendl;
628#endif 628#endif
629 setNotifyOnExit( FALSE ); 629 setNotifyOnExit( FALSE );
630 } 630 }
631 if ( wroteToStdinConnected && receivers( SIGNAL(wroteToStdin()) ) == 0 ) { 631 if ( wroteToStdinConnected && receivers( SIGNAL(wroteToStdin()) ) == 0 ) {
632#if defined(QT_QPROCESS_DEBUG) 632#if defined(QT_QPROCESS_DEBUG)
633 qDebug( "QProcess::disconnectNotify(): set wroteToStdinConnected to FALSE" ); 633 odebug << "QProcess::disconnectNotify(): set wroteToStdinConnected to FALSE" << oendl;
634#endif 634#endif
635 setWroteStdinConnected( FALSE ); 635 setWroteStdinConnected( FALSE );
636 } 636 }
diff --git a/core/launcher/qprocess_unix.cpp b/core/launcher/qprocess_unix.cpp
index 19a8c93..d62e4e6 100644
--- a/core/launcher/qprocess_unix.cpp
+++ b/core/launcher/qprocess_unix.cpp
@@ -18,8 +18,6 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21//#include "qplatformdefs.h"
22
23// Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED. 21// Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED.
24#if defined(connect) 22#if defined(connect)
25#undef connect 23#undef connect
@@ -27,33 +25,34 @@
27 25
28#include "qprocess.h" 26#include "qprocess.h"
29 27
30#ifndef QT_NO_PROCESS 28/* OPIE */
29#include <opie2/odebug.h>
30using namespace Opie::Core;
31 31
32#include "qapplication.h" 32/* QT */
33#include "qqueue.h" 33#ifndef QT_NO_PROCESS
34#include "qlist.h" 34#include <qapplication.h>
35#include "qsocketnotifier.h" 35#include <qqueue.h>
36#include "qtimer.h" 36#include <qlist.h>
37#include "qregexp.h" 37#include <qsocketnotifier.h>
38#include <qtimer.h>
39#include <qregexp.h>
38 40
39#include "qcleanuphandler_p.h" 41#include "qcleanuphandler_p.h"
40 42
43/* STD */
41#include <stdlib.h> 44#include <stdlib.h>
42
43// ### FOR Qt 2.3 compat
44#include <unistd.h> 45#include <unistd.h>
45#include <signal.h> 46#include <signal.h>
46#include <sys/socket.h> 47#include <sys/socket.h>
47#include <sys/ioctl.h> 48#include <sys/ioctl.h>
48#include <sys/wait.h> 49#include <sys/wait.h>
49#include <sys/fcntl.h> 50#include <sys/fcntl.h>
50 51#include <sys/resource.h>
51#include <errno.h> 52#include <errno.h>
52
53#ifdef Q_OS_MACX 53#ifdef Q_OS_MACX
54#include <sys/time.h> 54#include <sys/time.h>
55#endif 55#endif
56#include <sys/resource.h>
57 56
58#ifdef __MIPSEL__ 57#ifdef __MIPSEL__
59# ifndef SOCK_DGRAM 58# ifndef SOCK_DGRAM
@@ -132,7 +131,7 @@ public:
132 QProc( pid_t p, QProcess *proc=0 ) : pid(p), process(proc) 131 QProc( pid_t p, QProcess *proc=0 ) : pid(p), process(proc)
133 { 132 {
134#if defined(QT_QPROCESS_DEBUG) 133#if defined(QT_QPROCESS_DEBUG)
135 qDebug( "QProc: Constructor for pid %d and QProcess %p", pid, process ); 134 odebug << "QProc: Constructor for pid " << pid << " and QProcess " << process << "" << oendl;
136#endif 135#endif
137 socketStdin = 0; 136 socketStdin = 0;
138 socketStdout = 0; 137 socketStdout = 0;
@@ -141,7 +140,7 @@ public:
141 ~QProc() 140 ~QProc()
142 { 141 {
143#if defined(QT_QPROCESS_DEBUG) 142#if defined(QT_QPROCESS_DEBUG)
144 qDebug( "QProc: Destructor for pid %d and QProcess %p", pid, process ); 143 odebug << "QProc: Destructor for pid " << pid << " and QProcess " << process << "" << oendl;
145#endif 144#endif
146 if ( process != 0 ) { 145 if ( process != 0 ) {
147 if ( process->d->notifierStdin ) 146 if ( process->d->notifierStdin )
@@ -213,7 +212,7 @@ QProcessManager::QProcessManager()
213 sigchldFd[1] = 0; 212 sigchldFd[1] = 0;
214 } else { 213 } else {
215#if defined(QT_QPROCESS_DEBUG) 214#if defined(QT_QPROCESS_DEBUG)
216 qDebug( "QProcessManager: install socket notifier (%d)", sigchldFd[1] ); 215 odebug << "QProcessManager: install socket notifier (" << sigchldFd[1] << ")" << oendl;
217#endif 216#endif
218 QSocketNotifier *sn = new QSocketNotifier( sigchldFd[1], 217 QSocketNotifier *sn = new QSocketNotifier( sigchldFd[1],
219 QSocketNotifier::Read, this ); 218 QSocketNotifier::Read, this );
@@ -226,7 +225,7 @@ QProcessManager::QProcessManager()
226 struct sigaction act; 225 struct sigaction act;
227 226
228#if defined(QT_QPROCESS_DEBUG) 227#if defined(QT_QPROCESS_DEBUG)
229 qDebug( "QProcessManager: install a SIGCHLD handler" ); 228 odebug << "QProcessManager: install a SIGCHLD handler" << oendl;
230#endif 229#endif
231 act.sa_handler = qt_C_sigchldHnd; 230 act.sa_handler = qt_C_sigchldHnd;
232 sigemptyset( &(act.sa_mask) ); 231 sigemptyset( &(act.sa_mask) );
@@ -236,10 +235,10 @@ QProcessManager::QProcessManager()
236 act.sa_flags |= SA_RESTART; 235 act.sa_flags |= SA_RESTART;
237#endif 236#endif
238 if ( sigaction( SIGCHLD, &act, &oldactChld ) != 0 ) 237 if ( sigaction( SIGCHLD, &act, &oldactChld ) != 0 )
239 qWarning( "Error installing SIGCHLD handler" ); 238 owarn << "Error installing SIGCHLD handler" << oendl;
240 239
241#if defined(QT_QPROCESS_DEBUG) 240#if defined(QT_QPROCESS_DEBUG)
242 qDebug( "QProcessManager: install a SIGPIPE handler (SIG_IGN)" ); 241 odebug << "QProcessManager: install a SIGPIPE handler (SIG_IGN)" << oendl;
243#endif 242#endif
244 /* 243 /*
245 Using qt_C_sigpipeHnd rather than SIG_IGN is a workaround 244 Using qt_C_sigpipeHnd rather than SIG_IGN is a workaround
@@ -252,7 +251,7 @@ QProcessManager::QProcessManager()
252 sigaddset( &(act.sa_mask), SIGPIPE ); 251 sigaddset( &(act.sa_mask), SIGPIPE );
253 act.sa_flags = 0; 252 act.sa_flags = 0;
254 if ( sigaction( SIGPIPE, &act, &oldactPipe ) != 0 ) 253 if ( sigaction( SIGPIPE, &act, &oldactPipe ) != 0 )
255 qWarning( "Error installing SIGPIPE handler" ); 254 owarn << "Error installing SIGPIPE handler" << oendl;
256} 255}
257 256
258QProcessManager::~QProcessManager() 257QProcessManager::~QProcessManager()
@@ -266,23 +265,23 @@ QProcessManager::~QProcessManager()
266 265
267 // restore SIGCHLD handler 266 // restore SIGCHLD handler
268#if defined(QT_QPROCESS_DEBUG) 267#if defined(QT_QPROCESS_DEBUG)
269 qDebug( "QProcessManager: restore old sigchild handler" ); 268 odebug << "QProcessManager: restore old sigchild handler" << oendl;
270#endif 269#endif
271 if ( sigaction( SIGCHLD, &oldactChld, 0 ) != 0 ) 270 if ( sigaction( SIGCHLD, &oldactChld, 0 ) != 0 )
272 qWarning( "Error restoring SIGCHLD handler" ); 271 owarn << "Error restoring SIGCHLD handler" << oendl;
273 272
274#if defined(QT_QPROCESS_DEBUG) 273#if defined(QT_QPROCESS_DEBUG)
275 qDebug( "QProcessManager: restore old sigpipe handler" ); 274 odebug << "QProcessManager: restore old sigpipe handler" << oendl;
276#endif 275#endif
277 if ( sigaction( SIGPIPE, &oldactPipe, 0 ) != 0 ) 276 if ( sigaction( SIGPIPE, &oldactPipe, 0 ) != 0 )
278 qWarning( "Error restoring SIGPIPE handler" ); 277 owarn << "Error restoring SIGPIPE handler" << oendl;
279} 278}
280 279
281void QProcessManager::append( QProc *p ) 280void QProcessManager::append( QProc *p )
282{ 281{
283 procList->append( p ); 282 procList->append( p );
284#if defined(QT_QPROCESS_DEBUG) 283#if defined(QT_QPROCESS_DEBUG)
285 qDebug( "QProcessManager: append process (procList.count(): %d)", procList->count() ); 284 odebug << "QProcessManager: append process (procList.count(): " << procList->count() << ")" << oendl;
286#endif 285#endif
287} 286}
288 287
@@ -290,7 +289,7 @@ void QProcessManager::remove( QProc *p )
290{ 289{
291 procList->remove( p ); 290 procList->remove( p );
292#if defined(QT_QPROCESS_DEBUG) 291#if defined(QT_QPROCESS_DEBUG)
293 qDebug( "QProcessManager: remove process (procList.count(): %d)", procList->count() ); 292 odebug << "QProcessManager: remove process (procList.count(): " << procList->count() << ")" << oendl;
294#endif 293#endif
295 cleanup(); 294 cleanup();
296} 295}
@@ -316,7 +315,7 @@ void QProcessManager::sigchldHnd( int fd )
316 char tmp; 315 char tmp;
317 ::read( fd, &tmp, sizeof(tmp) ); 316 ::read( fd, &tmp, sizeof(tmp) );
318#if defined(QT_QPROCESS_DEBUG) 317#if defined(QT_QPROCESS_DEBUG)
319 qDebug( "QProcessManager::sigchldHnd()" ); 318 odebug << "QProcessManager::sigchldHnd()" << oendl;
320#endif 319#endif
321 QProc *proc; 320 QProc *proc;
322 QProcess *process; 321 QProcess *process;
@@ -329,20 +328,20 @@ void QProcessManager::sigchldHnd( int fd )
329 if ( process != 0 ) { 328 if ( process != 0 ) {
330 if ( !process->isRunning() ) { 329 if ( !process->isRunning() ) {
331#if defined(QT_QPROCESS_DEBUG) 330#if defined(QT_QPROCESS_DEBUG)
332 qDebug( "QProcessManager::sigchldHnd() (PID: %d): process exited (QProcess available)", proc->pid ); 331 odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): process exited (QProcess available)" << oendl;
333#endif 332#endif
334 // read pending data 333 // read pending data
335 int nbytes = 0; 334 int nbytes = 0;
336 if ( ::ioctl(proc->socketStdout, FIONREAD, (char*)&nbytes)==0 && nbytes>0 ) { 335 if ( ::ioctl(proc->socketStdout, FIONREAD, (char*)&nbytes)==0 && nbytes>0 ) {
337#if defined(QT_QPROCESS_DEBUG) 336#if defined(QT_QPROCESS_DEBUG)
338 qDebug( "QProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stdout", proc->pid, nbytes ); 337 odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): reading " << nbytes << " bytes of pending data on stdout" << oendl;
339#endif 338#endif
340 process->socketRead( proc->socketStdout ); 339 process->socketRead( proc->socketStdout );
341 } 340 }
342 nbytes = 0; 341 nbytes = 0;
343 if ( ::ioctl(proc->socketStderr, FIONREAD, (char*)&nbytes)==0 && nbytes>0 ) { 342 if ( ::ioctl(proc->socketStderr, FIONREAD, (char*)&nbytes)==0 && nbytes>0 ) {
344#if defined(QT_QPROCESS_DEBUG) 343#if defined(QT_QPROCESS_DEBUG)
345 qDebug( "QProcessManager::sigchldHnd() (PID: %d): reading %d bytes of pending data on stderr", proc->pid, nbytes ); 344 odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): reading " << nbytes << " bytes of pending data on stderr" << oendl;
346#endif 345#endif
347 process->socketRead( proc->socketStderr ); 346 process->socketRead( proc->socketStderr );
348 } 347 }
@@ -356,7 +355,7 @@ void QProcessManager::sigchldHnd( int fd )
356 int status; 355 int status;
357 if ( ::waitpid( proc->pid, &status, WNOHANG ) == proc->pid ) { 356 if ( ::waitpid( proc->pid, &status, WNOHANG ) == proc->pid ) {
358#if defined(QT_QPROCESS_DEBUG) 357#if defined(QT_QPROCESS_DEBUG)
359 qDebug( "QProcessManager::sigchldHnd() (PID: %d): process exited (QProcess not available)", proc->pid ); 358 odebug << "QProcessManager::sigchldHnd() (PID: " << proc->pid << "): process exited (QProcess not available)" << oendl;
360#endif 359#endif
361 removeProc = TRUE; 360 removeProc = TRUE;
362 } 361 }
@@ -386,7 +385,7 @@ QProcessManager *QProcessPrivate::procManager = 0;
386QProcessPrivate::QProcessPrivate() 385QProcessPrivate::QProcessPrivate()
387{ 386{
388#if defined(QT_QPROCESS_DEBUG) 387#if defined(QT_QPROCESS_DEBUG)
389 qDebug( "QProcessPrivate: Constructor" ); 388 odebug << "QProcessPrivate: Constructor" << oendl;
390#endif 389#endif
391 stdinBufRead = 0; 390 stdinBufRead = 0;
392 391
@@ -403,7 +402,7 @@ QProcessPrivate::QProcessPrivate()
403QProcessPrivate::~QProcessPrivate() 402QProcessPrivate::~QProcessPrivate()
404{ 403{
405#if defined(QT_QPROCESS_DEBUG) 404#if defined(QT_QPROCESS_DEBUG)
406 qDebug( "QProcessPrivate: Destructor" ); 405 odebug << "QProcessPrivate: Destructor" << oendl;
407#endif 406#endif
408 407
409 if ( proc != 0 ) { 408 if ( proc != 0 ) {
@@ -599,7 +598,7 @@ QProcess::~QProcess()
599bool QProcess::start( QStringList *env ) 598bool QProcess::start( QStringList *env )
600{ 599{
601#if defined(QT_QPROCESS_DEBUG) 600#if defined(QT_QPROCESS_DEBUG)
602 qDebug( "QProcess::start()" ); 601 odebug << "QProcess::start()" << oendl;
603#endif 602#endif
604 reset(); 603 reset();
605 604
@@ -635,7 +634,7 @@ bool QProcess::start( QStringList *env )
635 arglistQ[i] = (*it).local8Bit(); 634 arglistQ[i] = (*it).local8Bit();
636 arglist[i] = arglistQ[i]; 635 arglist[i] = arglistQ[i];
637#if defined(QT_QPROCESS_DEBUG) 636#if defined(QT_QPROCESS_DEBUG)
638 qDebug( "QProcess::start(): arg %d = %s", i, arglist[i] ); 637 odebug << "QProcess::start(): arg " << i << " = " << arglist[i] << "" << oendl;
639#endif 638#endif
640 i++; 639 i++;
641 } 640 }
@@ -799,7 +798,7 @@ bool QProcess::start( QStringList *env )
799 798
800error: 799error:
801#if defined(QT_QPROCESS_DEBUG) 800#if defined(QT_QPROCESS_DEBUG)
802 qDebug( "QProcess::start(): error starting process" ); 801 odebug << "QProcess::start(): error starting process" << oendl;
803#endif 802#endif
804 if ( d->procManager ) 803 if ( d->procManager )
805 d->procManager->cleanup(); 804 d->procManager->cleanup();
@@ -878,7 +877,7 @@ bool QProcess::isRunning() const
878{ 877{
879 if ( d->exitValuesCalculated ) { 878 if ( d->exitValuesCalculated ) {
880#if defined(QT_QPROCESS_DEBUG) 879#if defined(QT_QPROCESS_DEBUG)
881 qDebug( "QProcess::isRunning(): FALSE (already computed)" ); 880 odebug << "QProcess::isRunning(): FALSE (already computed)" << oendl;
882#endif 881#endif
883 return FALSE; 882 return FALSE;
884 } 883 }
@@ -895,12 +894,12 @@ bool QProcess::isRunning() const
895 } 894 }
896 d->exitValuesCalculated = TRUE; 895 d->exitValuesCalculated = TRUE;
897#if defined(QT_QPROCESS_DEBUG) 896#if defined(QT_QPROCESS_DEBUG)
898 qDebug( "QProcess::isRunning() (PID: %d): FALSE", d->proc->pid ); 897 odebug << "QProcess::isRunning() (PID: " << d->proc->pid << "): FALSE" << oendl;
899#endif 898#endif
900 return FALSE; 899 return FALSE;
901 } 900 }
902#if defined(QT_QPROCESS_DEBUG) 901#if defined(QT_QPROCESS_DEBUG)
903 qDebug( "QProcess::isRunning() (PID: %d): TRUE", d->proc->pid ); 902 odebug << "QProcess::isRunning() (PID: " << d->proc->pid << "): TRUE" << oendl;
904#endif 903#endif
905 return TRUE; 904 return TRUE;
906} 905}
@@ -920,7 +919,7 @@ bool QProcess::isRunning() const
920void QProcess::writeToStdin( const QByteArray& buf ) 919void QProcess::writeToStdin( const QByteArray& buf )
921{ 920{
922#if defined(QT_QPROCESS_DEBUG) 921#if defined(QT_QPROCESS_DEBUG)
923// qDebug( "QProcess::writeToStdin(): write to stdin (%d)", d->socketStdin ); 922// odebug << "QProcess::writeToStdin(): write to stdin (" << d->socketStdin << ")" << oendl;
924#endif 923#endif
925 d->stdinBuf.enqueue( new QByteArray(buf) ); 924 d->stdinBuf.enqueue( new QByteArray(buf) );
926 if ( d->notifierStdin != 0 ) 925 if ( d->notifierStdin != 0 )
@@ -947,10 +946,10 @@ void QProcess::closeStdin()
947 delete d->notifierStdin; 946 delete d->notifierStdin;
948 d->notifierStdin = 0; 947 d->notifierStdin = 0;
949 if ( ::close( d->proc->socketStdin ) != 0 ) { 948 if ( ::close( d->proc->socketStdin ) != 0 ) {
950 qWarning( "Could not close stdin of child process" ); 949 owarn << "Could not close stdin of child process" << oendl;
951 } 950 }
952#if defined(QT_QPROCESS_DEBUG) 951#if defined(QT_QPROCESS_DEBUG)
953 qDebug( "QProcess::closeStdin(): stdin (%d) closed", d->proc->socketStdin ); 952 odebug << "QProcess::closeStdin(): stdin (" << d->proc->socketStdin << ") closed" << oendl;
954#endif 953#endif
955 d->proc->socketStdin = 0; 954 d->proc->socketStdin = 0;
956 } 955 }
@@ -970,7 +969,7 @@ void QProcess::socketRead( int fd )
970 return; 969 return;
971 } 970 }
972#if defined(QT_QPROCESS_DEBUG) 971#if defined(QT_QPROCESS_DEBUG)
973 qDebug( "QProcess::socketRead(): %d", fd ); 972 odebug << "QProcess::socketRead(): " << fd << "" << oendl;
974#endif 973#endif
975 if ( fd == 0 ) 974 if ( fd == 0 )
976 return; 975 return;
@@ -999,7 +998,7 @@ void QProcess::socketRead( int fd )
999 if ( n == 0 || n == -1 ) { 998 if ( n == 0 || n == -1 ) {
1000 if ( fd == d->proc->socketStdout ) { 999 if ( fd == d->proc->socketStdout ) {
1001#if defined(QT_QPROCESS_DEBUG) 1000#if defined(QT_QPROCESS_DEBUG)
1002 qDebug( "QProcess::socketRead(): stdout (%d) closed", fd ); 1001 odebug << "QProcess::socketRead(): stdout (" << fd << ") closed" << oendl;
1003#endif 1002#endif
1004 d->notifierStdout->setEnabled( FALSE ); 1003 d->notifierStdout->setEnabled( FALSE );
1005 delete d->notifierStdout; 1004 delete d->notifierStdout;
@@ -1009,7 +1008,7 @@ void QProcess::socketRead( int fd )
1009 return; 1008 return;
1010 } else if ( fd == d->proc->socketStderr ) { 1009 } else if ( fd == d->proc->socketStderr ) {
1011#if defined(QT_QPROCESS_DEBUG) 1010#if defined(QT_QPROCESS_DEBUG)
1012 qDebug( "QProcess::socketRead(): stderr (%d) closed", fd ); 1011 odebug << "QProcess::socketRead(): stderr (" << fd << ") closed" << oendl;
1013#endif 1012#endif
1014 d->notifierStderr->setEnabled( FALSE ); 1013 d->notifierStderr->setEnabled( FALSE );
1015 delete d->notifierStderr; 1014 delete d->notifierStderr;
@@ -1061,7 +1060,7 @@ void QProcess::socketWrite( int fd )
1061 return; 1060 return;
1062 } 1061 }
1063#if defined(QT_QPROCESS_DEBUG) 1062#if defined(QT_QPROCESS_DEBUG)
1064 qDebug( "QProcess::socketWrite(): write to stdin (%d)", fd ); 1063 odebug << "QProcess::socketWrite(): write to stdin (" << fd << ")" << oendl;
1065#endif 1064#endif
1066 ssize_t ret = ::write( fd, 1065 ssize_t ret = ::write( fd,
1067 d->stdinBuf.head()->data() + d->stdinBufRead, 1066 d->stdinBuf.head()->data() + d->stdinBufRead,
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp
index 2e9d2a9..a25963f 100644
--- a/core/launcher/runningappbar.cpp
+++ b/core/launcher/runningappbar.cpp
@@ -20,15 +20,19 @@
20 20
21#define QTOPIA_INTERNAL_PRELOADACCESS 21#define QTOPIA_INTERNAL_PRELOADACCESS
22 22
23#include "runningappbar.h"
24#include "serverinterface.h"
23 25
24#include <stdlib.h> 26/* OPIE */
27#include <opie2/odebug.h>
28#include <qtopia/qcopenvelope_qws.h>
29using namespace Opie::Core;
25 30
31/* QT */
26#include <qpainter.h> 32#include <qpainter.h>
27 33
28#include <qtopia/qcopenvelope_qws.h> 34/* STD */
29 35#include <stdlib.h>
30#include "runningappbar.h"
31#include "serverinterface.h"
32 36
33RunningAppBar::RunningAppBar(QWidget* parent) 37RunningAppBar::RunningAppBar(QWidget* parent)
34 : QFrame(parent), selectedAppIndex(-1) 38 : QFrame(parent), selectedAppIndex(-1)
@@ -51,7 +55,7 @@ void RunningAppBar::received(const QCString& msg, const QByteArray& data) {
51 if ( msg == "fastAppShowing(QString)") { 55 if ( msg == "fastAppShowing(QString)") {
52 QString appName; 56 QString appName;
53 stream >> appName; 57 stream >> appName;
54 // qDebug("fastAppShowing %s", appName.data() ); 58 // odebug << "fastAppShowing " << appName.data() << "" << oendl;
55 const AppLnk* f = ServerInterface::appLnks().findExec(appName); 59 const AppLnk* f = ServerInterface::appLnks().findExec(appName);
56 if ( f ) addTask(*f); 60 if ( f ) addTask(*f);
57 } else if ( msg == "fastAppHiding(QString)") { 61 } else if ( msg == "fastAppHiding(QString)") {
@@ -63,7 +67,7 @@ void RunningAppBar::received(const QCString& msg, const QByteArray& data) {
63} 67}
64 68
65void RunningAppBar::addTask(const AppLnk& appLnk) { 69void RunningAppBar::addTask(const AppLnk& appLnk) {
66 qDebug("Added %s to app list.", appLnk.name().latin1()); 70 odebug << "Added " << appLnk.name() << " to app list." << oendl;
67 AppLnk* newApp = new AppLnk(appLnk); 71 AppLnk* newApp = new AppLnk(appLnk);
68 newApp->setExec(appLnk.exec()); 72 newApp->setExec(appLnk.exec());
69 appList.prepend(newApp); 73 appList.prepend(newApp);
@@ -75,7 +79,7 @@ void RunningAppBar::removeTask(const AppLnk& appLnk) {
75 for (; i < appList.count() ; i++) { 79 for (; i < appList.count() ; i++) {
76 AppLnk* target = appList.at(i); 80 AppLnk* target = appList.at(i);
77 if (target->exec() == appLnk.exec()) { 81 if (target->exec() == appLnk.exec()) {
78 qDebug("Removing %s from app list.", appLnk.name().latin1()); 82 odebug << "Removing " << appLnk.name() << " from app list." << oendl;
79 appList.remove(); 83 appList.remove();
80 delete target; 84 delete target;
81 } 85 }
@@ -135,7 +139,7 @@ void RunningAppBar::paintEvent( QPaintEvent * )
135 for (; it.current(); i++, ++it ) { 139 for (; it.current(); i++, ++it ) {
136 if ( x + spacing <= width() ) { 140 if ( x + spacing <= width() ) {
137 curApp = it.current(); 141 curApp = it.current();
138 qWarning("Drawing %s", curApp->name().latin1() ); 142 owarn << "Drawing " << curApp->name() << "" << oendl;
139 if ( (int)i == selectedAppIndex ) 143 if ( (int)i == selectedAppIndex )
140 p.fillRect( x, y, spacing, curApp->pixmap().height()+1, colorGroup().highlight() ); 144 p.fillRect( x, y, spacing, curApp->pixmap().height()+1, colorGroup().highlight() );
141 else 145 else
@@ -153,7 +157,7 @@ QSize RunningAppBar::sizeHint() const
153 157
154void RunningAppBar::applicationLaunched(const QString &appName) 158void RunningAppBar::applicationLaunched(const QString &appName)
155{ 159{
156 qDebug("desktop:: app: %s launched with pid ", appName.data() ); 160 odebug << "desktop:: app: " << appName.data() << " launched with pid " << oendl;
157 const AppLnk* newGuy = ServerInterface::appLnks().findExec(appName); 161 const AppLnk* newGuy = ServerInterface::appLnks().findExec(appName);
158 if ( newGuy && !newGuy->isPreloaded() ) { 162 if ( newGuy && !newGuy->isPreloaded() ) {
159 addTask( *newGuy ); 163 addTask( *newGuy );
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp
index 6aaab3a..a7d23c4 100644
--- a/core/launcher/screensaver.cpp
+++ b/core/launcher/screensaver.cpp
@@ -158,7 +158,7 @@ void OpieScreenSaver::setIntervals ( int dim, int lightoff, int suspend )
158 m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false ); 158 m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false );
159 } 159 }
160 160
161 //qDebug("screen saver intervals: %d %d %d", dim, lightoff, suspend); 161 //odebug << "screen saver intervals: " << dim << " " << lightoff << " " << suspend << "" << oendl;
162 162
163 v [ 0 ] = QMAX( 1000 * dim, 100 ); 163 v [ 0 ] = QMAX( 1000 * dim, 100 );
164 v [ 1 ] = QMAX( 1000 * lightoff, 100 ); 164 v [ 1 ] = QMAX( 1000 * lightoff, 100 );
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 9a86a80..b9fa1e5 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -36,6 +36,10 @@
36#endif 36#endif
37#include "documentlist.h" 37#include "documentlist.h"
38 38
39/* OPIE */
40#include <opie2/odebug.h>
41#include <opie2/odevicebutton.h>
42#include <opie2/odevice.h>
39#include <qtopia/applnk.h> 43#include <qtopia/applnk.h>
40#include <qtopia/private/categories.h> 44#include <qtopia/private/categories.h>
41#include <qtopia/mimetype.h> 45#include <qtopia/mimetype.h>
@@ -43,28 +47,24 @@
43#include <qtopia/resource.h> 47#include <qtopia/resource.h>
44#include <qtopia/version.h> 48#include <qtopia/version.h>
45#include <qtopia/storage.h> 49#include <qtopia/storage.h>
46
47#include <qtopia/qcopenvelope_qws.h> 50#include <qtopia/qcopenvelope_qws.h>
48#include <qwindowsystem_qws.h>
49#include <qgfx_qws.h>
50#include <qtopia/global.h> 51#include <qtopia/global.h>
51//#include <qtopia/custom.h> 52using namespace Opie::Core;
52
53#include <opie2/odevicebutton.h>
54#include <opie2/odevice.h>
55 53
56#include <unistd.h> 54/* QT */
57#include <qmainwindow.h> 55#include <qmainwindow.h>
58#include <qmessagebox.h> 56#include <qmessagebox.h>
59#include <qtimer.h> 57#include <qtimer.h>
60#include <qtextstream.h> 58#include <qtextstream.h>
59#include <qwindowsystem_qws.h>
60#include <qgfx_qws.h>
61 61
62/* STD */
63#include <unistd.h>
62#include <stdlib.h> 64#include <stdlib.h>
63 65
64extern QRect qt_maxWindowRect; 66extern QRect qt_maxWindowRect;
65 67
66
67using namespace Opie::Core;
68static QWidget *calibrate(bool) 68static QWidget *calibrate(bool)
69{ 69{
70#ifdef Q_WS_QWS 70#ifdef Q_WS_QWS
@@ -329,7 +329,7 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
329 else if ( msg == "linkChanged(QString)" ) { 329 else if ( msg == "linkChanged(QString)" ) {
330 QString link; 330 QString link;
331 stream >> link; 331 stream >> link;
332 qDebug( "desktop.cpp systemMsg -> linkchanged( %s )", link.latin1() ); 332 odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
333 docList->linkChanged(link); 333 docList->linkChanged(link);
334 } else if ( msg == "serviceChanged(QString)" ) { 334 } else if ( msg == "serviceChanged(QString)" ) {
335 MimeType::updateApplications(); 335 MimeType::updateApplications();
@@ -434,7 +434,7 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
434 Config cfg( "qpe" ); 434 Config cfg( "qpe" );
435 cfg.setGroup("SyncDate"); 435 cfg.setGroup("SyncDate");
436 cfg.writeEntry( app, date ); 436 cfg.writeEntry( app, date );
437 //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1()); 437 //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl;
438 } else if ( msg == "startSync(QString)" ) { 438 } else if ( msg == "startSync(QString)" ) {
439 QString what; 439 QString what;
440 stream >> what; 440 stream >> what;
@@ -572,7 +572,7 @@ bool Server::mkdir(const QString &localPath)
572 572
573 // didn't find any seps; weird, use the cur dir instead 573 // didn't find any seps; weird, use the cur dir instead
574 if (dirIndex == -1) { 574 if (dirIndex == -1) {
575 //qDebug("No seperators found in path %s", localPath.latin1()); 575 //odebug << "No seperators found in path " << localPath << "" << oendl;
576 checkedPath = QDir::currentDirPath(); 576 checkedPath = QDir::currentDirPath();
577 } 577 }
578 578
@@ -589,10 +589,10 @@ bool Server::mkdir(const QString &localPath)
589 589
590 QDir checkDir(checkedPath); 590 QDir checkDir(checkedPath);
591 if (!checkDir.exists()) { 591 if (!checkDir.exists()) {
592 //qDebug("mkdir making dir %s", checkedPath.latin1()); 592 //odebug << "mkdir making dir " << checkedPath << "" << oendl;
593 593
594 if (!checkDir.mkdir(checkedPath)) { 594 if (!checkDir.mkdir(checkedPath)) {
595 qDebug("Unable to make directory %s", checkedPath.latin1()); 595 odebug << "Unable to make directory " << checkedPath << "" << oendl;
596 return FALSE; 596 return FALSE;
597 } 597 }
598 } 598 }
@@ -670,7 +670,7 @@ void Server::terminateServers()
670 670
671void Server::syncConnectionClosed( const QHostAddress & ) 671void Server::syncConnectionClosed( const QHostAddress & )
672{ 672{
673 qDebug( "Lost sync connection" ); 673 odebug << "Lost sync connection" << oendl;
674 delete syncDialog; 674 delete syncDialog;
675 syncDialog = 0; 675 syncDialog = 0;
676} 676}
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index e4e16f2..cf543ce 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -19,9 +19,11 @@
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "serverapp.h" 21#include "serverapp.h"
22#include "screensaver.h"
22 23
24/* OPIE */
25#include <opie2/odebug.h>
23#include <opie2/odevice.h> 26#include <opie2/odevice.h>
24
25#include <qtopia/password.h> 27#include <qtopia/password.h>
26#include <qtopia/config.h> 28#include <qtopia/config.h>
27#include <qtopia/power.h> 29#include <qtopia/power.h>
@@ -30,32 +32,30 @@
30#include <qtopia/qcopenvelope_qws.h> 32#include <qtopia/qcopenvelope_qws.h>
31#endif 33#endif
32#include <qtopia/global.h> 34#include <qtopia/global.h>
33//#include <qtopia/custom.h> 35using namespace Opie::Core;
34 36
37/* QT */
35#ifdef Q_WS_QWS 38#ifdef Q_WS_QWS
36#include <qgfx_qws.h> 39#include <qgfx_qws.h>
37#endif 40#endif
38#ifdef Q_OS_WIN32
39#include <io.h>
40#include <process.h>
41#else
42#include <unistd.h>
43#endif
44#include <qmessagebox.h> 41#include <qmessagebox.h>
45#include <qtimer.h> 42#include <qtimer.h>
46#include <qpainter.h> 43#include <qpainter.h>
47#include <qfile.h> 44#include <qfile.h>
48#include <qpixmapcache.h> 45#include <qpixmapcache.h>
49 46
47/* STD */
48#ifdef Q_OS_WIN32
49#include <io.h>
50#include <process.h>
51#else
52#include <unistd.h>
53#endif
50#include <stdlib.h> 54#include <stdlib.h>
51#include "screensaver.h"
52 55
53static ServerApplication *serverApp = 0; 56static ServerApplication *serverApp = 0;
54static int loggedin=0; 57static int loggedin=0;
55 58
56using namespace Opie;
57
58using namespace Opie::Core;
59QCopKeyRegister::QCopKeyRegister() 59QCopKeyRegister::QCopKeyRegister()
60 : m_keyCode( 0 ) { 60 : m_keyCode( 0 ) {
61} 61}
@@ -856,7 +856,7 @@ bool ServerApplication::isStarting()
856int ServerApplication::exec() 856int ServerApplication::exec()
857{ 857{
858 ms_is_starting = true; 858 ms_is_starting = true;
859 qDebug("Serverapp - exec"); 859 odebug << "Serverapp - exec" << oendl;
860 return QPEApplication::exec(); 860 return QPEApplication::exec();
861} 861}
862 862
diff --git a/core/launcher/suspendmonitor.cpp b/core/launcher/suspendmonitor.cpp
index f555e84..50bc56f 100644
--- a/core/launcher/suspendmonitor.cpp
+++ b/core/launcher/suspendmonitor.cpp
@@ -50,7 +50,7 @@ void TempScreenSaverMonitor::setTempMode(int mode, int pid)
50 case QPEApplication::Enable: 50 case QPEApplication::Enable:
51 break; 51 break;
52 default: 52 default:
53 qWarning("Unrecognized temp power setting. Ignored"); 53 owarn << "Unrecognized temp power setting. Ignored" << oendl;
54 return; 54 return;
55 } 55 }
56 updateAll(); 56 updateAll();
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp
index 6cc1446..3c72d25 100644
--- a/core/launcher/systray.cpp
+++ b/core/launcher/systray.cpp
@@ -18,24 +18,22 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "systray.h"
22
23/* OPIE */
24#include <opie2/odebug.h>
21#include <qtopia/qpeapplication.h> 25#include <qtopia/qpeapplication.h>
22#include <qtopia/qlibrary.h> 26#include <qtopia/qlibrary.h>
23#include <qtopia/config.h> 27#include <qtopia/config.h>
28using namespace Opie::Core;
24 29
30/* QT */
25#include <qlayout.h> 31#include <qlayout.h>
26#include <qdir.h> 32#include <qdir.h>
27 33
28#include "systray.h" 34/* STD */
29
30#include <stdlib.h> 35#include <stdlib.h>
31 36
32/* ### Single build floppies ### */
33#if 0
34#ifdef QT_NO_COMPONENTS
35#include "../plugins/applets/clockapplet/clockappletimpl.h"
36#endif
37#endif
38
39SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0) 37SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0)
40{ 38{
41 //setFrameStyle( QFrame::Panel | QFrame::Sunken ); 39 //setFrameStyle( QFrame::Panel | QFrame::Sunken );
@@ -112,7 +110,7 @@ void SysTray::addApplets()
112 for ( it = list.begin(); it != list.end(); ++it ) { 110 for ( it = list.begin(); it != list.end(); ++it ) {
113 if ( exclude.find( *it ) != exclude.end() ) 111 if ( exclude.find( *it ) != exclude.end() )
114 continue; 112 continue;
115 qWarning( "Found Applet: %s", (*it).latin1() ); 113 owarn << "Found Applet: " << (*it) << "" << oendl;
116 TaskbarAppletInterface *iface = 0; 114 TaskbarAppletInterface *iface = 0;
117 QLibrary *lib = new QLibrary( path + "/" + *it ); 115 QLibrary *lib = new QLibrary( path + "/" + *it );
118 if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 116 if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 91e2f20..86e0d0d 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -28,14 +28,17 @@
28#include "taskbar.h" 28#include "taskbar.h"
29#include "server.h" 29#include "server.h"
30 30
31/* OPIE */
32#include <opie2/odebug.h>
31#include <qtopia/config.h> 33#include <qtopia/config.h>
32#include <qtopia/qpeapplication.h> 34#include <qtopia/qpeapplication.h>
33#ifdef QWS 35#ifdef QWS
34#include <qtopia/qcopenvelope_qws.h> 36#include <qtopia/qcopenvelope_qws.h>
35#endif 37#endif
36#include <qtopia/global.h> 38#include <qtopia/global.h>
37//#include <qtopia/custom.h> 39using namespace Opie::Core;
38 40
41/* QT */
39#include <qlabel.h> 42#include <qlabel.h>
40#include <qlayout.h> 43#include <qlayout.h>
41#include <qtimer.h> 44#include <qtimer.h>
@@ -285,7 +288,7 @@ void TaskBar::resizeEvent( QResizeEvent *e )
285 if ( sysTray ) 288 if ( sysTray )
286 sysTray->show(); 289 sysTray->show();
287 290
288 qWarning("TaskBar::resize event"); 291 owarn << "TaskBar::resize event" << oendl;
289} 292}
290 293
291void TaskBar::styleChange( QStyle &s ) 294void TaskBar::styleChange( QStyle &s )
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index e32cf41..4b764e3 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -17,11 +17,25 @@
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20//#define _XOPEN_SOURCE 20#include "transferserver.h"
21 21
22/* OPIE */
23#include <opie2/odebug.h>
22#include <opie2/oglobal.h> 24#include <opie2/oglobal.h>
25#include <qtopia/qprocess.h>
26#include <qtopia/process.h>
27#include <qtopia/private/contact.h>
28#include <qtopia/version.h>
29#ifdef Q_WS_QWS
30#include <qtopia/qcopenvelope_qws.h>
31#endif
32using namespace Opie::Core;
23 33
24#ifndef Q_OS_WIN32 34/* QT */
35#include <qtextstream.h>
36#include <qmessagebox.h>
37
38/* STD */
25#include <pwd.h> 39#include <pwd.h>
26#include <sys/types.h> 40#include <sys/types.h>
27#include <unistd.h> 41#include <unistd.h>
@@ -33,40 +47,15 @@
33#include <crypt.h> 47#include <crypt.h>
34#endif /* Q_OS_MACX */ 48#endif /* Q_OS_MACX */
35 49
36#else
37#include <stdlib.h>
38#include <time.h>
39#endif
40
41
42#if defined(_OS_LINUX_)
43#include <shadow.h>
44#endif
45
46#include <qtextstream.h>
47#include <qmessagebox.h>
48//#include <qtopia/qcopchannel_qws.h>
49#include <qtopia/process.h>
50#include <qtopia/private/contact.h>
51#include <qtopia/version.h>
52#ifdef Q_WS_QWS
53#include <qtopia/qcopenvelope_qws.h>
54#endif
55
56
57#include "transferserver.h"
58#include <qtopia/qprocess.h>
59
60const int block_size = 51200; 50const int block_size = 51200;
61 51
62using namespace Opie::Core;
63TransferServer::TransferServer( Q_UINT16 port, QObject *parent, 52TransferServer::TransferServer( Q_UINT16 port, QObject *parent,
64 const char* name) 53 const char* name)
65 : QServerSocket( port, 1, parent, name ) 54 : QServerSocket( port, 1, parent, name )
66{ 55{
67 connections.setAutoDelete( TRUE ); 56 connections.setAutoDelete( TRUE );
68 if ( !ok() ) 57 if ( !ok() )
69 qWarning( "Failed to bind to port %d", port ); 58 owarn << "Failed to bind to port " << port << "" << oendl;
70} 59}
71 60
72void TransferServer::authorizeConnections() 61void TransferServer::authorizeConnections()
@@ -371,7 +360,7 @@ bool ServerPI::verifyAuthorised()
371 360
372void ServerPI::connectionClosed() 361void ServerPI::connectionClosed()
373{ 362{
374 // qDebug( "Debug: Connection closed" ); 363 // odebug << "Debug: Connection closed" << oendl;
375 emit connectionClosed(this); 364 emit connectionClosed(this);
376} 365}
377 366
@@ -379,7 +368,7 @@ void ServerPI::send( const QString& msg )
379{ 368{
380 QTextStream os( this ); 369 QTextStream os( this );
381 os << msg << endl; 370 os << msg << endl;
382 //qDebug( "Reply: %s", msg.latin1() ); 371 //odebug << "Reply: " << msg << "" << oendl;
383} 372}
384 373
385void ServerPI::read() 374void ServerPI::read()
@@ -420,7 +409,7 @@ bool ServerPI::checkWriteFile( const QString& file )
420 409
421void ServerPI::process( const QString& message ) 410void ServerPI::process( const QString& message )
422{ 411{
423 //qDebug( "Command: %s", message.latin1() ); 412 //odebug << "Command: " << message << "" << oendl;
424 413
425 // split message using "," as separator 414 // split message using "," as separator
426 QStringList msg = QStringList::split( " ", message ); 415 QStringList msg = QStringList::split( " ", message );
@@ -444,7 +433,7 @@ void ServerPI::process( const QString& message )
444 args = copy.join( " " ); 433 args = copy.join( " " );
445 } 434 }
446 435
447 //qDebug( "args: %s", args.latin1() ); 436 //odebug << "args: " << args << "" << oendl;
448 437
449 // we always respond to QUIT, regardless of state 438 // we always respond to QUIT, regardless of state
450 if ( cmd == "QUIT" ) { 439 if ( cmd == "QUIT" ) {
@@ -583,7 +572,7 @@ void ServerPI::process( const QString& message )
583 sendFile( absFilePath( args ) ); 572 sendFile( absFilePath( args ) );
584 } 573 }
585 else { 574 else {
586 qDebug("550 Requested action not taken"); 575 odebug << "550 Requested action not taken" << oendl;
587 send( "550 Requested action not taken" ); // No tr 576 send( "550 Requested action not taken" ); // No tr
588 } 577 }
589 578
@@ -689,7 +678,7 @@ void ServerPI::process( const QString& message )
689 // make directory (MKD) 678 // make directory (MKD)
690 else if ( cmd == "MKD" ) { 679 else if ( cmd == "MKD" ) {
691 if ( args.isEmpty() ) { 680 if ( args.isEmpty() ) {
692 qDebug(" Error: no arg"); 681 odebug << " Error: no arg" << oendl;
693 send( "500 Syntax error, command unrecognized" ); // No tr 682 send( "500 Syntax error, command unrecognized" ); // No tr
694 } 683 }
695 else { 684 else {
@@ -729,7 +718,7 @@ void ServerPI::process( const QString& message )
729 duproc.addArgument("-s"); 718 duproc.addArgument("-s");
730 QString in, out; 719 QString in, out;
731 if ( !duproc.exec(in, out) ) { 720 if ( !duproc.exec(in, out) ) {
732 qDebug("du process failed; just sending back 1K"); 721 odebug << "du process failed; just sending back 1K" << oendl;
733 send( "213 1024"); 722 send( "213 1024");
734 } 723 }
735 else { 724 else {
@@ -737,7 +726,7 @@ void ServerPI::process( const QString& message )
737 int guess = size.toInt()/5; 726 int guess = size.toInt()/5;
738 if ( filePath.contains("doc") ) // No tr 727 if ( filePath.contains("doc") ) // No tr
739 guess *= 1000; 728 guess *= 1000;
740 qDebug("sending back gzip guess of %d", guess); 729 odebug << "sending back gzip guess of " << guess << "" << oendl;
741 send( "213 " + QString::number(guess) ); 730 send( "213 " + QString::number(guess) );
742 } 731 }
743 } 732 }
@@ -1026,7 +1015,7 @@ QString ServerPI::permissionString( QFileInfo *info )
1026 1015
1027void ServerPI::newConnection( int socket ) 1016void ServerPI::newConnection( int socket )
1028{ 1017{
1029 //qDebug( "New incomming connection" ); 1018 //odebug << "New incomming connection" << oendl;
1030 1019
1031 if ( !passiv ) return; 1020 if ( !passiv ) return;
1032 1021
@@ -1039,7 +1028,7 @@ void ServerPI::newConnection( int socket )
1039 dtp->setSocket( socket ); 1028 dtp->setSocket( socket );
1040 } 1029 }
1041 else if ( wait[RetrieveFile] ) { 1030 else if ( wait[RetrieveFile] ) {
1042 qDebug("check retrieve file"); 1031 odebug << "check retrieve file" << oendl;
1043 if ( backupRestoreGzip( waitfile ) ) 1032 if ( backupRestoreGzip( waitfile ) )
1044 dtp->retrieveGzipFile( waitfile ); 1033 dtp->retrieveGzipFile( waitfile );
1045 else 1034 else
@@ -1051,7 +1040,7 @@ void ServerPI::newConnection( int socket )
1051 dtp->setSocket( socket ); 1040 dtp->setSocket( socket );
1052 } 1041 }
1053 else if ( wait[RetrieveByteArray] ) { 1042 else if ( wait[RetrieveByteArray] ) {
1054 qDebug("retrieve byte array"); 1043 odebug << "retrieve byte array" << oendl;
1055 dtp->retrieveByteArray(); 1044 dtp->retrieveByteArray();
1056 dtp->setSocket( socket ); 1045 dtp->setSocket( socket );
1057 } 1046 }
@@ -1111,7 +1100,7 @@ ServerDTP::~ServerDTP()
1111 // We're being shutdown before the client closed. 1100 // We're being shutdown before the client closed.
1112 file.close(); 1101 file.close();
1113 if ( recvFileSize >= 0 && (int)file.size() != recvFileSize ) { 1102 if ( recvFileSize >= 0 && (int)file.size() != recvFileSize ) {
1114 qDebug( "STOR incomplete" ); 1103 odebug << "STOR incomplete" << oendl;
1115 file.remove(); 1104 file.remove();
1116 } 1105 }
1117 } else { 1106 } else {
@@ -1122,7 +1111,7 @@ ServerDTP::~ServerDTP()
1122 1111
1123void ServerDTP::extractTarDone() 1112void ServerDTP::extractTarDone()
1124{ 1113{
1125 qDebug("extract done"); 1114 odebug << "extract done" << oendl;
1126#ifndef QT_NO_COP 1115#ifndef QT_NO_COP
1127 QCopEnvelope e( "QPE/System", "restoreDone(QString)" ); 1116 QCopEnvelope e( "QPE/System", "restoreDone(QString)" );
1128 e << file.name(); 1117 e << file.name();
@@ -1140,7 +1129,7 @@ void ServerDTP::connected()
1140 return; 1129 return;
1141 } 1130 }
1142 1131
1143 //qDebug( "Debug: Sending file '%s'", file.name().latin1() ); 1132 //odebug << "Debug: Sending file '" << file.name() << "'" << oendl;
1144 1133
1145 bytes_written = 0; 1134 bytes_written = 0;
1146 if ( file.size() == 0 ) { 1135 if ( file.size() == 0 ) {
@@ -1161,12 +1150,12 @@ void ServerDTP::connected()
1161 case SendGzipFile: 1150 case SendGzipFile:
1162 if ( createTargzProc->isRunning() ) { 1151 if ( createTargzProc->isRunning() ) {
1163 // SHOULDN'T GET HERE, BUT DOING A SAFETY CHECK ANYWAY 1152 // SHOULDN'T GET HERE, BUT DOING A SAFETY CHECK ANYWAY
1164 qWarning("Previous tar --gzip process is still running; killing it..."); 1153 owarn << "Previous tar --gzip process is still running; killing it..." << oendl;
1165 createTargzProc->kill(); 1154 createTargzProc->kill();
1166 } 1155 }
1167 1156
1168 bytes_written = 0; 1157 bytes_written = 0;
1169 qDebug("==>start send tar process"); 1158 odebug << "==>start send tar process" << oendl;
1170 if ( !createTargzProc->start() ) 1159 if ( !createTargzProc->start() )
1171 qWarning("Error starting %s", 1160 qWarning("Error starting %s",
1172 createTargzProc->arguments().join(" ").latin1()); 1161 createTargzProc->arguments().join(" ").latin1());
@@ -1178,7 +1167,7 @@ void ServerDTP::connected()
1178 return; 1167 return;
1179 } 1168 }
1180 1169
1181 // qDebug( "Debug: Sending byte array" ); 1170 // odebug << "Debug: Sending byte array" << oendl;
1182 bytes_written = 0; 1171 bytes_written = 0;
1183 while( !buf.atEnd() ) 1172 while( !buf.atEnd() )
1184 putch( buf.getch() ); 1173 putch( buf.getch() );
@@ -1197,10 +1186,10 @@ void ServerDTP::connected()
1197 mode = Idle; 1186 mode = Idle;
1198 return; 1187 return;
1199 } 1188 }
1200 // qDebug( "Debug: Retrieving file %s", file.name().latin1() ); 1189 // odebug << "Debug: Retrieving file " << file.name() << "" << oendl;
1201 break; 1190 break;
1202 case RetrieveGzipFile: 1191 case RetrieveGzipFile:
1203 qDebug("=-> starting tar process to receive .tgz file"); 1192 odebug << "=-> starting tar process to receive .tgz file" << oendl;
1204 break; 1193 break;
1205 case RetrieveBuffer: 1194 case RetrieveBuffer:
1206 // retrieve buffer mode 1195 // retrieve buffer mode
@@ -1209,17 +1198,17 @@ void ServerDTP::connected()
1209 mode = Idle; 1198 mode = Idle;
1210 return; 1199 return;
1211 } 1200 }
1212 // qDebug( "Debug: Retrieving byte array" ); 1201 // odebug << "Debug: Retrieving byte array" << oendl;
1213 break; 1202 break;
1214 case Idle: 1203 case Idle:
1215 qDebug("connection established but mode set to Idle; BUG!"); 1204 odebug << "connection established but mode set to Idle; BUG!" << oendl;
1216 break; 1205 break;
1217 } 1206 }
1218} 1207}
1219 1208
1220void ServerDTP::connectionClosed() 1209void ServerDTP::connectionClosed()
1221{ 1210{
1222 //qDebug( "Debug: Data connection closed %ld bytes written", bytes_written ); 1211 //odebug << "Debug: Data connection closed " << bytes_written << " bytes written" << oendl;
1223 1212
1224 // send file mode 1213 // send file mode
1225 if ( SendFile == mode ) { 1214 if ( SendFile == mode ) {
@@ -1241,7 +1230,7 @@ void ServerDTP::connectionClosed()
1241 else if ( RetrieveFile == mode ) { 1230 else if ( RetrieveFile == mode ) {
1242 file.close(); 1231 file.close();
1243 if ( recvFileSize >= 0 && (int)file.size() != recvFileSize ) { 1232 if ( recvFileSize >= 0 && (int)file.size() != recvFileSize ) {
1244 qDebug( "STOR incomplete" ); 1233 odebug << "STOR incomplete" << oendl;
1245 file.remove(); 1234 file.remove();
1246 emit failed(); 1235 emit failed();
1247 } else { 1236 } else {
@@ -1250,7 +1239,7 @@ void ServerDTP::connectionClosed()
1250 } 1239 }
1251 1240
1252 else if ( RetrieveGzipFile == mode ) { 1241 else if ( RetrieveGzipFile == mode ) {
1253 qDebug("Done writing ungzip file; closing input"); 1242 odebug << "Done writing ungzip file; closing input" << oendl;
1254 retrieveTargzProc->flushStdin(); 1243 retrieveTargzProc->flushStdin();
1255 retrieveTargzProc->closeStdin(); 1244 retrieveTargzProc->closeStdin();
1256 } 1245 }
@@ -1272,7 +1261,7 @@ void ServerDTP::bytesWritten( int bytes )
1272 if ( SendFile == mode ) { 1261 if ( SendFile == mode ) {
1273 1262
1274 if ( bytes_written == file.size() ) { 1263 if ( bytes_written == file.size() ) {
1275 // qDebug( "Debug: Sending complete: %d bytes", file.size() ); 1264 // odebug << "Debug: Sending complete: " << file.size() << " bytes" << oendl;
1276 file.close(); 1265 file.close();
1277 emit completed(); 1266 emit completed();
1278 mode = Idle; 1267 mode = Idle;
@@ -1289,7 +1278,7 @@ void ServerDTP::bytesWritten( int bytes )
1289 if ( SendBuffer == mode ) { 1278 if ( SendBuffer == mode ) {
1290 1279
1291 if ( bytes_written == buf.size() ) { 1280 if ( bytes_written == buf.size() ) {
1292 // qDebug( "Debug: Sending complete: %d bytes", buf.size() ); 1281 // odebug << "Debug: Sending complete: " << buf.size() << " bytes" << oendl;
1293 emit completed(); 1282 emit completed();
1294 mode = Idle; 1283 mode = Idle;
1295 } 1284 }
@@ -1313,7 +1302,7 @@ void ServerDTP::readyRead()
1313 s.resize( bytesAvailable() ); 1302 s.resize( bytesAvailable() );
1314 readBlock( s.data(), bytesAvailable() ); 1303 readBlock( s.data(), bytesAvailable() );
1315 retrieveTargzProc->writeToStdin( s ); 1304 retrieveTargzProc->writeToStdin( s );
1316 qDebug("wrote %d bytes to ungzip ", s.size() ); 1305 odebug << "wrote " << s.size() << " bytes to ungzip " << oendl;
1317 } 1306 }
1318 // retrieve buffer mode 1307 // retrieve buffer mode
1319 else if ( RetrieveBuffer == mode ) { 1308 else if ( RetrieveBuffer == mode ) {
@@ -1328,12 +1317,12 @@ void ServerDTP::writeTargzBlock()
1328{ 1317{
1329 QByteArray block = createTargzProc->readStdout(); 1318 QByteArray block = createTargzProc->readStdout();
1330 writeBlock( block.data(), block.size() ); 1319 writeBlock( block.data(), block.size() );
1331 qDebug("writeTargzBlock %d", block.size()); 1320 odebug << "writeTargzBlock " << block.size() << "" << oendl;
1332} 1321}
1333 1322
1334void ServerDTP::targzDone() 1323void ServerDTP::targzDone()
1335{ 1324{
1336 qDebug("tar and gzip done"); 1325 odebug << "tar and gzip done" << oendl;
1337 emit completed(); 1326 emit completed();
1338 mode = Idle; 1327 mode = Idle;
1339 disconnect( createTargzProc, SIGNAL( readyReadStdout() ), 1328 disconnect( createTargzProc, SIGNAL( readyReadStdout() ),
@@ -1370,7 +1359,7 @@ void ServerDTP::sendGzipFile( const QString &fn,
1370 QStringList args = "targzip"; 1359 QStringList args = "targzip";
1371 //args += "-cv"; 1360 //args += "-cv";
1372 args += archiveTargets; 1361 args += archiveTargets;
1373 qDebug("sendGzipFile %s", args.join(" ").latin1() ); 1362 odebug << "sendGzipFile " << args.join(" ") << "" << oendl;
1374 createTargzProc->setArguments( args ); 1363 createTargzProc->setArguments( args );
1375 connect( createTargzProc, 1364 connect( createTargzProc,
1376 SIGNAL( readyReadStdout() ), SLOT( writeTargzBlock() ) ); 1365 SIGNAL( readyReadStdout() ), SLOT( writeTargzBlock() ) );
@@ -1393,7 +1382,7 @@ void ServerDTP::retrieveFile( const QString fn, int fileSize )
1393 1382
1394void ServerDTP::retrieveGzipFile( const QString &fn ) 1383void ServerDTP::retrieveGzipFile( const QString &fn )
1395{ 1384{
1396 qDebug("retrieveGzipFile %s", fn.latin1()); 1385 odebug << "retrieveGzipFile " << fn << "" << oendl;
1397 file.setName( fn ); 1386 file.setName( fn );
1398 mode = RetrieveGzipFile; 1387 mode = RetrieveGzipFile;
1399 1388