summaryrefslogtreecommitdiff
authorschurig <schurig>2004-09-14 08:42:14 (UTC)
committer schurig <schurig>2004-09-14 08:42:14 (UTC)
commitb425c1e7ae98835745f186f22c59db4377f4441c (patch) (side-by-side diff)
tree7255f4d146ed5213f33532c8cf6ec175b2afe2ae
parent5b09662a6198033580493222fac6df5ea31479e3 (diff)
downloadopie-b425c1e7ae98835745f186f22c59db4377f4441c.zip
opie-b425c1e7ae98835745f186f22c59db4377f4441c.tar.gz
opie-b425c1e7ae98835745f186f22c59db4377f4441c.tar.bz2
Fixed some horrible indentations
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp467
1 files changed, 255 insertions, 212 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 5ae517b..3bef36e 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -234,3 +234,2 @@ void Server::activate(const ODeviceButton* button, bool held)
-
typedef struct KeyOverride {
@@ -242,22 +241,22 @@ typedef struct KeyOverride {
static const KeyOverride jp109keys[] = {
- { 0x03, { Qt::Key_2, '2' , 0x22 , 0xffff } },
- { 0x07, { Qt::Key_6, '6' , '&' , 0xffff } },
- { 0x08, { Qt::Key_7, '7' , '\'' , 0xffff } },
- { 0x09, { Qt::Key_8, '8' , '(' , 0xffff } },
- { 0x0a, { Qt::Key_9, '9' , ')' , 0xffff } },
- { 0x0b, { Qt::Key_0, '0' , 0xffff , 0xffff } },
- { 0x0c, { Qt::Key_Minus, '-' , '=' , 0xffff } },
- { 0x0d, { Qt::Key_AsciiCircum,'^' , '~' , '^' - 64 } },
- { 0x1a, { Qt::Key_At, '@' , '`' , 0xffff } },
- { 0x1b, { Qt::Key_BraceLeft, '[' , '{' , '[' - 64 } },
- { 0x27, { Qt::Key_Semicolon, ';' , '+' , 0xffff } },
- { 0x28, { Qt::Key_Colon, ':' , '*' , 0xffff } },
- { 0x29, { Qt::Key_Zenkaku_Hankaku, 0xffff , 0xffff , 0xffff } },
- { 0x2b, { Qt::Key_BraceRight, ']' , '}' , ']'-64 } },
- { 0x70, { Qt::Key_Hiragana_Katakana, 0xffff , 0xffff , 0xffff } },
- { 0x73, { Qt::Key_Backslash, '\\' , '_' , 0xffff } },
- { 0x79, { Qt::Key_Henkan, 0xffff , 0xffff , 0xffff } },
- { 0x7b, { Qt::Key_Muhenkan, 0xffff , 0xffff , 0xffff } },
- { 0x7d, { Qt::Key_yen, 0x00a5 , '|' , 0xffff } },
- { 0x00, { 0, 0xffff , 0xffff , 0xffff } }
+ { 0x03, { Qt::Key_2, '2' , 0x22 , 0xffff } },
+ { 0x07, { Qt::Key_6, '6' , '&' , 0xffff } },
+ { 0x08, { Qt::Key_7, '7' , '\'' , 0xffff } },
+ { 0x09, { Qt::Key_8, '8' , '(' , 0xffff } },
+ { 0x0a, { Qt::Key_9, '9' , ')' , 0xffff } },
+ { 0x0b, { Qt::Key_0, '0' , 0xffff, 0xffff } },
+ { 0x0c, { Qt::Key_Minus, '-' , '=' , 0xffff } },
+ { 0x0d, { Qt::Key_AsciiCircum, '^' , '~' , '^'-64 } },
+ { 0x1a, { Qt::Key_At, '@' , '`' , 0xffff } },
+ { 0x1b, { Qt::Key_BraceLeft, '[' , '{' , '['-64 } },
+ { 0x27, { Qt::Key_Semicolon, ';' , '+' , 0xffff } },
+ { 0x28, { Qt::Key_Colon, ':' , '*' , 0xffff } },
+ { 0x29, { Qt::Key_Zenkaku_Hankaku, 0xffff, 0xffff, 0xffff } },
+ { 0x2b, { Qt::Key_BraceRight, ']' , '}' , ']'-64 } },
+ { 0x70, { Qt::Key_Hiragana_Katakana, 0xffff, 0xffff, 0xffff } },
+ { 0x73, { Qt::Key_Backslash, '\\' , '_' , 0xffff } },
+ { 0x79, { Qt::Key_Henkan, 0xffff, 0xffff, 0xffff } },
+ { 0x7b, { Qt::Key_Muhenkan, 0xffff, 0xffff, 0xffff } },
+ { 0x7d, { Qt::Key_yen, 0x00a5, '|' , 0xffff } },
+ { 0x00, { 0, 0xffff, 0xffff, 0xffff } }
};
@@ -283,3 +282,2 @@ bool Server::setKeyboardLayout( const QString &kb )
}
-
#endif
@@ -293,63 +291,80 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
transferServer->authorizeConnections();
+
if ( qcopBridge )
qcopBridge->authorizeConnections();
- }
- /* ### FIXME support TempScreenSaverMode */
+ } else
+
#if 0
- else if ( msg == "setTempScreenSaverMode(int,int)" ) {
- int mode, pid;
- stream >> mode >> pid;
- tsmMonitor->setTempMode(mode, pid);
- }
+ /* ### FIXME support TempScreenSaverMode */
+ if ( msg == "setTempScreenSaverMode(int,int)" ) {
+ int mode, pid;
+ stream >> mode >> pid;
+ tsmMonitor->setTempMode(mode, pid);
+ } else
#endif
- else if ( msg == "linkChanged(QString)" ) {
- QString link;
- stream >> link;
- odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
- docList->linkChanged(link);
- } else if ( msg == "serviceChanged(QString)" ) {
- MimeType::updateApplications();
- } else if ( msg == "mkdir(QString)" ) {
- QString dir;
- stream >> dir;
- if ( !dir.isEmpty() )
- mkdir( dir );
- } else if ( msg == "rdiffGenSig(QString,QString)" ) {
- QString baseFile, sigFile;
- stream >> baseFile >> sigFile;
- QRsync::generateSignature( baseFile, sigFile );
- } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {
- QString baseFile, sigFile, deltaFile;
- stream >> baseFile >> sigFile >> deltaFile;
- QRsync::generateDiff( baseFile, sigFile, deltaFile );
- } else if ( msg == "rdiffApplyPatch(QString,QString)" ) {
- QString baseFile, deltaFile;
- stream >> baseFile >> deltaFile;
- if ( !QFile::exists( baseFile ) ) {
- QFile f( baseFile );
- f.open( IO_WriteOnly );
- f.close();
- }
- QRsync::applyDiff( baseFile, deltaFile );
+
+ if ( msg == "linkChanged(QString)" ) {
+ QString link;
+ stream >> link;
+ odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
+ docList->linkChanged(link);
+ } else
+
+ if ( msg == "serviceChanged(QString)" ) {
+ MimeType::updateApplications();
+ } else
+
+ if ( msg == "mkdir(QString)" ) {
+ QString dir;
+ stream >> dir;
+ if ( !dir.isEmpty() )
+ mkdir( dir );
+ } else
+
+ if ( msg == "rdiffGenSig(QString,QString)" ) {
+ QString baseFile, sigFile;
+ stream >> baseFile >> sigFile;
+ QRsync::generateSignature( baseFile, sigFile );
+ } else
+
+ if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {
+ QString baseFile, sigFile, deltaFile;
+ stream >> baseFile >> sigFile >> deltaFile;
+ QRsync::generateDiff( baseFile, sigFile, deltaFile );
+ } else
+
+ if ( msg == "rdiffApplyPatch(QString,QString)" ) {
+ QString baseFile, deltaFile;
+ stream >> baseFile >> deltaFile;
+ if ( !QFile::exists( baseFile ) ) {
+ QFile f( baseFile );
+ f.open( IO_WriteOnly );
+ f.close();
+ }
+ QRsync::applyDiff( baseFile, deltaFile );
#ifndef QT_NO_COP
- QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
- e << baseFile;
+ QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
+ e << baseFile;
#endif
- } else if ( msg == "rdiffCleanup()" ) {
- mkdir( "/tmp/rdiff" );
- QDir dir;
- dir.setPath( "/tmp/rdiff" );
- QStringList entries = dir.entryList();
- for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
- dir.remove( *it );
- } else if ( msg == "sendHandshakeInfo()" ) {
- QString home = getenv( "HOME" );
+ } else
+
+ if ( msg == "rdiffCleanup()" ) {
+ mkdir( "/tmp/rdiff" );
+ QDir dir;
+ dir.setPath( "/tmp/rdiff" );
+ QStringList entries = dir.entryList();
+ for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
+ dir.remove( *it );
+ } else
+
+ if ( msg == "sendHandshakeInfo()" ) {
+ QString home = getenv( "HOME" );
#ifndef QT_NO_COP
- QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
- e << home;
- int locked = (int) ServerApplication::screenLocked();
- e << locked;
+ QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
+ e << home;
+ int locked = (int) ServerApplication::screenLocked();
+ e << locked;
#endif
+ } else
- }
/*
@@ -360,98 +375,119 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
*/
- else if ( msg == "sendVersionInfo()" ) {
- QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" );
- /* ### FIXME Architecture ### */
- e << QString::fromLatin1("1.7") << "Uncustomized Device";
- } else if ( msg == "sendCardInfo()" ) {
+ if ( msg == "sendVersionInfo()" ) {
+ QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" );
+ /* ### FIXME Architecture ### */
+ e << QString::fromLatin1("1.7") << "Uncustomized Device";
+ } else
+
+ if ( msg == "sendCardInfo()" ) {
#ifndef QT_NO_COP
- QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
+ QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
#endif
- storage->update();
- const QList<FileSystem> &fs = storage->fileSystems();
- QListIterator<FileSystem> it ( fs );
- QString s;
- QString homeDir = getenv("HOME");
- QString homeFs, homeFsPath;
- for ( ; it.current(); ++it ) {
- int k4 = (*it)->blockSize()/256;
- if ( (*it)->isRemovable() ) {
- s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
- + QString::number( (*it)->availBlocks() * k4/4 )
- + "K " + (*it)->options() + ";";
- } else if ( homeDir.contains( (*it)->path() ) &&
- (*it)->path().length() > homeFsPath.length() ) {
- homeFsPath = (*it)->path();
- homeFs =
- (*it)->name() + "=" + homeDir + "/Documents " // No tr
- + QString::number( (*it)->availBlocks() * k4/4 )
- + "K " + (*it)->options() + ";";
+ storage->update();
+ const QList<FileSystem> &fs = storage->fileSystems();
+ QListIterator<FileSystem> it ( fs );
+ QString s;
+ QString homeDir = getenv("HOME");
+ QString homeFs, homeFsPath;
+ for ( ; it.current(); ++it ) {
+ int k4 = (*it)->blockSize()/256;
+ if ( (*it)->isRemovable() ) {
+ s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
+ + QString::number( (*it)->availBlocks() * k4/4 )
+ + "K " + (*it)->options() + ";";
+ } else if ( homeDir.contains( (*it)->path() ) &&
+ (*it)->path().length() > homeFsPath.length() ) {
+ homeFsPath = (*it)->path();
+ homeFs =
+ (*it)->name() + "=" + homeDir + "/Documents " // No tr
+ + QString::number( (*it)->availBlocks() * k4/4 )
+ + "K " + (*it)->options() + ";";
+ }
}
- }
- if ( !homeFs.isEmpty() )
- s += homeFs;
-
+ if ( !homeFs.isEmpty() )
+ s += homeFs;
#ifndef QT_NO_COP
- e << s;
+ e << s;
#endif
- } else if ( msg == "sendSyncDate(QString)" ) {
- QString app;
- stream >> app;
- Config cfg( "qpe" );
- cfg.setGroup("SyncDate");
+ } else
+
+ if ( msg == "sendSyncDate(QString)" ) {
+ QString app;
+ stream >> app;
+ Config cfg( "qpe" );
+ cfg.setGroup("SyncDate");
#ifndef QT_NO_COP
- QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
- e << app << cfg.readEntry( app );
+ QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
+ e << app << cfg.readEntry( app );
#endif
- //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response "
- // << cfg.readEntry( app ).latin1() << oendl;
- } else if ( msg == "setSyncDate(QString,QString)" ) {
- QString app, date;
- stream >> app >> date;
- Config cfg( "qpe" );
- cfg.setGroup("SyncDate");
- cfg.writeEntry( app, date );
- //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl;
- } else if ( msg == "startSync(QString)" ) {
- QString what;
- stream >> what;
- delete syncDialog;
- syncDialog = new SyncDialog( this, what );
- syncDialog->show();
- connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) );
- } else if ( msg == "stopSync()") {
- delete syncDialog;
- syncDialog = 0;
- } else if (msg == "restoreDone(QString)") {
- docList->restoreDone();
- } else if ( msg == "getAllDocLinks()" ) {
- docList->sendAllDocLinks();
- }
+ //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response "
+ // << cfg.readEntry( app ).latin1() << oendl;
+ } else
+
+ if ( msg == "setSyncDate(QString,QString)" ) {
+ QString app, date;
+ stream >> app >> date;
+ Config cfg( "qpe" );
+ cfg.setGroup("SyncDate");
+ cfg.writeEntry( app, date );
+ //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl;
+ } else
+
+ if ( msg == "startSync(QString)" ) {
+ QString what;
+ stream >> what;
+ delete syncDialog;
+ syncDialog = new SyncDialog( this, what );
+ syncDialog->show();
+ connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) );
+ } else
+
+ if ( msg == "stopSync()") {
+ delete syncDialog;
+ syncDialog = 0;
+ } else
+
+ if (msg == "restoreDone(QString)") {
+ docList->restoreDone();
+ } else
+
+ if ( msg == "getAllDocLinks()" ) {
+ docList->sendAllDocLinks();
+ } else
+
#ifdef Q_WS_QWS
- else if ( msg == "setMouseProto(QString)" ) {
- QString mice;
- stream >> mice;
- setenv("QWS_MOUSE_PROTO",mice.latin1(),1);
- qwsServer->openMouse();
- } else if ( msg == "setKeyboard(QString)" ) {
- QString kb;
- stream >> kb;
- setenv("QWS_KEYBOARD",kb.latin1(),1);
- qwsServer->openKeyboard();
-
- } else if ( msg == "setKeyboardAutoRepeat(int,int)" ) {
- int delay, period;
- stream >> delay >> period;
- qwsSetKeyboardAutoRepeat( delay, period );
- Config cfg( "qpe" );
- cfg.setGroup("Keyboard");
- cfg.writeEntry( "RepeatDelay", delay );
- cfg.writeEntry( "RepeatPeriod", period );
- } else if ( msg == "setKeyboardLayout(QString)" ) {
- QString kb;
- stream >> kb;
- setKeyboardLayout( kb );
- Config cfg( "qpe" );
- cfg.setGroup("Keyboard");
- cfg.writeEntry( "Layout", kb );
- } else if ( msg == "autoStart(QString)" ) {
+ if ( msg == "setMouseProto(QString)" ) {
+ QString mice;
+ stream >> mice;
+ setenv("QWS_MOUSE_PROTO",mice.latin1(),1);
+ qwsServer->openMouse();
+ } else
+
+ if ( msg == "setKeyboard(QString)" ) {
+ QString kb;
+ stream >> kb;
+ setenv("QWS_KEYBOARD",kb.latin1(),1);
+ qwsServer->openKeyboard();
+ } else
+
+ if ( msg == "setKeyboardAutoRepeat(int,int)" ) {
+ int delay, period;
+ stream >> delay >> period;
+ qwsSetKeyboardAutoRepeat( delay, period );
+ Config cfg( "qpe" );
+ cfg.setGroup("Keyboard");
+ cfg.writeEntry( "RepeatDelay", delay );
+ cfg.writeEntry( "RepeatPeriod", period );
+ } else
+
+ if ( msg == "setKeyboardLayout(QString)" ) {
+ QString kb;
+ stream >> kb;
+ setKeyboardLayout( kb );
+ Config cfg( "qpe" );
+ cfg.setGroup("Keyboard");
+ cfg.writeEntry( "Layout", kb );
+ } else
+
+ if ( msg == "autoStart(QString)" ) {
QString appName;
@@ -463,3 +499,5 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
}
- } else if ( msg == "autoStart(QString,QString)" ) {
+ } else
+
+ if ( msg == "autoStart(QString,QString)" ) {
QString modifier, appName;
@@ -484,5 +522,7 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
// case the autostart feature should be delayed
- } else if ( msg == "autoStart(QString,QString,QString)") {
- QString modifier, appName, delay;
- stream >> modifier >> appName >> delay;
+ } else
+
+ if ( msg == "autoStart(QString,QString,QString)") {
+ QString modifier, appName, delay;
+ stream >> modifier >> appName >> delay;
Config cfg( "autostart" );
@@ -496,3 +536,2 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
}
- } else {
}
@@ -507,9 +546,12 @@ void Server::receiveTaskBar(const QCString &msg, const QByteArray &data)
if ( msg == "reloadApps()" ) {
- docList->reloadAppLnks();
- } else if ( msg == "soundAlarm()" ) {
- ServerApplication::soundAlarm();
- }
- else if ( msg == "setLed(int,bool)" ) {
- int led, status;
- stream >> led >> status;
+ docList->reloadAppLnks();
+ } else
+
+ if ( msg == "soundAlarm()" ) {
+ ServerApplication::soundAlarm();
+ } else
+
+ if ( msg == "setLed(int,bool)" ) {
+ int led, status;
+ stream >> led >> status;
@@ -550,4 +592,4 @@ bool Server::mkdir(const QString &localPath)
if (dirIndex == -1) {
- //odebug << "No seperators found in path " << localPath << "" << oendl;
- checkedPath = QDir::currentDirPath();
+ //odebug << "No seperators found in path " << localPath << "" << oendl;
+ checkedPath = QDir::currentDirPath();
}
@@ -556,5 +598,5 @@ bool Server::mkdir(const QString &localPath)
// no more seperators found, use the local path
- if (dirIndex == -1)
+ if (dirIndex == -1) {
checkedPath = localPath;
- else {
+ } else {
// the next directory to check
@@ -587,25 +629,27 @@ void Server::startTransferServer()
if ( !qcopBridge ) {
- // start qcop bridge server
- qcopBridge = new QCopBridge( 4243 );
- if ( qcopBridge->ok() ) {
- // ... OK
- connect( qcopBridge, SIGNAL(connectionClosed(const QHostAddress&)),
- this, SLOT(syncConnectionClosed(const QHostAddress&)) );
- } else {
- delete qcopBridge;
- qcopBridge = 0;
- }
+ // start qcop bridge server
+ qcopBridge = new QCopBridge( 4243 );
+ if ( qcopBridge->ok() ) {
+ // ... OK
+ connect( qcopBridge, SIGNAL(connectionClosed(const QHostAddress&)),
+ this, SLOT(syncConnectionClosed(const QHostAddress&)) );
+ } else {
+ delete qcopBridge;
+ qcopBridge = 0;
+ }
}
+
if ( !transferServer ) {
- // start transfer server
- transferServer = new TransferServer( 4242 );
- if ( transferServer->ok() ) {
- // ... OK
- } else {
- delete transferServer;
- transferServer = 0;
- }
+ // start transfer server
+ transferServer = new TransferServer( 4242 );
+ if ( transferServer->ok() ) {
+ // ... OK
+ } else {
+ delete transferServer;
+ transferServer = 0;
+ }
+
+ if ( !qcopBridge )
+ tid_xfer = startTimer( 2000 );
}
- if ( !transferServer || !qcopBridge )
- tid_xfer = startTimer( 2000 );
}
@@ -615,14 +659,14 @@ void Server::timerEvent( QTimerEvent *e )
if ( e->timerId() == tid_xfer ) {
- killTimer( tid_xfer );
- tid_xfer = 0;
- startTransferServer();
+ killTimer( tid_xfer );
+ tid_xfer = 0;
+ startTransferServer();
}
- /* ### FIXME today startin */
#if 0
+ /* ### FIXME today startin */
else if ( e->timerId() == tid_today ) {
- QDate today = QDate::currentDate();
- if ( today != last_today_show ) {
- last_today_show = today;
- Config cfg("today");
- cfg.setGroup("Start");
+ QDate today = QDate::currentDate();
+ if ( today != last_today_show ) {
+ last_today_show = today;
+ Config cfg("today");
+ cfg.setGroup("Start");
#ifndef QPE_DEFAULT_TODAY_MODE
@@ -630,7 +674,7 @@ void Server::timerEvent( QTimerEvent *e )
#endif
- if ( cfg.readEntry("Mode",QPE_DEFAULT_TODAY_MODE) == "Daily" ) {
- QCopEnvelope env(Service::channel("today"),"raise()");
+ if ( cfg.readEntry("Mode",QPE_DEFAULT_TODAY_MODE) == "Daily" ) {
+ QCopEnvelope env(Service::channel("today"),"raise()");
+ }
}
}
- }
#endif
@@ -702,3 +746,3 @@ void Server::preloadApps()
#ifndef QT_NO_COP
- QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()");
+ QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()");
#endif
@@ -706,2 +750 @@ void Server::preloadApps()
}
-