summaryrefslogtreecommitdiff
path: root/core/launcher/server.cpp
Unidiff
Diffstat (limited to 'core/launcher/server.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp210
1 files changed, 106 insertions, 104 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 42186d3..15cd686 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -166,3 +166,3 @@ Server::Server() :
166 connect( desktopChannel, SIGNAL(received( const QCString &, const QByteArray & )), 166 connect( desktopChannel, SIGNAL(received( const QCString &, const QByteArray & )),
167 this, SLOT(desktopMessage( const QCString &, const QByteArray & )) ); 167 this, SLOT(desktopMessage( const QCString &, const QByteArray & )) );
168#endif 168#endif
@@ -218,16 +218,16 @@ static bool hasVisibleWindow(const QString& clientname, bool partial)
218 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { 218 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) {
219 if ( w->client()->identity() == clientname ) { 219 if ( w->client()->identity() == clientname ) {
220 if ( partial && !w->isFullyObscured() ) 220 if ( partial && !w->isFullyObscured() )
221 return TRUE; 221 return TRUE;
222 if ( !partial && !w->isFullyObscured() && !w->isPartiallyObscured() ) { 222 if ( !partial && !w->isFullyObscured() && !w->isPartiallyObscured() ) {
223# if QT_VERSION < 0x030000 223# if QT_VERSION < 0x030000
224 QRect mwr = qt_screen->mapToDevice(qt_maxWindowRect, 224 QRect mwr = qt_screen->mapToDevice(qt_maxWindowRect,
225 QSize(qt_screen->width(),qt_screen->height()) ); 225 QSize(qt_screen->width(),qt_screen->height()) );
226# else 226# else
227 QRect mwr = qt_maxWindowRect; 227 QRect mwr = qt_maxWindowRect;
228# endif 228# endif
229 if ( mwr.contains(w->requested().boundingRect()) ) 229 if ( mwr.contains(w->requested().boundingRect()) )
230 return TRUE; 230 return TRUE;
231 } 231 }
232 } 232 }
233 } 233 }
@@ -344,2 +344,4 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
344 docList->linkChanged(link); 344 docList->linkChanged(link);
345 } else if (msg =="reforceDocuments()") {
346 docList->reforceDocuments();
345 } else if ( msg == "serviceChanged(QString)" ) { 347 } else if ( msg == "serviceChanged(QString)" ) {
@@ -434,4 +436,4 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
434#ifndef QT_NO_COP 436#ifndef QT_NO_COP
435 QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" ); 437 QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" );
436 e << installLocationsString(); 438 e << installLocationsString();
437#endif 439#endif
@@ -472,5 +474,5 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
472 else if ( msg == "prepareDirectAccess()" ) { 474 else if ( msg == "prepareDirectAccess()" ) {
473 prepareDirectAccess(); 475 prepareDirectAccess();
474 } else if ( msg == "postDirectAccess()" ) { 476 } else if ( msg == "postDirectAccess()" ) {
475 postDirectAccess(); 477 postDirectAccess();
476 } 478 }
@@ -559,18 +561,18 @@ QString Server::cardInfoString()
559 for ( ; it.current(); ++it ) { 561 for ( ; it.current(); ++it ) {
560 int k4 = (*it)->blockSize()/256; 562 int k4 = (*it)->blockSize()/256;
561 if ( (*it)->isRemovable() ) { 563 if ( (*it)->isRemovable() ) {
562 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr 564 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
563 + QString::number( (*it)->availBlocks() * k4/4 ) 565 + QString::number( (*it)->availBlocks() * k4/4 )
564 + "K " + (*it)->options() + ";"; 566 + "K " + (*it)->options() + ";";
565 } else if ( homeDir.contains( (*it)->path() ) && 567 } else if ( homeDir.contains( (*it)->path() ) &&
566 (*it)->path().length() > homeFsPath.length() ) { 568 (*it)->path().length() > homeFsPath.length() ) {
567 homeFsPath = (*it)->path(); 569 homeFsPath = (*it)->path();
568 homeFs = 570 homeFs =
569 (*it)->name() + "=" + homeDir + "/Documents " // No tr 571 (*it)->name() + "=" + homeDir + "/Documents " // No tr
570 + QString::number( (*it)->availBlocks() * k4/4 ) 572 + QString::number( (*it)->availBlocks() * k4/4 )
571 + "K " + (*it)->options() + ";"; 573 + "K " + (*it)->options() + ";";
572 } 574 }
573 } 575 }
574 if ( !homeFs.isEmpty() ) 576 if ( !homeFs.isEmpty() )
575 s += homeFs; 577 s += homeFs;
576 return s; 578 return s;
@@ -587,18 +589,18 @@ QString Server::installLocationsString()
587 for ( ; it.current(); ++it ) { 589 for ( ; it.current(); ++it ) {
588 int k4 = (*it)->blockSize()/256; 590 int k4 = (*it)->blockSize()/256;
589 if ( (*it)->isRemovable() ) { 591 if ( (*it)->isRemovable() ) {
590 s += (*it)->name() + "=" + (*it)->path() + " " // No tr 592 s += (*it)->name() + "=" + (*it)->path() + " " // No tr
591 + QString::number( (*it)->availBlocks() * k4/4 ) 593 + QString::number( (*it)->availBlocks() * k4/4 )
592 + "K " + (*it)->options() + ";"; 594 + "K " + (*it)->options() + ";";
593 } else if ( homeDir.contains( (*it)->path() ) && 595 } else if ( homeDir.contains( (*it)->path() ) &&
594 (*it)->path().length() > homeFsPath.length() ) { 596 (*it)->path().length() > homeFsPath.length() ) {
595 homeFsPath = (*it)->path(); 597 homeFsPath = (*it)->path();
596 homeFs = 598 homeFs =
597 (*it)->name() + "=" + homeDir + " " // No tr 599 (*it)->name() + "=" + homeDir + " " // No tr
598 + QString::number( (*it)->availBlocks() * k4/4 ) 600 + QString::number( (*it)->availBlocks() * k4/4 )
599 + "K " + (*it)->options() + ";"; 601 + "K " + (*it)->options() + ";";
600 } 602 }
601 } 603 }
602 if ( !homeFs.isEmpty() ) 604 if ( !homeFs.isEmpty() )
603 s = homeFs + s; 605 s = homeFs + s;
604 return s; 606 return s;
@@ -826,3 +828,3 @@ void Server::prepareDirectAccess()
826 { 828 {
827 QCopEnvelope e( "QPE/Stabmon", "suspendMonitor()" ); 829 QCopEnvelope e( "QPE/Stabmon", "suspendMonitor()" );
828 } 830 }
@@ -839,6 +841,6 @@ void Server::prepareDirectAccess()
839 for ( QMap<int,QString>::ConstIterator it = 841 for ( QMap<int,QString>::ConstIterator it =
840 appLauncher->runningApplications().begin(); 842 appLauncher->runningApplications().begin();
841 it != appLauncher->runningApplications().end(); 843 it != appLauncher->runningApplications().end();
842 ++it ) { 844 ++it ) {
843 pendingFlushes++; 845 pendingFlushes++;
844 } 846 }
@@ -860,39 +862,39 @@ void Server::desktopMessage( const QCString &message, const QByteArray &data )
860 if ( message == "flushDone(QString)" ) { 862 if ( message == "flushDone(QString)" ) {
861 QString app; 863 QString app;
862 stream >> app; 864 stream >> app;
863 qDebug( "flushDone from %s", app.latin1() ); 865 qDebug( "flushDone from %s", app.latin1() );
864 if ( --pendingFlushes == 0 ) { 866 if ( --pendingFlushes == 0 ) {
865 qDebug( "pendingFlushes == 0, all the apps responded" ); 867 qDebug( "pendingFlushes == 0, all the apps responded" );
866 runDirectAccess(); 868 runDirectAccess();
867 } 869 }
868 } else if ( message == "installStarted(QString)" ) { 870 } else if ( message == "installStarted(QString)" ) {
869 QString package; 871 QString package;
870 stream >> package; 872 stream >> package;
871 qDebug( "\tInstall Started for package %s", package.latin1() ); 873 qDebug( "\tInstall Started for package %s", package.latin1() );
872 } else if ( message == "installStep(QString)" ) { 874 } else if ( message == "installStep(QString)" ) {
873 QString step; 875 QString step;
874 stream >> step; 876 stream >> step;
875 qDebug( "\tInstall Step %s", step.latin1() ); 877 qDebug( "\tInstall Step %s", step.latin1() );
876 } else if ( message == "installDone(QString)" ) { 878 } else if ( message == "installDone(QString)" ) {
877 QString package; 879 QString package;
878 stream >> package; 880 stream >> package;
879 qDebug( "\tInstall Finished for package %s", package.latin1() ); 881 qDebug( "\tInstall Finished for package %s", package.latin1() );
880 } else if ( message == "installFailed(QString,int,QString)" ) { 882 } else if ( message == "installFailed(QString,int,QString)" ) {
881 QString package, error; 883 QString package, error;
882 int status; 884 int status;
883 stream >> package >> status >> error; 885 stream >> package >> status >> error;
884 qDebug( "\tInstall Failed for package %s with error code %d and error message %s", 886 qDebug( "\tInstall Failed for package %s with error code %d and error message %s",
885 package.latin1(), status, error.latin1() ); 887 package.latin1(), status, error.latin1() );
886 } else if ( message == "removeStarted(QString)" ) { 888 } else if ( message == "removeStarted(QString)" ) {
887 QString package; 889 QString package;
888 stream >> package; 890 stream >> package;
889 qDebug( "\tRemove Started for package %s", package.latin1() ); 891 qDebug( "\tRemove Started for package %s", package.latin1() );
890 } else if ( message == "removeDone(QString)" ) { 892 } else if ( message == "removeDone(QString)" ) {
891 QString package; 893 QString package;
892 stream >> package; 894 stream >> package;
893 qDebug( "\tRemove Finished for package %s", package.latin1() ); 895 qDebug( "\tRemove Finished for package %s", package.latin1() );
894 } else if ( message == "removeFailed(QString)" ) { 896 } else if ( message == "removeFailed(QString)" ) {
895 QString package; 897 QString package;
896 stream >> package; 898 stream >> package;
897 qDebug( "\tRemove Failed for package %s", package.latin1() ); 899 qDebug( "\tRemove Failed for package %s", package.latin1() );
898 } 900 }
@@ -900,3 +902,3 @@ void Server::desktopMessage( const QCString &message, const QByteArray &data )
900 if ( qrr && qrr->waitingForMessages ) 902 if ( qrr && qrr->waitingForMessages )
901 qrr->desktopMessage( message, data ); 903 qrr->desktopMessage( message, data );
902} 904}
@@ -911,3 +913,3 @@ void Server::runDirectAccess()
911 if ( directAccessRun ) 913 if ( directAccessRun )
912 return; 914 return;
913 915
@@ -936,3 +938,3 @@ void Server::postDirectAccess()
936 { 938 {
937 QCopEnvelope e( "QPE/Stabmon", "restartMonitor()" ); 939 QCopEnvelope e( "QPE/Stabmon", "restartMonitor()" );
938 } 940 }
@@ -944,18 +946,18 @@ void Server::postDirectAccess()
944 if ( !file->exists() ) { 946 if ( !file->exists() ) {
945 delete file; 947 delete file;
946 // Get rid of the dialog 948 // Get rid of the dialog
947 if ( syncDialog ) { 949 if ( syncDialog ) {
948 delete syncDialog; 950 delete syncDialog;
949 syncDialog = 0; 951 syncDialog = 0;
950 } 952 }
951#warning FIXME support TempScreenSaverMode 953#warning FIXME support TempScreenSaverMode
952#if 0 954#if 0
953 QPEApplication::setTempScreenSaverMode(QPEApplication::Enable); 955 QPEApplication::setTempScreenSaverMode(QPEApplication::Enable);
954#endif 956#endif
955 } else { 957 } else {
956 qrr = new QueuedRequestRunner( file, syncDialog ); 958 qrr = new QueuedRequestRunner( file, syncDialog );
957 connect( qrr, SIGNAL(finished()), 959 connect( qrr, SIGNAL(finished()),
958 this, SLOT(finishedQueuedRequests()) ); 960 this, SLOT(finishedQueuedRequests()) );
959 QTimer::singleShot( 100, qrr, SLOT(process()) ); 961 QTimer::singleShot( 100, qrr, SLOT(process()) );
960 // qrr will remove the sync dialog later 962 // qrr will remove the sync dialog later
961 } 963 }
@@ -967,16 +969,16 @@ void Server::finishedQueuedRequests()
967 if ( qrr->readyToDelete ) { 969 if ( qrr->readyToDelete ) {
968 delete qrr; 970 delete qrr;
969 qrr = 0; 971 qrr = 0;
970 // Get rid of the dialog 972 // Get rid of the dialog
971 if ( syncDialog ) { 973 if ( syncDialog ) {
972 delete syncDialog; 974 delete syncDialog;
973 syncDialog = 0; 975 syncDialog = 0;
974 } 976 }
975#warning FIXME support TempScreenSaverMode 977#warning FIXME support TempScreenSaverMode
976#if 0 978#if 0
977 QPEApplication::setTempScreenSaverMode(QPEApplication::Enable); 979 QPEApplication::setTempScreenSaverMode(QPEApplication::Enable);
978#endif 980#endif
979 } else { 981 } else {
980 qrr->readyToDelete = TRUE; 982 qrr->readyToDelete = TRUE;
981 QTimer::singleShot( 0, this, SLOT(finishedQueuedRequests()) ); 983 QTimer::singleShot( 0, this, SLOT(finishedQueuedRequests()) );
982 } 984 }