author | zecke <zecke> | 2005-03-03 21:01:18 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-03-03 21:01:18 (UTC) |
commit | 67ddc501f2a52c7f35ca4044fb0094e759a45d76 (patch) (side-by-side diff) | |
tree | 7c863f306e6fb7c1aecfb2f8c1ff4a217bfefa1c | |
parent | 585c9fe0efbc0cf4037a79cac3b22ac38c08fec2 (diff) | |
download | opie-67ddc501f2a52c7f35ca4044fb0094e759a45d76.zip opie-67ddc501f2a52c7f35ca4044fb0094e759a45d76.tar.gz opie-67ddc501f2a52c7f35ca4044fb0094e759a45d76.tar.bz2 |
Start and Restart the QSound-Server
-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 @@ -40,8 +40,10 @@ /* 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> @@ -132,9 +134,10 @@ 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; @@ -166,8 +169,10 @@ Server::Server() : connect( desktopChannel, SIGNAL(received( const QCString &, const QByteArray & )), this, SLOT(desktopMessage( const QCString &, const QByteArray & )) ); #endif + soundServerExited(); + // start services startTransferServer(); (void) new IrServer( this ); @@ -983,4 +988,19 @@ void Server::finishedQueuedRequests() 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 @@ -40,8 +40,9 @@ class ServerInterface; class QueuedRequestRunner; namespace Opie { namespace Core { class ODeviceButton; + class OProcess; } } class Server : public QWidget { @@ -62,8 +63,12 @@ public slots: 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); @@ -103,8 +108,10 @@ private: int pendingFlushes; bool directAccessRun; QueuedRequestRunner *qrr; + + Opie::Core::OProcess *process; }; #endif // DESKTOP_H |