-rw-r--r-- | core/tools/hotplug-qcop/main.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/core/tools/hotplug-qcop/main.cpp b/core/tools/hotplug-qcop/main.cpp index bd5431d..9c585ce 100644 --- a/core/tools/hotplug-qcop/main.cpp +++ b/core/tools/hotplug-qcop/main.cpp @@ -33,3 +33,5 @@ /* QT */ +#include <qapplication.h> #include <qstring.h> +#include <qstringlist.h> @@ -37,2 +39,5 @@ #include <stdlib.h> +#include <unistd.h> + +extern char **environ; @@ -41,3 +46,20 @@ int main( int argc, char** argv ) qDebug( "NOTE: hotplug-qcop started" ); - qDebug( "... now doing something meaningful ..." ); + QString event( argc > 1 ? QString( argv[1] ) : QString::null ); + + QStringList list; + int i = 0; + while( environ[i] ) + { + qDebug( "NOTE: hotplug-qcop adding '%s'", environ[i] ); + list += environ[i++]; + } + + QApplication app( argc, argv ); + + if ( 1 ) + { + QCopEnvelope e( "QPE/System", "HotPlugEvent(QString, QStringList)" ); + e << event << list; + } + qDebug( "NOTE: hotplug-qcop ended" ); |