summaryrefslogtreecommitdiff
path: root/core/launcher/server.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/server.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/server.cpp32
1 files changed, 16 insertions, 16 deletions
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
@@ -15,77 +15,77 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "server.h"
#include "serverapp.h"
#include "startmenu.h"
#include "launcher.h"
#include "transferserver.h"
#include "qcopbridge.h"
#include "irserver.h"
#include "packageslave.h"
#include "calibrate.h"
#include "qrsync.h"
#include "syncdialog.h"
#include "shutdownimpl.h"
#include "applauncher.h"
#if 0
#include "suspendmonitor.h"
#endif
#include "documentlist.h"
+/* OPIE */
+#include <opie2/odebug.h>
+#include <opie2/odevicebutton.h>
+#include <opie2/odevice.h>
#include <qtopia/applnk.h>
#include <qtopia/private/categories.h>
#include <qtopia/mimetype.h>
#include <qtopia/config.h>
#include <qtopia/resource.h>
#include <qtopia/version.h>
#include <qtopia/storage.h>
-
#include <qtopia/qcopenvelope_qws.h>
-#include <qwindowsystem_qws.h>
-#include <qgfx_qws.h>
#include <qtopia/global.h>
-//#include <qtopia/custom.h>
-
-#include <opie2/odevicebutton.h>
-#include <opie2/odevice.h>
+using namespace Opie::Core;
-#include <unistd.h>
+/* QT */
#include <qmainwindow.h>
#include <qmessagebox.h>
#include <qtimer.h>
#include <qtextstream.h>
+#include <qwindowsystem_qws.h>
+#include <qgfx_qws.h>
+/* STD */
+#include <unistd.h>
#include <stdlib.h>
extern QRect qt_maxWindowRect;
-
-using namespace Opie::Core;
static QWidget *calibrate(bool)
{
#ifdef Q_WS_QWS
Calibrate *c = new Calibrate;
c->show();
return c;
#else
return 0;
#endif
}
#define FACTORY(T) \
static QWidget *new##T( bool maximized ) { \
QWidget *w = new T( 0, 0, QWidget::WDestructiveClose | QWidget::WGroupLeader ); \
if ( maximized ) { \
if ( qApp->desktop()->width() <= 350 ) { \
w->showMaximized(); \
} else { \
w->resize( QSize( 300, 300 ) ); \
} \
} \
w->show(); \
return w; \
}
@@ -308,49 +308,49 @@ bool Server::setKeyboardLayout( const QString &kb )
#endif
void Server::systemMsg(const QCString &msg, const QByteArray &data)
{
QDataStream stream( data, IO_ReadOnly );
if ( msg == "securityChanged()" ) {
if ( transferServer )
transferServer->authorizeConnections();
if ( qcopBridge )
qcopBridge->authorizeConnections();
}
/* ### FIXME support TempScreenSaverMode */
#if 0
else if ( msg == "setTempScreenSaverMode(int,int)" ) {
int mode, pid;
stream >> mode >> pid;
tsmMonitor->setTempMode(mode, pid);
}
#endif
else if ( msg == "linkChanged(QString)" ) {
QString link;
stream >> link;
- qDebug( "desktop.cpp systemMsg -> linkchanged( %s )", link.latin1() );
+ 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();
}
@@ -413,49 +413,49 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
}
if ( !homeFs.isEmpty() )
s += homeFs;
#ifndef QT_NO_COP
e << s;
#endif
} 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 );
#endif
//qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(),
//cfg.readEntry( app ).latin1() );
} else if ( msg == "setSyncDate(QString,QString)" ) {
QString app, date;
stream >> app >> date;
Config cfg( "qpe" );
cfg.setGroup("SyncDate");
cfg.writeEntry( app, date );
- //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1());
+ //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();
}
#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;
@@ -551,69 +551,69 @@ void Server::cancelSync()
{
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/Desktop", "cancelSync()" );
#endif
delete syncDialog;
syncDialog = 0;
}
bool Server::mkdir(const QString &localPath)
{
QDir fullDir(localPath);
if (fullDir.exists())
return true;
// at this point the directory doesn't exist
// go through the directory tree and start creating the direcotories
// that don't exist; if we can't create the directories, return false
QString dirSeps = "/";
int dirIndex = localPath.find(dirSeps);
QString checkedPath;
// didn't find any seps; weird, use the cur dir instead
if (dirIndex == -1) {
- //qDebug("No seperators found in path %s", localPath.latin1());
+ //odebug << "No seperators found in path " << localPath << "" << oendl;
checkedPath = QDir::currentDirPath();
}
while (checkedPath != localPath) {
// no more seperators found, use the local path
if (dirIndex == -1)
checkedPath = localPath;
else {
// the next directory to check
checkedPath = localPath.left(dirIndex) + "/";
// advance the iterator; the next dir seperator
dirIndex = localPath.find(dirSeps, dirIndex+1);
}
QDir checkDir(checkedPath);
if (!checkDir.exists()) {
- //qDebug("mkdir making dir %s", checkedPath.latin1());
+ //odebug << "mkdir making dir " << checkedPath << "" << oendl;
if (!checkDir.mkdir(checkedPath)) {
- qDebug("Unable to make directory %s", checkedPath.latin1());
+ odebug << "Unable to make directory " << checkedPath << "" << oendl;
return FALSE;
}
}
}
return TRUE;
}
void Server::styleChange( QStyle &s )
{
QWidget::styleChange( s );
}
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;
@@ -649,49 +649,49 @@ void Server::timerEvent( QTimerEvent *e )
last_today_show = today;
Config cfg("today");
cfg.setGroup("Start");
#ifndef QPE_DEFAULT_TODAY_MODE
#define QPE_DEFAULT_TODAY_MODE "Never"
#endif
if ( cfg.readEntry("Mode",QPE_DEFAULT_TODAY_MODE) == "Daily" ) {
QCopEnvelope env(Service::channel("today"),"raise()");
}
}
}
#endif
}
void Server::terminateServers()
{
delete transferServer;
delete qcopBridge;
transferServer = 0;
qcopBridge = 0;
}
void Server::syncConnectionClosed( const QHostAddress & )
{
- qDebug( "Lost sync connection" );
+ odebug << "Lost sync connection" << oendl;
delete syncDialog;
syncDialog = 0;
}
void Server::pokeTimeMonitors()
{
#if 0
// inform all TimeMonitors
QStrList tms = Service::channels("TimeMonitor");
for (const char* ch = tms.first(); ch; ch=tms.next()) {
QString t = getenv("TZ");
QCopEnvelope e(ch, "timeChange(QString)");
e << t;
}
#endif
}
void Server::applicationLaunched(int, const QString &app)
{
serverGui->applicationStateChanged( app, ServerInterface::Launching );
}
void Server::applicationTerminated(int pid, const QString &app)
{