summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/tools/hotplug-qcop/main.cpp24
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
@@ -31,15 +31,37 @@
#include <qpe/qcopenvelope_qws.h>
/* QT */
+#include <qapplication.h>
#include <qstring.h>
+#include <qstringlist.h>
/* STD */
#include <stdlib.h>
+#include <unistd.h>
+
+extern char **environ;
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" );
return 0;
}