summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/applauncher.cpp11
-rw-r--r--core/launcher/config.in6
-rw-r--r--core/launcher/documentlist.cpp11
-rw-r--r--core/launcher/main.cpp9
-rw-r--r--core/launcher/qcopbridge.cpp7
-rw-r--r--core/launcher/screensaver.cpp2
-rw-r--r--core/launcher/server.cpp4
-rw-r--r--core/launcher/server.pro7
-rw-r--r--core/launcher/startmenu.cpp2
-rw-r--r--core/launcher/transferserver.cpp5
-rw-r--r--core/launcher/wait.cpp2
11 files changed, 34 insertions, 32 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index 0db99dd..f161e98 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -6,83 +6,82 @@
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef QTOPIA_INTERNAL_PRELOADACCESS 21#ifndef QTOPIA_INTERNAL_PRELOADACCESS
22#define QTOPIA_INTERNAL_PRELOADACCESS 22#define QTOPIA_INTERNAL_PRELOADACCESS
23#endif 23#endif
24#ifndef QTOPIA_INTERNAL_FILEOPERATIONS 24#ifndef QTOPIA_INTERNAL_FILEOPERATIONS
25#define QTOPIA_INTERNAL_FILEOPERATIONS 25#define QTOPIA_INTERNAL_FILEOPERATIONS
26#endif 26#endif
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#include <qtopia/global.h> 30#include <opie2/oglobal.h>
31 31
32#ifndef Q_OS_WIN32 32#ifndef Q_OS_WIN32
33#include <sys/stat.h> 33#include <sys/stat.h>
34#include <sys/wait.h> 34#include <sys/wait.h>
35#include <sys/file.h> 35#include <sys/file.h>
36#include <unistd.h> 36#include <unistd.h>
37#include <sys/time.h> 37#include <sys/time.h>
38#include <sys/resource.h> 38#include <sys/resource.h>
39#include <errno.h> 39#include <errno.h>
40#else 40#else
41#include <process.h> 41#include <process.h>
42#include <windows.h> 42#include <windows.h>
43#include <winbase.h> 43#include <winbase.h>
44#endif 44#endif
45 45
46#include <signal.h> 46#include <signal.h>
47#include <sys/types.h> 47#include <sys/types.h>
48#include <stdlib.h> 48#include <stdlib.h>
49 49
50#include <qtimer.h> 50#include <qtimer.h>
51#include <qwindowsystem_qws.h> 51#include <qwindowsystem_qws.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qfile.h> 53#include <qfile.h>
54#include <qfileinfo.h> 54#include <qfileinfo.h>
55 55
56#include <qtopia/qcopenvelope_qws.h> 56#include <qtopia/qcopenvelope_qws.h>
57#include <qtopia/applnk.h> 57#include <qtopia/applnk.h>
58#include <qtopia/qpeapplication.h> 58#include <qtopia/qpeapplication.h>
59#include <qtopia/config.h> 59#include <qtopia/config.h>
60#include <qtopia/global.h> 60#include <qtopia/global.h>
61 61
62#include "applauncher.h" 62#include "applauncher.h"
63#include "documentlist.h" 63#include "documentlist.h"
64#include "launcherglobal.h"
65 64
66const int AppLauncher::RAISE_TIMEOUT_MS = 5000; 65const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
67 66
68//--------------------------------------------------------------------------- 67//---------------------------------------------------------------------------
69 68
70static AppLauncher* appLauncherPtr; 69static AppLauncher* appLauncherPtr;
71 70
72const int appStopEventID = 1290; 71const int appStopEventID = 1290;
73 72
74class AppStoppedEvent : public QCustomEvent 73class AppStoppedEvent : public QCustomEvent
75{ 74{
76public: 75public:
77 AppStoppedEvent(int pid, int status) 76 AppStoppedEvent(int pid, int status)
78 : QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { } 77 : QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { }
79 78
80 int pid() { return mPid; } 79 int pid() { return mPid; }
81 int status() { return mStatus; } 80 int status() { return mStatus; }
82 81
83private: 82private:
84 int mPid, mStatus; 83 int mPid, mStatus;
85}; 84};
86 85
87AppLauncher::AppLauncher(QObject *parent, const char *name) 86AppLauncher::AppLauncher(QObject *parent, const char *name)
88 : QObject(parent, name), qlPid(0), qlReady(FALSE), 87 : QObject(parent, name), qlPid(0), qlReady(FALSE),
@@ -383,92 +382,92 @@ void AppLauncher::sigStopped(int sigPid, int sigStatus)
383 switch( exitStatus ) { 382 switch( exitStatus ) {
384 case SIGABRT: sig = "SIGABRT"; break; 383 case SIGABRT: sig = "SIGABRT"; break;
385 case SIGALRM: sig = "SIGALRM"; break; 384 case SIGALRM: sig = "SIGALRM"; break;
386 case SIGBUS: sig = "SIGBUS"; break; 385 case SIGBUS: sig = "SIGBUS"; break;
387 case SIGFPE: sig = "SIGFPE"; break; 386 case SIGFPE: sig = "SIGFPE"; break;
388 case SIGHUP: sig = "SIGHUP"; break; 387 case SIGHUP: sig = "SIGHUP"; break;
389 case SIGILL: sig = "SIGILL"; break; 388 case SIGILL: sig = "SIGILL"; break;
390 case SIGKILL: sig = "SIGKILL"; break; 389 case SIGKILL: sig = "SIGKILL"; break;
391 case SIGPIPE: sig = "SIGPIPE"; break; 390 case SIGPIPE: sig = "SIGPIPE"; break;
392 case SIGQUIT: sig = "SIGQUIT"; break; 391 case SIGQUIT: sig = "SIGQUIT"; break;
393 case SIGSEGV: sig = "SIGSEGV"; break; 392 case SIGSEGV: sig = "SIGSEGV"; break;
394 case SIGTERM: sig = "SIGTERM"; break; 393 case SIGTERM: sig = "SIGTERM"; break;
395 case SIGTRAP: sig = "SIGTRAP"; break; 394 case SIGTRAP: sig = "SIGTRAP"; break;
396 default: sig = QString("Unkown %1").arg(exitStatus); 395 default: sig = QString("Unkown %1").arg(exitStatus);
397 } 396 }
398 if ( preloadDisabled ) 397 if ( preloadDisabled )
399 sig += tr("<qt><p>Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.</qt>"); 398 sig += tr("<qt><p>Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.</qt>");
400 399
401 QString str = tr("<qt><b>%1</b> was terminated due to signal code %2</qt>").arg( app->name() ).arg( sig ); 400 QString str = tr("<qt><b>%1</b> was terminated due to signal code %2</qt>").arg( app->name() ).arg( sig );
402 QMessageBox::information(0, tr("Application terminated"), str ); 401 QMessageBox::information(0, tr("Application terminated"), str );
403 } else { 402 } else {
404 if ( exitStatus == 255 ) { //could not find app (because global returns -1) 403 if ( exitStatus == 255 ) { //could not find app (because global returns -1)
405 QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) ); 404 QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) );
406 } else { 405 } else {
407 QFileInfo fi(Opie::Global::tempDir() + "qcop-msg-" + appName); 406 QFileInfo fi(OGlobal::tempDirPath() + "qcop-msg-" + appName);
408 if ( fi.exists() && fi.size() ) { 407 if ( fi.exists() && fi.size() ) {
409 emit terminated(sigPid, appName); 408 emit terminated(sigPid, appName);
410 qWarning("Re executing obmitted for %s", appName.latin1() ); 409 qWarning("Re executing obmitted for %s", appName.latin1() );
411 // execute( appName, QString::null ); 410 // execute( appName, QString::null );
412 return; 411 return;
413 } 412 }
414 } 413 }
415 } 414 }
416 415
417#endif 416#endif
418 417
419 emit terminated(sigPid, appName); 418 emit terminated(sigPid, appName);
420} 419}
421#else 420#else
422void AppLauncher::sigStopped(int sigPid, int sigStatus) 421void AppLauncher::sigStopped(int sigPid, int sigStatus)
423{ 422{
424 qDebug("Unhandled signal : AppLauncher::sigStopped(int sigPid, int sigStatus)"); 423 qDebug("Unhandled signal : AppLauncher::sigStopped(int sigPid, int sigStatus)");
425} 424}
426#endif // Q_OS_WIN32 425#endif // Q_OS_WIN32
427 426
428bool AppLauncher::isRunning(const QString &app) 427bool AppLauncher::isRunning(const QString &app)
429{ 428{
430 for (QMap<int,QString>::ConstIterator it = runningApps.begin(); it != runningApps.end(); ++it) { 429 for (QMap<int,QString>::ConstIterator it = runningApps.begin(); it != runningApps.end(); ++it) {
431 if ( *it == app ) { 430 if ( *it == app ) {
432#ifdef Q_OS_UNIX 431#ifdef Q_OS_UNIX
433 pid_t t = ::__getpgid( it.key() ); 432 pid_t t = ::__getpgid( it.key() );
434 if ( t == -1 ) { 433 if ( t == -1 ) {
435 qDebug("appLauncher bug, %s believed running, but pid %d is not existing", app.data(), it.key() ); 434 qDebug("appLauncher bug, %s believed running, but pid %d is not existing", app.data(), it.key() );
436 runningApps.remove( it.key() ); 435 runningApps.remove( it.key() );
437 return FALSE; 436 return FALSE;
438 } 437 }
439#endif 438#endif
440 return TRUE; 439 return TRUE;
441 } 440 }
442 } 441 }
443 442
444 return FALSE; 443 return FALSE;
445} 444}
446 445
447bool AppLauncher::executeBuiltin(const QString &c, const QString &document) 446bool AppLauncher::executeBuiltin(const QString &c, const QString &document)
448{ 447{
449 Global::Command* builtin = Opie::Global::builtinCommands(); 448 Global::Command* builtin = OGlobal::builtinCommands();
450 QGuardedPtr<QWidget> *running = Opie::Global::builtinRunning(); 449 QGuardedPtr<QWidget> *running = OGlobal::builtinRunning();
451 450
452 // Attempt to execute the app using a builtin class for the app 451 // Attempt to execute the app using a builtin class for the app
453 if (builtin) { 452 if (builtin) {
454 for (int i = 0; builtin[i].file; i++) { 453 for (int i = 0; builtin[i].file; i++) {
455 if ( builtin[i].file == c ) { 454 if ( builtin[i].file == c ) {
456 if ( running[i] ) { 455 if ( running[i] ) {
457 if ( !document.isNull() && builtin[i].documentary ) 456 if ( !document.isNull() && builtin[i].documentary )
458 Global::setDocument(running[i], document); 457 Global::setDocument(running[i], document);
459 running[i]->raise(); 458 running[i]->raise();
460 running[i]->show(); 459 running[i]->show();
461 running[i]->setActiveWindow(); 460 running[i]->setActiveWindow();
462 } else { 461 } else {
463 running[i] = builtin[i].func( builtin[i].maximized ); 462 running[i] = builtin[i].func( builtin[i].maximized );
464 } 463 }
465#ifndef QT_NO_COP 464#ifndef QT_NO_COP
466 QCopEnvelope e("QPE/System", "notBusy(QString)" ); 465 QCopEnvelope e("QPE/System", "notBusy(QString)" );
467 e << c; // that was quick ;-) 466 e << c; // that was quick ;-)
468#endif 467#endif
469 return TRUE; 468 return TRUE;
470 } 469 }
471 } 470 }
472 } 471 }
473 472
474 // Convert the command line in to a list of arguments 473 // Convert the command line in to a list of arguments
@@ -476,49 +475,49 @@ bool AppLauncher::executeBuiltin(const QString &c, const QString &document)
476 QString ap=list[0]; 475 QString ap=list[0];
477 476
478 if ( ap == "suspend" ) { // No tr 477 if ( ap == "suspend" ) { // No tr
479 QWSServer::processKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE ); 478 QWSServer::processKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE );
480 return TRUE; 479 return TRUE;
481 } 480 }
482 481
483 return FALSE; 482 return FALSE;
484} 483}
485 484
486bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise) 485bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise)
487{ 486{
488 qWarning("AppLauncher::execute"); 487 qWarning("AppLauncher::execute");
489 // Convert the command line in to a list of arguments 488 // Convert the command line in to a list of arguments
490 QStringList list = QStringList::split(QRegExp(" *"),c); 489 QStringList list = QStringList::split(QRegExp(" *"),c);
491 if ( !docParam.isEmpty() ) 490 if ( !docParam.isEmpty() )
492 list.append( docParam ); 491 list.append( docParam );
493 492
494 QString appName = list[0]; 493 QString appName = list[0];
495 if ( isRunning(appName) ) { 494 if ( isRunning(appName) ) {
496 QCString channel = "QPE/Application/"; 495 QCString channel = "QPE/Application/";
497 channel += appName.latin1(); 496 channel += appName.latin1();
498 497
499 // Need to lock it to avoid race conditions with QPEApplication::processQCopFile 498 // Need to lock it to avoid race conditions with QPEApplication::processQCopFile
500 QFile f(Opie::Global::tempDir() + "qcop-msg-" + appName); 499 QFile f(OGlobal::tempDirPath() + "qcop-msg-" + appName);
501 if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) { 500 if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) {
502#ifndef Q_OS_WIN32 501#ifndef Q_OS_WIN32
503 flock(f.handle(), LOCK_EX); 502 flock(f.handle(), LOCK_EX);
504#endif 503#endif
505 504
506 QDataStream ds(&f); 505 QDataStream ds(&f);
507 QByteArray b; 506 QByteArray b;
508 QDataStream bstream(b, IO_WriteOnly); 507 QDataStream bstream(b, IO_WriteOnly);
509 if ( !f.size() ) { 508 if ( !f.size() ) {
510 ds << channel << QCString("raise()") << b; 509 ds << channel << QCString("raise()") << b;
511 if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) { 510 if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) {
512 int id = startTimer(RAISE_TIMEOUT_MS); 511 int id = startTimer(RAISE_TIMEOUT_MS);
513 waitingHeartbeat.insert( appName, id ); 512 waitingHeartbeat.insert( appName, id );
514 } 513 }
515 } 514 }
516 if ( !docParam.isEmpty() ) { 515 if ( !docParam.isEmpty() ) {
517 bstream << docParam; 516 bstream << docParam;
518 ds << channel << QCString("setDocument(QString)") << b; 517 ds << channel << QCString("setDocument(QString)") << b;
519 } 518 }
520 519
521 f.flush(); 520 f.flush();
522#ifndef Q_OS_WIN32 521#ifndef Q_OS_WIN32
523 flock(f.handle(), LOCK_UN); 522 flock(f.handle(), LOCK_UN);
524#endif 523#endif
diff --git a/core/launcher/config.in b/core/launcher/config.in
index 2d9c1c2..db39210 100644
--- a/core/launcher/config.in
+++ b/core/launcher/config.in
@@ -1,16 +1,16 @@
1 config LAUNCHER 1 config LAUNCHER
2 boolean "opie-taskbar (program launcher qpe for Opie)" 2 boolean "opie-taskbar (program launcher qpe for Opie)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI
5 5
6if LAUNCHER 6if LAUNCHER
7 config PRELOAD 7 config PRELOAD
8 boolean 8 boolean
9 default "y" 9 default "y"
10 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LAUNCHER 10 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LAUNCHER
11 11
12 config LAUNCHER_CORE 12 config LAUNCHER_CORE
13 boolean 13 boolean
14 default "y" 14 default "y"
15 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LAUNCHER && PRELOAD 15 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LAUNCHER && PRELOAD
16endif 16endif
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index ece6931..440bf1e 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -1,51 +1,51 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "documentlist.h" 20#include "documentlist.h"
21#include "serverinterface.h" 21#include "serverinterface.h"
22#include "launcherglobal.h" 22
23#include <opie2/oglobal.h>
23 24
24#include <qtopia/config.h> 25#include <qtopia/config.h>
25#include <qtopia/mimetype.h> 26#include <qtopia/mimetype.h>
26#include <qtopia/resource.h> 27#include <qtopia/resource.h>
27#include <qtopia/global.h>
28#include <qtopia/private/categories.h> 28#include <qtopia/private/categories.h>
29#include <qtopia/qpeapplication.h> 29#include <qtopia/qpeapplication.h>
30#include <qtopia/applnk.h> 30#include <qtopia/applnk.h>
31#include <qtopia/storage.h> 31#include <qtopia/storage.h>
32#ifdef Q_WS_QWS 32#ifdef Q_WS_QWS
33#include <qtopia/qcopenvelope_qws.h> 33#include <qtopia/qcopenvelope_qws.h>
34#endif 34#endif
35 35
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qfileinfo.h> 37#include <qfileinfo.h>
38#include <qtextstream.h> 38#include <qtextstream.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <qdir.h> 40#include <qdir.h>
41#include <qpainter.h> 41#include <qpainter.h>
42#include <qimage.h> 42#include <qimage.h>
43#include <qcopchannel_qws.h> 43#include <qcopchannel_qws.h>
44#include <qlistview.h> 44#include <qlistview.h>
45#include <qlist.h> 45#include <qlist.h>
46#include <qpixmap.h> 46#include <qpixmap.h>
47 47
48 48
49AppLnkSet *DocumentList::appLnkSet = 0; 49AppLnkSet *DocumentList::appLnkSet = 0;
50 50
51static const int MAX_SEARCH_DEPTH = 10; 51static const int MAX_SEARCH_DEPTH = 10;
@@ -69,49 +69,52 @@ public:
69 QDictIterator<void> *dit; 69 QDictIterator<void> *dit;
70 enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state; 70 enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state;
71 71
72 QStringList docPaths; 72 QStringList docPaths;
73 unsigned int docPathsSearched; 73 unsigned int docPathsSearched;
74 74
75 int searchDepth; 75 int searchDepth;
76 QDir *listDirs[MAX_SEARCH_DEPTH]; 76 QDir *listDirs[MAX_SEARCH_DEPTH];
77 const QFileInfoList *lists[MAX_SEARCH_DEPTH]; 77 const QFileInfoList *lists[MAX_SEARCH_DEPTH];
78 unsigned int listPositions[MAX_SEARCH_DEPTH]; 78 unsigned int listPositions[MAX_SEARCH_DEPTH];
79 79
80 StorageInfo *storage; 80 StorageInfo *storage;
81 81
82 int tid; 82 int tid;
83 83
84 ServerInterface *serverGui; 84 ServerInterface *serverGui;
85 85
86 bool needToSendAllDocLinks; 86 bool needToSendAllDocLinks;
87 bool sendAppLnks; 87 bool sendAppLnks;
88 bool sendDocLnks; 88 bool sendDocLnks;
89 bool scanDocs; 89 bool scanDocs;
90}; 90};
91 91
92 92
93DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs, 93/*
94 * scandocs will be read from Config
95 */
96DocumentList::DocumentList( ServerInterface *serverGui, bool /*scanDocs*/,
94 QObject *parent, const char *name ) 97 QObject *parent, const char *name )
95 : QObject( parent, name ) 98 : QObject( parent, name )
96{ 99{
97 appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); 100 appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
98 d = new DocumentListPrivate( serverGui ); 101 d = new DocumentListPrivate( serverGui );
99 d->needToSendAllDocLinks = false; 102 d->needToSendAllDocLinks = false;
100 103
101 Config cfg( "Launcher" ); 104 Config cfg( "Launcher" );
102 cfg.setGroup( "DocTab" ); 105 cfg.setGroup( "DocTab" );
103 d->scanDocs = cfg.readBoolEntry( "Enable", true ); 106 d->scanDocs = cfg.readBoolEntry( "Enable", true );
104 qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); 107 qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs );
105 108
106 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); 109 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
107} 110}
108 111
109void DocumentList::startInitialScan() 112void DocumentList::startInitialScan()
110{ 113{
111 reloadAppLnks(); 114 reloadAppLnks();
112 reloadDocLnks(); 115 reloadDocLnks();
113} 116}
114 117
115DocumentList::~DocumentList() 118DocumentList::~DocumentList()
116{ 119{
117 delete appLnkSet; 120 delete appLnkSet;
@@ -248,49 +251,49 @@ void DocumentList::reloadAppLnks()
248 d->serverGui->applicationAdded( l->type(), *l ); 251 d->serverGui->applicationAdded( l->type(), *l );
249 } 252 }
250 253
251 if ( d->sendAppLnks && d->serverGui ) 254 if ( d->sendAppLnks && d->serverGui )
252 d->serverGui->applicationScanningProgress( 100 ); 255 d->serverGui->applicationScanningProgress( 100 );
253} 256}
254 257
255void DocumentList::reloadDocLnks() 258void DocumentList::reloadDocLnks()
256{ 259{
257 if ( !d->scanDocs ) 260 if ( !d->scanDocs )
258 return; 261 return;
259 262
260 if ( d->sendDocLnks && d->serverGui ) { 263 if ( d->sendDocLnks && d->serverGui ) {
261 d->serverGui->documentScanningProgress( 0 ); 264 d->serverGui->documentScanningProgress( 0 );
262 d->serverGui->allDocumentsRemoved(); 265 d->serverGui->allDocumentsRemoved();
263 } 266 }
264 267
265 rescan(); 268 rescan();
266} 269}
267 270
268void DocumentList::linkChanged( QString arg ) 271void DocumentList::linkChanged( QString arg )
269{ 272{
270 //qDebug( "linkchanged( %s )", arg.latin1() ); 273 //qDebug( "linkchanged( %s )", arg.latin1() );
271 274
272 if ( arg.isNull() || Opie::Global::isAppLnkFileName( arg ) ) { 275 if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) {
273 reloadAppLnks(); 276 reloadAppLnks();
274 } else { 277 } else {
275 278
276 const QList<DocLnk> &list = d->dls.children(); 279 const QList<DocLnk> &list = d->dls.children();
277 QListIterator<DocLnk> it( list ); 280 QListIterator<DocLnk> it( list );
278 while ( it.current() ) { 281 while ( it.current() ) {
279 DocLnk *doc = it.current(); 282 DocLnk *doc = it.current();
280 ++it; 283 ++it;
281 if ( ( doc->linkFileKnown() && doc->linkFile() == arg ) 284 if ( ( doc->linkFileKnown() && doc->linkFile() == arg )
282 || ( doc->fileKnown() && doc->file() == arg ) ) { 285 || ( doc->fileKnown() && doc->file() == arg ) ) {
283 //qDebug( "found old link" ); 286 //qDebug( "found old link" );
284 DocLnk* dl = new DocLnk( arg ); 287 DocLnk* dl = new DocLnk( arg );
285 // add new one if it exists and matches the mimetype 288 // add new one if it exists and matches the mimetype
286 if ( d->store( dl ) ) { 289 if ( d->store( dl ) ) {
287 // Existing link has been changed, send old link ref and a ref 290 // Existing link has been changed, send old link ref and a ref
288 // to the new link 291 // to the new link
289 //qDebug( "change case" ); 292 //qDebug( "change case" );
290 if ( d->serverGui ) 293 if ( d->serverGui )
291 d->serverGui->documentChanged( *doc, *dl ); 294 d->serverGui->documentChanged( *doc, *dl );
292 295
293 } else { 296 } else {
294 // Link has been removed or doesn't match the mimetypes any more 297 // Link has been removed or doesn't match the mimetypes any more
295 // so we aren't interested in it, so take it away from the list 298 // so we aren't interested in it, so take it away from the list
296 //qDebug( "removal case" ); 299 //qDebug( "removal case" );
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 988e432..bf06e75 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -6,93 +6,94 @@
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
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#include "server.h" 24#include "server.h"
25#include "serverapp.h" 25#include "serverapp.h"
26#include "taskbar.h" 26#include "taskbar.h"
27#include "stabmon.h" 27#include "stabmon.h"
28#include "launcher.h" 28#include "launcher.h"
29#include "firstuse.h" 29#include "firstuse.h"
30#include "launcherglobal.h" 30
31#include <opie2/oglobal.h>
31 32
32#include <qtopia/qpeapplication.h> 33#include <qtopia/qpeapplication.h>
33#include <qtopia/network.h> 34#include <qtopia/network.h>
34#include <qtopia/config.h> 35#include <qtopia/config.h>
35//#include <qtopia/custom.h> 36//#include <qtopia/custom.h>
36#include <qtopia/global.h> 37
37 38
38#include <qfile.h> 39#include <qfile.h>
39#include <qdir.h> 40#include <qdir.h>
40#ifdef QWS 41#ifdef QWS
41#include <qwindowsystem_qws.h> 42#include <qwindowsystem_qws.h>
42#include <qtopia/qcopenvelope_qws.h> 43#include <qtopia/qcopenvelope_qws.h>
43#endif 44#endif
44#include <qtopia/alarmserver.h> 45#include <qtopia/alarmserver.h>
45 46
46#include <stdlib.h> 47#include <stdlib.h>
47#include <stdio.h> 48#include <stdio.h>
48#include <signal.h> 49#include <signal.h>
49#ifndef Q_OS_WIN32 50#ifndef Q_OS_WIN32
50#include <unistd.h> 51#include <unistd.h>
51#else 52#else
52#include <process.h> 53#include <process.h>
53#endif 54#endif
54 55
55#include "calibrate.h" 56#include "calibrate.h"
56 57
57 58
58#ifdef QT_QWS_LOGIN 59#ifdef QT_QWS_LOGIN
59#include "../login/qdmdialogimpl.h" 60#include "../login/qdmdialogimpl.h"
60#endif 61#endif
61 62
62#ifdef Q_WS_QWS 63#ifdef Q_WS_QWS
63#include <qkeyboard_qws.h> 64#include <qkeyboard_qws.h>
64#endif 65#endif
65 66
66#include <qmessagebox.h> 67#include <qmessagebox.h>
67#include <opie/odevice.h> 68#include <opie2/odevice.h>
68 69
69using namespace Opie; 70using namespace Opie;
70 71
71 72
72static void cleanup() 73static void cleanup()
73{ 74{
74 QDir dir( Opie::Global::tempDir(), "qcop-msg-*" ); 75 QDir dir( OGlobal::tempDirPath(), "qcop-msg-*" );
75 76
76 QStringList stale = dir.entryList(); 77 QStringList stale = dir.entryList();
77 QStringList::Iterator it; 78 QStringList::Iterator it;
78 for ( it = stale.begin(); it != stale.end(); ++it ) { 79 for ( it = stale.begin(); it != stale.end(); ++it ) {
79 dir.remove( *it ); 80 dir.remove( *it );
80 } 81 }
81} 82}
82 83
83static void refreshTimeZoneConfig() 84static void refreshTimeZoneConfig()
84{ 85{
85 /* ### FIXME timezone handling */ 86 /* ### FIXME timezone handling */
86#if 0 87#if 0
87 // We need to help WorldTime in setting up its configuration for 88 // We need to help WorldTime in setting up its configuration for
88 // the current translation 89 // the current translation
89 // BEGIN no tr 90 // BEGIN no tr
90 const char *defaultTz[] = { 91 const char *defaultTz[] = {
91 "America/New_York", 92 "America/New_York",
92 "America/Los_Angeles", 93 "America/Los_Angeles",
93 "Europe/Oslo", 94 "Europe/Oslo",
94 "Asia/Tokyo", 95 "Asia/Tokyo",
95 "Asia/Hong_Kong", 96 "Asia/Hong_Kong",
96 "Australia/Brisbane", 97 "Australia/Brisbane",
97 0 98 0
98 }; 99 };
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 9cb56ce..b45f0cc 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -1,82 +1,83 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "qcopbridge.h" 21#include "qcopbridge.h"
22#include "transferserver.h" 22#include "transferserver.h"
23 23
24#include <opie2/oglobal.h>
25
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
27#include <qtopia/qpeapplication.h> 29#include <qtopia/qpeapplication.h>
28#include <qtopia/global.h> 30
29#include <qtopia/version.h> 31#include <qtopia/version.h>
30#include <qtopia/config.h> 32#include <qtopia/config.h>
31 33
32#include <qdir.h> 34#include <qdir.h>
33#include <qfile.h> 35#include <qfile.h>
34#include <qtextstream.h> 36#include <qtextstream.h>
35#include <qdatastream.h> 37#include <qdatastream.h>
36#include <qcstring.h> 38#include <qcstring.h>
37#include <qstringlist.h> 39#include <qstringlist.h>
38#include <qfileinfo.h> 40#include <qfileinfo.h>
39#include <qregexp.h> 41#include <qregexp.h>
40#include <qtimer.h> 42#include <qtimer.h>
41#ifdef Q_WS_QWS 43#ifdef Q_WS_QWS
42#include <qcopchannel_qws.h> 44#include <qcopchannel_qws.h>
43#endif 45#endif
44 46
45#ifndef _XOPEN_SOURCE 47#ifndef _XOPEN_SOURCE
46#define _XOPEN_SOURCE 48#define _XOPEN_SOURCE
47#endif 49#endif
48#ifndef Q_OS_WIN32 50#ifndef Q_OS_WIN32
49#include <pwd.h> 51#include <pwd.h>
50#include <unistd.h> 52#include <unistd.h>
51#include <sys/types.h> 53#include <sys/types.h>
52#endif 54#endif
53 55
54#if defined(_OS_LINUX_) 56#if defined(_OS_LINUX_)
55#include <shadow.h> 57#include <shadow.h>
56#endif 58#endif
57 59
58#include "launcherglobal.h"
59 60
60//#define INSECURE 61//#define INSECURE
61 62
62const int block_size = 51200; 63const int block_size = 51200;
63 64
64QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, 65QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
65 const char* name ) 66 const char* name )
66 : QServerSocket( port, 1, parent, name ), 67 : QServerSocket( port, 1, parent, name ),
67 desktopChannel( 0 ), 68 desktopChannel( 0 ),
68 cardChannel( 0 ) 69 cardChannel( 0 )
69{ 70{
70 if ( !ok() ) 71 if ( !ok() )
71 qWarning( "Failed to bind to port %d", port ); 72 qWarning( "Failed to bind to port %d", port );
72 else { 73 else {
73#ifndef QT_NO_COP 74#ifndef QT_NO_COP
74 desktopChannel = new QCopChannel( "QPE/Desktop", this ); 75 desktopChannel = new QCopChannel( "QPE/Desktop", this );
75 connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)), 76 connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)),
76 this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); 77 this, SLOT(desktopMessage( const QCString &, const QByteArray &)) );
77 cardChannel = new QCopChannel( "QPE/Card", this ); 78 cardChannel = new QCopChannel( "QPE/Card", this );
78 connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)), 79 connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)),
79 this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); 80 this, SLOT(desktopMessage( const QCString &, const QByteArray &)) );
80#endif 81#endif
81 } 82 }
82 sendSync = FALSE; 83 sendSync = FALSE;
@@ -304,49 +305,49 @@ bool QCopBridgePI::verifyAuthorised()
304 } 305 }
305 return TRUE; 306 return TRUE;
306} 307}
307 308
308void QCopBridgePI::myConnectionClosed() 309void QCopBridgePI::myConnectionClosed()
309{ 310{
310 emit connectionClosed( this ); 311 emit connectionClosed( this );
311} 312}
312 313
313void QCopBridgePI::sendDesktopMessage( const QString &msg ) 314void QCopBridgePI::sendDesktopMessage( const QString &msg )
314{ 315{
315 QString str = "CALL QPE/Desktop " + msg; // No tr 316 QString str = "CALL QPE/Desktop " + msg; // No tr
316 send ( str ); 317 send ( str );
317} 318}
318 319
319void QCopBridgePI::sendDesktopMessage( const QCString &msg, const QByteArray& data ) 320void QCopBridgePI::sendDesktopMessage( const QCString &msg, const QByteArray& data )
320{ 321{
321 if ( !isOpen() ) // eg. Forbidden 322 if ( !isOpen() ) // eg. Forbidden
322 return; 323 return;
323 324
324 const char hdr[]="CALLB QPE/Desktop "; 325 const char hdr[]="CALLB QPE/Desktop ";
325 writeBlock(hdr,sizeof(hdr)-1); 326 writeBlock(hdr,sizeof(hdr)-1);
326 writeBlock(msg,msg.length()); 327 writeBlock(msg,msg.length());
327 writeBlock(" ",1); 328 writeBlock(" ",1);
328 QByteArray b64 = Opie::Global::encodeBase64(data); 329 QByteArray b64 = OGlobal::encodeBase64(data);
329 writeBlock(b64.data(),b64.size()); 330 writeBlock(b64.data(),b64.size());
330 writeBlock("\r\n",2); 331 writeBlock("\r\n",2);
331 332
332} 333}
333 334
334 335
335void QCopBridgePI::send( const QString& msg ) 336void QCopBridgePI::send( const QString& msg )
336{ 337{
337 if ( !isOpen() ) // eg. Forbidden 338 if ( !isOpen() ) // eg. Forbidden
338 return; 339 return;
339 QTextStream os( this ); 340 QTextStream os( this );
340 os << msg << endl; 341 os << msg << endl;
341 //qDebug( "sending qcop message: %s", msg.latin1() ); 342 //qDebug( "sending qcop message: %s", msg.latin1() );
342} 343}
343 344
344void QCopBridgePI::read() 345void QCopBridgePI::read()
345{ 346{
346 while ( canReadLine() ) { 347 while ( canReadLine() ) {
347 timer->start( 300000, TRUE ); 348 timer->start( 300000, TRUE );
348 process( readLine().stripWhiteSpace() ); 349 process( readLine().stripWhiteSpace() );
349 } 350 }
350} 351}
351 352
352void QCopBridgePI::process( const QString& message ) 353void QCopBridgePI::process( const QString& message )
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp
index 48770e8..1146dcd 100644
--- a/core/launcher/screensaver.cpp
+++ b/core/launcher/screensaver.cpp
@@ -1,32 +1,32 @@
1 1
2#include "screensaver.h" 2#include "screensaver.h"
3 3
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/power.h> 5#include <qpe/power.h>
6#include <qpe/network.h> 6#include <qpe/network.h>
7 7
8#include <opie/odevice.h> 8#include <opie2/odevice.h>
9 9
10 10
11using namespace Opie; 11using namespace Opie;
12 12
13 13
14 14
15OpieScreenSaver::OpieScreenSaver ( ) 15OpieScreenSaver::OpieScreenSaver ( )
16 : QObject ( 0, "screensaver" ), QWSScreenSaver ( ) 16 : QObject ( 0, "screensaver" ), QWSScreenSaver ( )
17{ 17{
18 m_disable_suspend = 100; 18 m_disable_suspend = 100;
19 m_enable_dim = false; 19 m_enable_dim = false;
20 m_enable_lightoff = false; 20 m_enable_lightoff = false;
21 m_enable_suspend = false; 21 m_enable_suspend = false;
22 m_onlylcdoff = false; 22 m_onlylcdoff = false;
23 23
24 m_enable_dim_ac = false; 24 m_enable_dim_ac = false;
25 m_enable_lightoff_ac = false; 25 m_enable_lightoff_ac = false;
26 m_enable_suspend_ac = false; 26 m_enable_suspend_ac = false;
27 m_onlylcdoff_ac = false; 27 m_onlylcdoff_ac = false;
28 28
29 m_use_light_sensor = false; 29 m_use_light_sensor = false;
30 m_backlight_sensor = -1; 30 m_backlight_sensor = -1;
31 ::memset ( m_sensordata, 0xff, LS_Count * sizeof( m_sensordata [0] )); 31 ::memset ( m_sensordata, 0xff, LS_Count * sizeof( m_sensordata [0] ));
32 32
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index b9580c7..32fcdd0 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -30,50 +30,50 @@
30#include "qrsync.h" 30#include "qrsync.h"
31#include "syncdialog.h" 31#include "syncdialog.h"
32#include "launcher.h" 32#include "launcher.h"
33#include "shutdownimpl.h" 33#include "shutdownimpl.h"
34#include "applauncher.h" 34#include "applauncher.h"
35#if 0 35#if 0
36#include "suspendmonitor.h" 36#include "suspendmonitor.h"
37#endif 37#endif
38#include "documentlist.h" 38#include "documentlist.h"
39 39
40#include <qtopia/applnk.h> 40#include <qtopia/applnk.h>
41#include <qtopia/private/categories.h> 41#include <qtopia/private/categories.h>
42#include <qtopia/mimetype.h> 42#include <qtopia/mimetype.h>
43#include <qtopia/config.h> 43#include <qtopia/config.h>
44#include <qtopia/resource.h> 44#include <qtopia/resource.h>
45#include <qtopia/version.h> 45#include <qtopia/version.h>
46#include <qtopia/storage.h> 46#include <qtopia/storage.h>
47 47
48#include <qtopia/qcopenvelope_qws.h> 48#include <qtopia/qcopenvelope_qws.h>
49#include <qwindowsystem_qws.h> 49#include <qwindowsystem_qws.h>
50#include <qgfx_qws.h> 50#include <qgfx_qws.h>
51#include <qtopia/global.h> 51#include <qtopia/global.h>
52//#include <qtopia/custom.h> 52//#include <qtopia/custom.h>
53 53
54#include <opie/odevicebutton.h> 54#include <opie2/odevicebutton.h>
55#include <opie/odevice.h> 55#include <opie2/odevice.h>
56 56
57#include <unistd.h> 57#include <unistd.h>
58#include <qmainwindow.h> 58#include <qmainwindow.h>
59#include <qmessagebox.h> 59#include <qmessagebox.h>
60#include <qtimer.h> 60#include <qtimer.h>
61#include <qtextstream.h> 61#include <qtextstream.h>
62 62
63#include <stdlib.h> 63#include <stdlib.h>
64 64
65extern QRect qt_maxWindowRect; 65extern QRect qt_maxWindowRect;
66 66
67using namespace Opie; 67using namespace Opie;
68 68
69static QWidget *calibrate(bool) 69static QWidget *calibrate(bool)
70{ 70{
71#ifdef Q_WS_QWS 71#ifdef Q_WS_QWS
72 Calibrate *c = new Calibrate; 72 Calibrate *c = new Calibrate;
73 c->show(); 73 c->show();
74 return c; 74 return c;
75#else 75#else
76 return 0; 76 return 0;
77#endif 77#endif
78} 78}
79 79
diff --git a/core/launcher/server.pro b/core/launcher/server.pro
index 0513536..f82c741 100644
--- a/core/launcher/server.pro
+++ b/core/launcher/server.pro
@@ -25,49 +25,48 @@ HEADERS += server.h \
25 qcopbridge.h \ 25 qcopbridge.h \
26 packageslave.h \ 26 packageslave.h \
27 irserver.h \ 27 irserver.h \
28 firstuse.h \ 28 firstuse.h \
29 $$(OPIEDIR)/rsync/buf.h \ 29 $$(OPIEDIR)/rsync/buf.h \
30 $$(OPIEDIR)/rsync/checksum.h \ 30 $$(OPIEDIR)/rsync/checksum.h \
31 $$(OPIEDIR)/rsync/command.h \ 31 $$(OPIEDIR)/rsync/command.h \
32 $$(OPIEDIR)/rsync/emit.h \ 32 $$(OPIEDIR)/rsync/emit.h \
33 $$(OPIEDIR)/rsync/job.h \ 33 $$(OPIEDIR)/rsync/job.h \
34 $$(OPIEDIR)/rsync/netint.h \ 34 $$(OPIEDIR)/rsync/netint.h \
35 $$(OPIEDIR)/rsync/protocol.h \ 35 $$(OPIEDIR)/rsync/protocol.h \
36 $$(OPIEDIR)/rsync/prototab.h \ 36 $$(OPIEDIR)/rsync/prototab.h \
37 $$(OPIEDIR)/rsync/rsync.h \ 37 $$(OPIEDIR)/rsync/rsync.h \
38 $$(OPIEDIR)/rsync/search.h \ 38 $$(OPIEDIR)/rsync/search.h \
39 $$(OPIEDIR)/rsync/stream.h \ 39 $$(OPIEDIR)/rsync/stream.h \
40 $$(OPIEDIR)/rsync/sumset.h \ 40 $$(OPIEDIR)/rsync/sumset.h \
41 $$(OPIEDIR)/rsync/trace.h \ 41 $$(OPIEDIR)/rsync/trace.h \
42 $$(OPIEDIR)/rsync/types.h \ 42 $$(OPIEDIR)/rsync/types.h \
43 $$(OPIEDIR)/rsync/util.h \ 43 $$(OPIEDIR)/rsync/util.h \
44 $$(OPIEDIR)/rsync/whole.h \ 44 $$(OPIEDIR)/rsync/whole.h \
45 $$(OPIEDIR)/rsync/config_rsync.h \ 45 $$(OPIEDIR)/rsync/config_rsync.h \
46 $$(OPIEDIR)/rsync/qrsync.h \ 46 $$(OPIEDIR)/rsync/qrsync.h \
47 syncdialog.h \ 47 syncdialog.h \
48 serverapp.h \ 48 serverapp.h \
49 launcherglobal.h \
50 qprocess.h \ 49 qprocess.h \
51 screensaver.h 50 screensaver.h
52 51
53 SOURCES += server.cpp \ 52 SOURCES += server.cpp \
54 serverinterface.cpp \ 53 serverinterface.cpp \
55 launchertab.cpp \ 54 launchertab.cpp \
56 documentlist.cpp \ 55 documentlist.cpp \
57 appicons.cpp \ 56 appicons.cpp \
58 taskbar.cpp \ 57 taskbar.cpp \
59 runningappbar.cpp \ 58 runningappbar.cpp \
60 applauncher.cpp \ 59 applauncher.cpp \
61 stabmon.cpp \ 60 stabmon.cpp \
62 inputmethods.cpp \ 61 inputmethods.cpp \
63 systray.cpp \ 62 systray.cpp \
64 wait.cpp \ 63 wait.cpp \
65 shutdownimpl.cpp \ 64 shutdownimpl.cpp \
66 launcher.cpp \ 65 launcher.cpp \
67 launcherview.cpp \ 66 launcherview.cpp \
68 $$(OPIEDIR)/core/apps/calibrate/calibrate.cpp \ 67 $$(OPIEDIR)/core/apps/calibrate/calibrate.cpp \
69 transferserver.cpp \ 68 transferserver.cpp \
70 packageslave.cpp \ 69 packageslave.cpp \
71 irserver.cpp \ 70 irserver.cpp \
72 qcopbridge.cpp \ 71 qcopbridge.cpp \
73 startmenu.cpp \ 72 startmenu.cpp \
@@ -80,46 +79,46 @@ SOURCES += server.cpp \
80 $$(OPIEDIR)/rsync/delta.c \ 79 $$(OPIEDIR)/rsync/delta.c \
81 $$(OPIEDIR)/rsync/emit.c \ 80 $$(OPIEDIR)/rsync/emit.c \
82 $$(OPIEDIR)/rsync/hex.c \ 81 $$(OPIEDIR)/rsync/hex.c \
83 $$(OPIEDIR)/rsync/job.c \ 82 $$(OPIEDIR)/rsync/job.c \
84 $$(OPIEDIR)/rsync/mdfour.c \ 83 $$(OPIEDIR)/rsync/mdfour.c \
85 $$(OPIEDIR)/rsync/mksum.c \ 84 $$(OPIEDIR)/rsync/mksum.c \
86 $$(OPIEDIR)/rsync/msg.c \ 85 $$(OPIEDIR)/rsync/msg.c \
87 $$(OPIEDIR)/rsync/netint.c \ 86 $$(OPIEDIR)/rsync/netint.c \
88 $$(OPIEDIR)/rsync/patch.c \ 87 $$(OPIEDIR)/rsync/patch.c \
89 $$(OPIEDIR)/rsync/prototab.c \ 88 $$(OPIEDIR)/rsync/prototab.c \
90 $$(OPIEDIR)/rsync/readsums.c \ 89 $$(OPIEDIR)/rsync/readsums.c \
91 $$(OPIEDIR)/rsync/scoop.c \ 90 $$(OPIEDIR)/rsync/scoop.c \
92 $$(OPIEDIR)/rsync/search.c \ 91 $$(OPIEDIR)/rsync/search.c \
93 $$(OPIEDIR)/rsync/stats.c \ 92 $$(OPIEDIR)/rsync/stats.c \
94 $$(OPIEDIR)/rsync/stream.c \ 93 $$(OPIEDIR)/rsync/stream.c \
95 $$(OPIEDIR)/rsync/sumset.c \ 94 $$(OPIEDIR)/rsync/sumset.c \
96 $$(OPIEDIR)/rsync/trace.c \ 95 $$(OPIEDIR)/rsync/trace.c \
97 $$(OPIEDIR)/rsync/tube.c \ 96 $$(OPIEDIR)/rsync/tube.c \
98 $$(OPIEDIR)/rsync/util.c \ 97 $$(OPIEDIR)/rsync/util.c \
99 $$(OPIEDIR)/rsync/version.c \ 98 $$(OPIEDIR)/rsync/version.c \
100 $$(OPIEDIR)/rsync/whole.c \ 99 $$(OPIEDIR)/rsync/whole.c \
101 $$(OPIEDIR)/rsync/qrsync.cpp \ 100 $$(OPIEDIR)/rsync/qrsync.cpp \
102 syncdialog.cpp \ 101 syncdialog.cpp \
103 serverapp.cpp \ 102 serverapp.cpp \
104 launcherglobal.cpp \
105 qprocess.cpp \ 103 qprocess.cpp \
106 qprocess_unix.cpp \ 104 qprocess_unix.cpp \
107 screensaver.cpp 105 screensaver.cpp
108 106
109 107
110INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate 108INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate
111 DEPENDPATH+= $(OPIEDIR)/core/apps/calibrate 109 DEPENDPATH+= $(OPIEDIR)/core/apps/calibrate
112 110
113INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync 111INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync
114 DEPENDPATH+= $(OPIEDIR)/rsync 112 DEPENDPATH+= $(OPIEDIR)/rsync
115 113
116 TARGET = qpe 114 TARGET = qpe
117 115
116#needs OWait and ODevice
118CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) 117CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
119contains( CONFTEST, y ){ 118contains( CONFTEST, y ){
120 LIBS += -lqpe -lopie 119 LIBS += -lqpe -lopiecore2 -lopieui2
121}else{ 120}else{
122 LIBS+= -lcrypt -lqpe -lopie 121 LIBS+= -lcrypt -lqpe -lopiecore2 -lopieui2
123} 122}
124 123
125include ( $(OPIEDIR)/include.pro ) 124include ( $(OPIEDIR)/include.pro )
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index b84eed8..c199063 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -333,62 +333,62 @@ void StartMenu::loadApplets()
333 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { 333 if (( lib->queryInterface( IID_MenuApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) {
334 MenuApplet *applet = new MenuApplet; 334 MenuApplet *applet = new MenuApplet;
335 xapplets[napplets++] = applet; 335 xapplets[napplets++] = applet;
336 applet->library = lib; 336 applet->library = lib;
337 applet->iface = iface; 337 applet->iface = iface;
338 338
339 QTranslator *trans = new QTranslator(qApp); 339 QTranslator *trans = new QTranslator(qApp);
340 QString type = (*it).left( (*it).find(".") ); 340 QString type = (*it).left( (*it).find(".") );
341 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; 341 QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm";
342 if ( trans->load( tfn )) 342 if ( trans->load( tfn ))
343 qApp->installTranslator( trans ); 343 qApp->installTranslator( trans );
344 else 344 else
345 delete trans; 345 delete trans;
346 } else { 346 } else {
347 exclude += *it; 347 exclude += *it;
348 delete lib; 348 delete lib;
349 } 349 }
350 } 350 }
351 cfg.writeEntry( "ExcludeApplets", exclude, ',' ); 351 cfg.writeEntry( "ExcludeApplets", exclude, ',' );
352 qsort(xapplets, napplets, sizeof(menuApplets[0]), compareAppletPositions); 352 qsort(xapplets, napplets, sizeof(menuApplets[0]), compareAppletPositions);
353 353
354 354
355 while ( napplets-- ) { 355 while ( napplets-- ) {
356 MenuApplet *applet = xapplets[napplets]; 356 MenuApplet *applet = xapplets[napplets];
357
358 applet->popup = applet->iface->popup( this ); 357 applet->popup = applet->iface->popup( this );
359 358
360 // menuApplets got an id < -1 359 // menuApplets got an id < -1
361 menuApplets.insert( -( currentItem + 2 ), new MenuApplet( *applet ) ); 360 menuApplets.insert( -( currentItem + 2 ), new MenuApplet( *applet ) );
362 currentItem++; 361 currentItem++;
363 } 362 }
364 delete [] xapplets; 363 delete [] xapplets;
365 364
366 addApplets( launchMenu ); 365 addApplets( launchMenu );
367} 366}
368 367
369 368
370/* 369/*
371 * Launcher calls loadMenu too often fix that 370 * Launcher calls loadMenu too often fix that
372 */ 371 */
373void StartMenu::addApplets(QPopupMenu* pop) { 372void StartMenu::addApplets(QPopupMenu* pop) {
374 QIntDict<MenuApplet> dict; 373 QIntDict<MenuApplet> dict;
375 if( pop-> count ( )) 374 if( pop-> count ( ))
376 pop-> insertSeparator ( ); 375 pop-> insertSeparator ( );
377 376
378 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) { 377 for ( QIntDictIterator<MenuApplet> it( menuApplets ); it.current(); ++it ) {
379 MenuApplet *applet = it.current(); 378 MenuApplet *applet = it.current();
380 if ( applet->popup ) 379 if ( applet->popup )
381 applet->id = pop->insertItem( applet->iface->icon(), 380 applet->id = pop->insertItem( applet->iface->icon(),
382 applet->iface->text(), applet->popup ); 381 applet->iface->text(), applet->popup );
383 else 382 else
384 applet->id = pop->insertItem( applet->iface->icon(), 383 applet->id = pop->insertItem( applet->iface->icon(),
385 applet->iface->text() ); 384 applet->iface->text() );
386 385
386
387 dict.insert( applet->id, new MenuApplet( *applet ) ); 387 dict.insert( applet->id, new MenuApplet( *applet ) );
388 } 388 }
389 /* need to update the key */ 389 /* need to update the key */
390 menuApplets.setAutoDelete( true ); 390 menuApplets.setAutoDelete( true );
391 menuApplets.clear(); 391 menuApplets.clear();
392 menuApplets.setAutoDelete( false ); 392 menuApplets.setAutoDelete( false );
393 menuApplets = dict; 393 menuApplets = dict;
394} 394}
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index 9519d11..9cb9d7a 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -1,90 +1,89 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20//#define _XOPEN_SOURCE 20//#define _XOPEN_SOURCE
21 21
22#include <qtopia/global.h> 22#include <opie2/oglobal.h>
23#include <qtopia/qpeapplication.h> 23#include <qtopia/qpeapplication.h>
24 24
25#ifndef Q_OS_WIN32 25#ifndef Q_OS_WIN32
26#include <pwd.h> 26#include <pwd.h>
27#include <sys/types.h> 27#include <sys/types.h>
28#include <unistd.h> 28#include <unistd.h>
29#include <stdlib.h> 29#include <stdlib.h>
30#include <time.h> 30#include <time.h>
31 31
32#ifndef Q_OS_MACX 32#ifndef Q_OS_MACX
33#include <shadow.h> 33#include <shadow.h>
34#include <crypt.h> 34#include <crypt.h>
35#endif /* Q_OS_MACX */ 35#endif /* Q_OS_MACX */
36 36
37#else 37#else
38#include <stdlib.h> 38#include <stdlib.h>
39#include <time.h> 39#include <time.h>
40#endif 40#endif
41 41
42 42
43#if defined(_OS_LINUX_) 43#if defined(_OS_LINUX_)
44#include <shadow.h> 44#include <shadow.h>
45#endif 45#endif
46 46
47#include <qdir.h> 47#include <qdir.h>
48#include <qfile.h> 48#include <qfile.h>
49#include <qtextstream.h> 49#include <qtextstream.h>
50#include <qdatastream.h> 50#include <qdatastream.h>
51#include <qmessagebox.h> 51#include <qmessagebox.h>
52#include <qstringlist.h> 52#include <qstringlist.h>
53#include <qfileinfo.h> 53#include <qfileinfo.h>
54#include <qregexp.h> 54#include <qregexp.h>
55//#include <qtopia/qcopchannel_qws.h> 55//#include <qtopia/qcopchannel_qws.h>
56#include <qtopia/process.h> 56#include <qtopia/process.h>
57#include <qtopia/global.h> 57#include <qtopia/global.h>
58#include <qtopia/config.h> 58#include <qtopia/config.h>
59#include <qtopia/private/contact.h> 59#include <qtopia/private/contact.h>
60#include <qtopia/quuid.h> 60#include <qtopia/quuid.h>
61#include <qtopia/version.h> 61#include <qtopia/version.h>
62#ifdef Q_WS_QWS 62#ifdef Q_WS_QWS
63#include <qtopia/qcopenvelope_qws.h> 63#include <qtopia/qcopenvelope_qws.h>
64#endif 64#endif
65 65
66#include "launcherglobal.h"
67 66
68#include "transferserver.h" 67#include "transferserver.h"
69#include <qtopia/qprocess.h> 68#include <qtopia/qprocess.h>
70 69
71const int block_size = 51200; 70const int block_size = 51200;
72 71
73TransferServer::TransferServer( Q_UINT16 port, QObject *parent, 72TransferServer::TransferServer( Q_UINT16 port, QObject *parent,
74 const char* name) 73 const char* name)
75 : QServerSocket( port, 1, parent, name ) 74 : QServerSocket( port, 1, parent, name )
76{ 75{
77 connections.setAutoDelete( TRUE ); 76 connections.setAutoDelete( TRUE );
78 if ( !ok() ) 77 if ( !ok() )
79 qWarning( "Failed to bind to port %d", port ); 78 qWarning( "Failed to bind to port %d", port );
80} 79}
81 80
82void TransferServer::authorizeConnections() 81void TransferServer::authorizeConnections()
83{ 82{
84 QListIterator<ServerPI> it(connections); 83 QListIterator<ServerPI> it(connections);
85 while ( it.current() ) { 84 while ( it.current() ) {
86 if ( !it.current()->verifyAuthorised() ) { 85 if ( !it.current()->verifyAuthorised() ) {
87 disconnect( it.current(), SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); 86 disconnect( it.current(), SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) );
88 connections.removeRef( it.current() ); 87 connections.removeRef( it.current() );
89 } else 88 } else
90 ++it; 89 ++it;
@@ -93,49 +92,49 @@ void TransferServer::authorizeConnections()
93 92
94void TransferServer::closed(ServerPI *item) 93void TransferServer::closed(ServerPI *item)
95{ 94{
96 connections.removeRef(item); 95 connections.removeRef(item);
97} 96}
98 97
99TransferServer::~TransferServer() 98TransferServer::~TransferServer()
100{ 99{
101} 100}
102 101
103void TransferServer::newConnection( int socket ) 102void TransferServer::newConnection( int socket )
104{ 103{
105 ServerPI *ptr = new ServerPI( socket, this ); 104 ServerPI *ptr = new ServerPI( socket, this );
106 connect( ptr, SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); 105 connect( ptr, SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) );
107 connections.append( ptr ); 106 connections.append( ptr );
108} 107}
109 108
110QString SyncAuthentication::serverId() 109QString SyncAuthentication::serverId()
111{ 110{
112 Config cfg("Security"); 111 Config cfg("Security");
113 cfg.setGroup("Sync"); 112 cfg.setGroup("Sync");
114 QString r = cfg.readEntry("serverid"); 113 QString r = cfg.readEntry("serverid");
115 114
116 if ( r.isEmpty() ) { 115 if ( r.isEmpty() ) {
117 r = Opie::Global::uuid(); 116 r = OGlobal::generateUuid();
118 cfg.writeEntry("serverid", r ); 117 cfg.writeEntry("serverid", r );
119 } 118 }
120 return r; 119 return r;
121} 120}
122 121
123QString SyncAuthentication::ownerName() 122QString SyncAuthentication::ownerName()
124{ 123{
125 QString vfilename = Global::applicationFileName("addressbook", 124 QString vfilename = Global::applicationFileName("addressbook",
126 "businesscard.vcf"); 125 "businesscard.vcf");
127 if (QFile::exists(vfilename)) { 126 if (QFile::exists(vfilename)) {
128 Contact c; 127 Contact c;
129 c = Contact::readVCard( vfilename )[0]; 128 c = Contact::readVCard( vfilename )[0];
130 return c.fullName(); 129 return c.fullName();
131 } 130 }
132 131
133 return QString::null; 132 return QString::null;
134} 133}
135 134
136QString SyncAuthentication::loginName() 135QString SyncAuthentication::loginName()
137{ 136{
138 struct passwd *pw = 0L; 137 struct passwd *pw = 0L;
139#ifndef Q_OS_WIN32 138#ifndef Q_OS_WIN32
140 pw = getpwuid( geteuid() ); 139 pw = getpwuid( geteuid() );
141 return QString::fromLocal8Bit( pw->pw_name ); 140 return QString::fromLocal8Bit( pw->pw_name );
diff --git a/core/launcher/wait.cpp b/core/launcher/wait.cpp
index ab53a07..34ffd1a 100644
--- a/core/launcher/wait.cpp
+++ b/core/launcher/wait.cpp
@@ -2,49 +2,49 @@
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "wait.h" 21#include "wait.h"
22 22
23#include <qtopia/resource.h> 23#include <qtopia/resource.h>
24#include <qtopia/config.h> 24#include <qtopia/config.h>
25 25
26#include <opie/owait.h> 26#include <opie2/owait.h>
27 27
28#include <qwidget.h> 28#include <qwidget.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30#include <qpainter.h> 30#include <qpainter.h>
31 31
32 32
33Wait *lastWaitObject = NULL; 33Wait *lastWaitObject = NULL;
34 34
35 35
36Wait::Wait( QWidget *parent ) : QWidget( parent ), 36Wait::Wait( QWidget *parent ) : QWidget( parent ),
37 pm( Resource::loadPixmap( "wait" ) ), waiting( FALSE ) 37 pm( Resource::loadPixmap( "wait" ) ), waiting( FALSE )
38{ 38{
39 setFixedSize( pm.size() ); 39 setFixedSize( pm.size() );
40 lastWaitObject = this; 40 lastWaitObject = this;
41 m_centralWait = new OWait( 0l ); 41 m_centralWait = new OWait( 0l );
42 m_centralWait->hide(); 42 m_centralWait->hide();
43 hide(); 43 hide();
44} 44}
45 45
46 46
47Wait *Wait::getWaitObject() 47Wait *Wait::getWaitObject()
48{ 48{
49 return lastWaitObject; 49 return lastWaitObject;
50} 50}