summaryrefslogtreecommitdiff
path: root/core/launcher/server.cpp
Side-by-side diff
Diffstat (limited to 'core/launcher/server.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 921b790..c45265a 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -322,106 +322,114 @@ bool Server::setKeyboardLayout( const QString &kb )
QWSServer::setOverrideKeys( om );
return TRUE;
}
#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();
#warning 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;
odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
docList->linkChanged(link);
} else if (msg =="reforceDocuments()") {
docList->reforceDocuments();
} 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;
+ bool fileWasCreated = false;
if ( !QFile::exists( baseFile ) ) {
QFile f( baseFile );
- f.open( IO_WriteOnly );
+ fileWasCreated = f.open( IO_WriteOnly );
f.close();
}
- QRsync::applyDiff( baseFile, deltaFile );
+ if ( fileWasCreated ) {
+ 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 {
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "patchUnapplied(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" );
#ifndef QT_NO_COP
QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
e << home;
int locked = (int) ServerApplication::screenLocked();
e << locked;
#endif
} else if ( msg == "sendVersionInfo()" ) {
/*
* @&$*! Qtopiadesktop relies on the major number
* to start with 1. (or 2 as the case of version 2.1 will be)
* we need to fake 1.7 to be able
* to sync with Qtopiadesktop 1.7.
* We'll send it Opie's version in the platform string for now,
* until such time when QD gets rewritten correctly.
*/
QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" );
QString opiename = "Opie "+QString(QPE_VERSION);
QString QDVersion="1.7";
e << QDVersion << opiename;
} else if ( msg == "sendCardInfo()" ) {
#ifndef QT_NO_COP
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() ) {
@@ -953,54 +961,55 @@ void Server::postDirectAccess()
// Get rid of the dialog
if ( syncDialog ) {
delete syncDialog;
syncDialog = 0;
}
#warning FIXME support TempScreenSaverMode
#if 0
QPEApplication::setTempScreenSaverMode(QPEApplication::Enable);
#endif
} else {
qrr = new QueuedRequestRunner( file, syncDialog );
connect( qrr, SIGNAL(finished()),
this, SLOT(finishedQueuedRequests()) );
QTimer::singleShot( 100, qrr, SLOT(process()) );
// qrr will remove the sync dialog later
}
#endif
}
void Server::finishedQueuedRequests()
{
if ( qrr->readyToDelete ) {
delete qrr;
qrr = 0;
// Get rid of the dialog
if ( syncDialog ) {
delete syncDialog;
syncDialog = 0;
}
#warning FIXME support TempScreenSaverMode
#if 0
QPEApplication::setTempScreenSaverMode(QPEApplication::Enable);
#endif
} else {
qrr->readyToDelete = TRUE;
QTimer::singleShot( 0, this, SLOT(finishedQueuedRequests()) );
}
}
void Server::startSoundServer() {
if ( !process ) {
process = new Opie::Core::OProcess( this );
connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
SLOT(soundServerExited()));
}
process->clearArguments();
*process << QPEApplication::qpeDir() + "bin/qss";
- process->start();
+ if (!process->start())
+ owarn << "Sound server process did not start" << oendl;
}
void Server::soundServerExited() {
QTimer::singleShot(5000, this, SLOT(startSoundServer()));
}