-rw-r--r-- | core/launcher/server.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp index 524e6dd..0eaebcf 100644 --- a/core/launcher/server.cpp +++ b/core/launcher/server.cpp | |||
@@ -300,194 +300,194 @@ static const KeyOverride jp109keys[] = { | |||
300 | }; | 300 | }; |
301 | 301 | ||
302 | bool Server::setKeyboardLayout( const QString &kb ) | 302 | bool Server::setKeyboardLayout( const QString &kb ) |
303 | { | 303 | { |
304 | //quick demo version that can be extended | 304 | //quick demo version that can be extended |
305 | 305 | ||
306 | QIntDict<QWSServer::KeyMap> *om = 0; | 306 | QIntDict<QWSServer::KeyMap> *om = 0; |
307 | if ( kb == "us101" ) { // No tr | 307 | if ( kb == "us101" ) { // No tr |
308 | om = 0; | 308 | om = 0; |
309 | } else if ( kb == "jp109" ) { | 309 | } else if ( kb == "jp109" ) { |
310 | om = new QIntDict<QWSServer::KeyMap>(37); | 310 | om = new QIntDict<QWSServer::KeyMap>(37); |
311 | const KeyOverride *k = jp109keys; | 311 | const KeyOverride *k = jp109keys; |
312 | while ( k->scan_code ) { | 312 | while ( k->scan_code ) { |
313 | om->insert( k->scan_code, &k->map ); | 313 | om->insert( k->scan_code, &k->map ); |
314 | k++; | 314 | k++; |
315 | } | 315 | } |
316 | } | 316 | } |
317 | QWSServer::setOverrideKeys( om ); | 317 | QWSServer::setOverrideKeys( om ); |
318 | 318 | ||
319 | return TRUE; | 319 | return TRUE; |
320 | } | 320 | } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | void Server::systemMsg(const QCString &msg, const QByteArray &data) | 323 | void Server::systemMsg(const QCString &msg, const QByteArray &data) |
324 | { | 324 | { |
325 | QDataStream stream( data, IO_ReadOnly ); | 325 | QDataStream stream( data, IO_ReadOnly ); |
326 | 326 | ||
327 | if ( msg == "securityChanged()" ) { | 327 | if ( msg == "securityChanged()" ) { |
328 | if ( transferServer ) | 328 | if ( transferServer ) |
329 | transferServer->authorizeConnections(); | 329 | transferServer->authorizeConnections(); |
330 | 330 | ||
331 | if ( qcopBridge ) | 331 | if ( qcopBridge ) |
332 | qcopBridge->authorizeConnections(); | 332 | qcopBridge->authorizeConnections(); |
333 | #warning FIXME support TempScreenSaverMode | 333 | #warning FIXME support TempScreenSaverMode |
334 | #if 0 | 334 | #if 0 |
335 | } else if ( msg == "setTempScreenSaverMode(int,int)" ) { | 335 | } else if ( msg == "setTempScreenSaverMode(int,int)" ) { |
336 | int mode, pid; | 336 | int mode, pid; |
337 | stream >> mode >> pid; | 337 | stream >> mode >> pid; |
338 | tsmMonitor->setTempMode(mode, pid); | 338 | tsmMonitor->setTempMode(mode, pid); |
339 | #endif | 339 | #endif |
340 | } else if ( msg == "linkChanged(QString)" ) { | 340 | } else if ( msg == "linkChanged(QString)" ) { |
341 | QString link; | 341 | QString link; |
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. |
392 | * we need to fake at least 1.4 to be able | 392 | * we need to fake at least 1.4 to be able |
393 | * to sync with QtopiaDesktop1.6 | 393 | * to sync with QtopiaDesktop1.6 |
394 | */ | 394 | */ |
395 | QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" ); | 395 | QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" ); |
396 | /* ### FIXME Architecture ### */ | 396 | QString opiename = "Opie"; |
397 | e << QString::fromLatin1("1.7") << "Uncustomized Device"; | 397 | e << QString(QPE_VERSION) << opiename; |
398 | } else if ( msg == "sendCardInfo()" ) { | 398 | } else if ( msg == "sendCardInfo()" ) { |
399 | #ifndef QT_NO_COP | 399 | #ifndef QT_NO_COP |
400 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); | 400 | QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); |
401 | #endif | 401 | #endif |
402 | storage->update(); | 402 | storage->update(); |
403 | const QList<FileSystem> &fs = storage->fileSystems(); | 403 | const QList<FileSystem> &fs = storage->fileSystems(); |
404 | QListIterator<FileSystem> it ( fs ); | 404 | QListIterator<FileSystem> it ( fs ); |
405 | QString s; | 405 | QString s; |
406 | QString homeDir = getenv("HOME"); | 406 | QString homeDir = getenv("HOME"); |
407 | QString homeFs, homeFsPath; | 407 | QString homeFs, homeFsPath; |
408 | for ( ; it.current(); ++it ) { | 408 | for ( ; it.current(); ++it ) { |
409 | int k4 = (*it)->blockSize()/256; | 409 | int k4 = (*it)->blockSize()/256; |
410 | if ( (*it)->isRemovable() ) { | 410 | if ( (*it)->isRemovable() ) { |
411 | s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr | 411 | s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr |
412 | + QString::number( (*it)->availBlocks() * k4/4 ) | 412 | + QString::number( (*it)->availBlocks() * k4/4 ) |
413 | + "K " + (*it)->options() + ";"; | 413 | + "K " + (*it)->options() + ";"; |
414 | } else if ( homeDir.contains( (*it)->path() ) && | 414 | } else if ( homeDir.contains( (*it)->path() ) && |
415 | (*it)->path().length() > homeFsPath.length() ) { | 415 | (*it)->path().length() > homeFsPath.length() ) { |
416 | homeFsPath = (*it)->path(); | 416 | homeFsPath = (*it)->path(); |
417 | homeFs = | 417 | homeFs = |
418 | (*it)->name() + "=" + homeDir + "/Documents " // No tr | 418 | (*it)->name() + "=" + homeDir + "/Documents " // No tr |
419 | + QString::number( (*it)->availBlocks() * k4/4 ) | 419 | + QString::number( (*it)->availBlocks() * k4/4 ) |
420 | + "K " + (*it)->options() + ";"; | 420 | + "K " + (*it)->options() + ";"; |
421 | } | 421 | } |
422 | } | 422 | } |
423 | if ( !homeFs.isEmpty() ) | 423 | if ( !homeFs.isEmpty() ) |
424 | s += homeFs; | 424 | s += homeFs; |
425 | #ifndef QT_NO_COP | 425 | #ifndef QT_NO_COP |
426 | e << s; | 426 | e << s; |
427 | #endif | 427 | #endif |
428 | } else if ( msg == "sendInstallLocations()" ) { | 428 | } else if ( msg == "sendInstallLocations()" ) { |
429 | #ifndef QT_NO_COP | 429 | #ifndef QT_NO_COP |
430 | QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" ); | 430 | QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" ); |
431 | e << installLocationsString(); | 431 | e << installLocationsString(); |
432 | #endif | 432 | #endif |
433 | } else if ( msg == "sendSyncDate(QString)" ) { | 433 | } else if ( msg == "sendSyncDate(QString)" ) { |
434 | QString app; | 434 | QString app; |
435 | stream >> app; | 435 | stream >> app; |
436 | Config cfg( "qpe" ); | 436 | Config cfg( "qpe" ); |
437 | cfg.setGroup("SyncDate"); | 437 | cfg.setGroup("SyncDate"); |
438 | #ifndef QT_NO_COP | 438 | #ifndef QT_NO_COP |
439 | QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); | 439 | QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); |
440 | e << app << cfg.readEntry( app ); | 440 | e << app << cfg.readEntry( app ); |
441 | #endif | 441 | #endif |
442 | //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response " | 442 | //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response " |
443 | // << cfg.readEntry( app ).latin1() << oendl; | 443 | // << cfg.readEntry( app ).latin1() << oendl; |
444 | } else if ( msg == "setSyncDate(QString,QString)" ) { | 444 | } else if ( msg == "setSyncDate(QString,QString)" ) { |
445 | QString app, date; | 445 | QString app, date; |
446 | stream >> app >> date; | 446 | stream >> app >> date; |
447 | Config cfg( "qpe" ); | 447 | Config cfg( "qpe" ); |
448 | cfg.setGroup("SyncDate"); | 448 | cfg.setGroup("SyncDate"); |
449 | cfg.writeEntry( app, date ); | 449 | cfg.writeEntry( app, date ); |
450 | //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl; | 450 | //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl; |
451 | } else if ( msg == "startSync(QString)" ) { | 451 | } else if ( msg == "startSync(QString)" ) { |
452 | QString what; | 452 | QString what; |
453 | stream >> what; | 453 | stream >> what; |
454 | delete syncDialog; | 454 | delete syncDialog; |
455 | syncDialog = new SyncDialog( this, what ); | 455 | syncDialog = new SyncDialog( this, what ); |
456 | syncDialog->show(); | 456 | syncDialog->show(); |
457 | connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) ); | 457 | connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) ); |
458 | } else if ( msg == "stopSync()") { | 458 | } else if ( msg == "stopSync()") { |
459 | delete syncDialog; | 459 | delete syncDialog; |
460 | syncDialog = 0; | 460 | syncDialog = 0; |
461 | } else if (msg == "restoreDone(QString)") { | 461 | } else if (msg == "restoreDone(QString)") { |
462 | docList->restoreDone(); | 462 | docList->restoreDone(); |
463 | } else if ( msg == "getAllDocLinks()" ) { | 463 | } else if ( msg == "getAllDocLinks()" ) { |
464 | docList->sendAllDocLinks(); | 464 | docList->sendAllDocLinks(); |
465 | } | 465 | } |
466 | #ifdef QPE_HAVE_DIRECT_ACCESS | 466 | #ifdef QPE_HAVE_DIRECT_ACCESS |
467 | else if ( msg == "prepareDirectAccess()" ) { | 467 | else if ( msg == "prepareDirectAccess()" ) { |
468 | prepareDirectAccess(); | 468 | prepareDirectAccess(); |
469 | } else if ( msg == "postDirectAccess()" ) { | 469 | } else if ( msg == "postDirectAccess()" ) { |
470 | postDirectAccess(); | 470 | postDirectAccess(); |
471 | } | 471 | } |
472 | #endif | 472 | #endif |
473 | #ifdef Q_WS_QWS | 473 | #ifdef Q_WS_QWS |
474 | 474 | ||
475 | else if ( msg == "setMouseProto(QString)" ) { | 475 | else if ( msg == "setMouseProto(QString)" ) { |
476 | QString mice; | 476 | QString mice; |
477 | stream >> mice; | 477 | stream >> mice; |
478 | setenv("QWS_MOUSE_PROTO",mice.latin1(),1); | 478 | setenv("QWS_MOUSE_PROTO",mice.latin1(),1); |
479 | qwsServer->openMouse(); | 479 | qwsServer->openMouse(); |
480 | } else if ( msg == "setKeyboard(QString)" ) { | 480 | } else if ( msg == "setKeyboard(QString)" ) { |
481 | QString kb; | 481 | QString kb; |
482 | stream >> kb; | 482 | stream >> kb; |
483 | setenv("QWS_KEYBOARD",kb.latin1(),1); | 483 | setenv("QWS_KEYBOARD",kb.latin1(),1); |
484 | qwsServer->openKeyboard(); | 484 | qwsServer->openKeyboard(); |
485 | } else if ( msg == "setKeyboardAutoRepeat(int,int)" ) { | 485 | } else if ( msg == "setKeyboardAutoRepeat(int,int)" ) { |
486 | int delay, period; | 486 | int delay, period; |
487 | stream >> delay >> period; | 487 | stream >> delay >> period; |
488 | qwsSetKeyboardAutoRepeat( delay, period ); | 488 | qwsSetKeyboardAutoRepeat( delay, period ); |
489 | Config cfg( "qpe" ); | 489 | Config cfg( "qpe" ); |
490 | cfg.setGroup("Keyboard"); | 490 | cfg.setGroup("Keyboard"); |
491 | cfg.writeEntry( "RepeatDelay", delay ); | 491 | cfg.writeEntry( "RepeatDelay", delay ); |
492 | cfg.writeEntry( "RepeatPeriod", period ); | 492 | cfg.writeEntry( "RepeatPeriod", period ); |
493 | } else if ( msg == "setKeyboardLayout(QString)" ) { | 493 | } else if ( msg == "setKeyboardLayout(QString)" ) { |