summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 0eaebcf..42186d3 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -342,104 +342,109 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
342 stream >> link; 342 stream >> link;
343 odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl; 343 odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
344 docList->linkChanged(link); 344 docList->linkChanged(link);
345 } else if ( msg == "serviceChanged(QString)" ) { 345 } else if ( msg == "serviceChanged(QString)" ) {
346 MimeType::updateApplications(); 346 MimeType::updateApplications();
347 } else if ( msg == "mkdir(QString)" ) { 347 } else if ( msg == "mkdir(QString)" ) {
348 QString dir; 348 QString dir;
349 stream >> dir; 349 stream >> dir;
350 if ( !dir.isEmpty() ) 350 if ( !dir.isEmpty() )
351 mkdir( dir ); 351 mkdir( dir );
352 } else if ( msg == "rdiffGenSig(QString,QString)" ) { 352 } else if ( msg == "rdiffGenSig(QString,QString)" ) {
353 QString baseFile, sigFile; 353 QString baseFile, sigFile;
354 stream >> baseFile >> sigFile; 354 stream >> baseFile >> sigFile;
355 QRsync::generateSignature( baseFile, sigFile ); 355 QRsync::generateSignature( baseFile, sigFile );
356 } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) { 356 } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {
357 QString baseFile, sigFile, deltaFile; 357 QString baseFile, sigFile, deltaFile;
358 stream >> baseFile >> sigFile >> deltaFile; 358 stream >> baseFile >> sigFile >> deltaFile;
359 QRsync::generateDiff( baseFile, sigFile, deltaFile ); 359 QRsync::generateDiff( baseFile, sigFile, deltaFile );
360 } else if ( msg == "rdiffApplyPatch(QString,QString)" ) { 360 } else if ( msg == "rdiffApplyPatch(QString,QString)" ) {
361 QString baseFile, deltaFile; 361 QString baseFile, deltaFile;
362 stream >> baseFile >> deltaFile; 362 stream >> baseFile >> deltaFile;
363 if ( !QFile::exists( baseFile ) ) { 363 if ( !QFile::exists( baseFile ) ) {
364 QFile f( baseFile ); 364 QFile f( baseFile );
365 f.open( IO_WriteOnly ); 365 f.open( IO_WriteOnly );
366 f.close(); 366 f.close();
367 } 367 }
368 QRsync::applyDiff( baseFile, deltaFile ); 368 QRsync::applyDiff( baseFile, deltaFile );
369#ifndef QT_NO_COP 369#ifndef QT_NO_COP
370 QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" ); 370 QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
371 e << baseFile; 371 e << baseFile;
372#endif 372#endif
373 } else if ( msg == "rdiffCleanup()" ) { 373 } else if ( msg == "rdiffCleanup()" ) {
374 mkdir( "/tmp/rdiff" ); 374 mkdir( "/tmp/rdiff" );
375 QDir dir; 375 QDir dir;
376 dir.setPath( "/tmp/rdiff" ); 376 dir.setPath( "/tmp/rdiff" );
377 QStringList entries = dir.entryList(); 377 QStringList entries = dir.entryList();
378 for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) 378 for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
379 dir.remove( *it ); 379 dir.remove( *it );
380 } else if ( msg == "sendHandshakeInfo()" ) { 380 } else if ( msg == "sendHandshakeInfo()" ) {
381 QString home = getenv( "HOME" ); 381 QString home = getenv( "HOME" );
382#ifndef QT_NO_COP 382#ifndef QT_NO_COP
383 QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" ); 383 QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
384 e << home; 384 e << home;
385 int locked = (int) ServerApplication::screenLocked(); 385 int locked = (int) ServerApplication::screenLocked();
386 e << locked; 386 e << locked;
387#endif 387#endif
388 } else if ( msg == "sendVersionInfo()" ) { 388 } else if ( msg == "sendVersionInfo()" ) {
389 /* 389 /*
390 * QtopiaDesktop relies on the major number 390 * @&$*! Qtopiadesktop relies on the major number
391 * to start with 1. 391 * to start with 1. (or 2 as the case of version 2.1 will be)
392 * we need to fake at least 1.4 to be able 392 * we need to fake 1.7 to be able
393 * to sync with QtopiaDesktop1.6 393 * to sync with Qtopiadesktop 1.7.
394 * We'll send it Opie's version in the platform string for now,
395 * until such time when QD gets rewritten correctly.
394 */ 396 */
395 QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" ); 397 QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" );
396 QString opiename = "Opie"; 398
397 e << QString(QPE_VERSION) << opiename; 399 QString opiename = "Opie "+QString(QPE_VERSION);
400 QString QDVersion="1.7";
401 e << QDVersion << opiename;
402
398 } else if ( msg == "sendCardInfo()" ) { 403 } else if ( msg == "sendCardInfo()" ) {
399#ifndef QT_NO_COP 404#ifndef QT_NO_COP
400 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); 405 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
401#endif 406#endif
402 storage->update(); 407 storage->update();
403 const QList<FileSystem> &fs = storage->fileSystems(); 408 const QList<FileSystem> &fs = storage->fileSystems();
404 QListIterator<FileSystem> it ( fs ); 409 QListIterator<FileSystem> it ( fs );
405 QString s; 410 QString s;
406 QString homeDir = getenv("HOME"); 411 QString homeDir = getenv("HOME");
407 QString homeFs, homeFsPath; 412 QString homeFs, homeFsPath;
408 for ( ; it.current(); ++it ) { 413 for ( ; it.current(); ++it ) {
409 int k4 = (*it)->blockSize()/256; 414 int k4 = (*it)->blockSize()/256;
410 if ( (*it)->isRemovable() ) { 415 if ( (*it)->isRemovable() ) {
411 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr 416 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
412 + QString::number( (*it)->availBlocks() * k4/4 ) 417 + QString::number( (*it)->availBlocks() * k4/4 )
413 + "K " + (*it)->options() + ";"; 418 + "K " + (*it)->options() + ";";
414 } else if ( homeDir.contains( (*it)->path() ) && 419 } else if ( homeDir.contains( (*it)->path() ) &&
415 (*it)->path().length() > homeFsPath.length() ) { 420 (*it)->path().length() > homeFsPath.length() ) {
416 homeFsPath = (*it)->path(); 421 homeFsPath = (*it)->path();
417 homeFs = 422 homeFs =
418 (*it)->name() + "=" + homeDir + "/Documents " // No tr 423 (*it)->name() + "=" + homeDir + "/Documents " // No tr
419 + QString::number( (*it)->availBlocks() * k4/4 ) 424 + QString::number( (*it)->availBlocks() * k4/4 )
420 + "K " + (*it)->options() + ";"; 425 + "K " + (*it)->options() + ";";
421 } 426 }
422 } 427 }
423 if ( !homeFs.isEmpty() ) 428 if ( !homeFs.isEmpty() )
424 s += homeFs; 429 s += homeFs;
425#ifndef QT_NO_COP 430#ifndef QT_NO_COP
426 e << s; 431 e << s;
427#endif 432#endif
428 } else if ( msg == "sendInstallLocations()" ) { 433 } else if ( msg == "sendInstallLocations()" ) {
429#ifndef QT_NO_COP 434#ifndef QT_NO_COP
430 QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" ); 435 QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" );
431 e << installLocationsString(); 436 e << installLocationsString();
432#endif 437#endif
433 } else if ( msg == "sendSyncDate(QString)" ) { 438 } else if ( msg == "sendSyncDate(QString)" ) {
434 QString app; 439 QString app;
435 stream >> app; 440 stream >> app;
436 Config cfg( "qpe" ); 441 Config cfg( "qpe" );
437 cfg.setGroup("SyncDate"); 442 cfg.setGroup("SyncDate");
438#ifndef QT_NO_COP 443#ifndef QT_NO_COP
439 QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); 444 QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
440 e << app << cfg.readEntry( app ); 445 e << app << cfg.readEntry( app );
441#endif 446#endif
442 //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response " 447 //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response "
443 // << cfg.readEntry( app ).latin1() << oendl; 448 // << cfg.readEntry( app ).latin1() << oendl;
444 } else if ( msg == "setSyncDate(QString,QString)" ) { 449 } else if ( msg == "setSyncDate(QString,QString)" ) {
445 QString app, date; 450 QString app, date;