-rw-r--r-- | core/launcher/server.cpp | 22 | ||||
-rw-r--r-- | core/launcher/server.h | 7 |
2 files changed, 28 insertions, 1 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp index 15cd686..921b790 100644 --- a/core/launcher/server.cpp +++ b/core/launcher/server.cpp @@ -36,16 +36,18 @@ #endif #include "documentlist.h" #include "qrr.h" /* OPIE */ #include <opie2/odebug.h> #include <opie2/odevicebutton.h> #include <opie2/odevice.h> +#include <opie2/oprocess.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> @@ -128,17 +130,18 @@ extern const char *directAccessQueueFile(); //=========================================================================== Server::Server() : QWidget( 0, 0, WStyle_Tool | WStyle_Customize ), qcopBridge( 0 ), transferServer( 0 ), packageHandler( 0 ), - syncDialog( 0 ) + syncDialog( 0 ), + process( 0 ) { Global::setBuiltinCommands(builtins); tid_xfer = 0; /* ### FIXME ### */ /* tid_today = startTimer(3600*2*1000);*/ last_today_show = QDate::currentDate(); @@ -162,16 +165,18 @@ Server::Server() : #ifdef QPE_HAVE_DIRECT_ACCESS QCopChannel *desktopChannel = new QCopChannel( "QPE/Desktop", this ); connect( desktopChannel, SIGNAL(received( const QCString &, const QByteArray & )), this, SLOT(desktopMessage( const QCString &, const QByteArray & )) ); #endif + soundServerExited(); + // start services startTransferServer(); (void) new IrServer( this ); packageHandler = new PackageHandler( this ); connect(qApp, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)), this,SLOT(activate(const Opie::Core::ODeviceButton*,bool))); @@ -979,8 +984,23 @@ void Server::finishedQueuedRequests() 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(); +} + +void Server::soundServerExited() { + QTimer::singleShot(5000, this, SLOT(startSoundServer())); +} diff --git a/core/launcher/server.h b/core/launcher/server.h index d71d68a..5b2f995 100644 --- a/core/launcher/server.h +++ b/core/launcher/server.h @@ -36,16 +36,17 @@ class AppLnkSet; class StorageInfo; class SyncDialog; class DocumentList; class ServerInterface; class QueuedRequestRunner; namespace Opie { namespace Core { class ODeviceButton; + class OProcess; } } class Server : public QWidget { Q_OBJECT public: Server(); ~Server(); @@ -58,16 +59,20 @@ public: public slots: void systemMsg(const QCString &, const QByteArray &); void receiveTaskBar(const QCString &msg, const QByteArray &data); void terminateServers(); void pokeTimeMonitors(); private slots: + //@{ + void startSoundServer(); + void soundServerExited(); + //@} void activate(const Opie::Core::ODeviceButton*,bool); void syncConnectionClosed( const QHostAddress & ); void applicationLaunched(int pid, const QString &app); void applicationTerminated(int pid, const QString &app); void applicationConnected(const QString &app); void storageChanged(); void cancelSync(); void desktopMessage( const QCString &, const QByteArray & ); @@ -99,13 +104,15 @@ private: SyncDialog *syncDialog; AppLauncher *appLauncher; DocumentList *docList; ServerInterface *serverGui; int pendingFlushes; bool directAccessRun; QueuedRequestRunner *qrr; + + Opie::Core::OProcess *process; }; #endif // DESKTOP_H |