-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 | |||
@@ -31,15 +31,37 @@ | |||
31 | #include <qpe/qcopenvelope_qws.h> | 31 | #include <qpe/qcopenvelope_qws.h> |
32 | 32 | ||
33 | /* QT */ | 33 | /* QT */ |
34 | #include <qapplication.h> | ||
34 | #include <qstring.h> | 35 | #include <qstring.h> |
36 | #include <qstringlist.h> | ||
35 | 37 | ||
36 | /* STD */ | 38 | /* STD */ |
37 | #include <stdlib.h> | 39 | #include <stdlib.h> |
40 | #include <unistd.h> | ||
41 | |||
42 | extern char **environ; | ||
38 | 43 | ||
39 | int main( int argc, char** argv ) | 44 | int main( int argc, char** argv ) |
40 | { | 45 | { |
41 | qDebug( "NOTE: hotplug-qcop started" ); | 46 | qDebug( "NOTE: hotplug-qcop started" ); |
42 | qDebug( "... now doing something meaningful ..." ); | 47 | QString event( argc > 1 ? QString( argv[1] ) : QString::null ); |
48 | |||
49 | QStringList list; | ||
50 | int i = 0; | ||
51 | while( environ[i] ) | ||
52 | { | ||
53 | qDebug( "NOTE: hotplug-qcop adding '%s'", environ[i] ); | ||
54 | list += environ[i++]; | ||
55 | } | ||
56 | |||
57 | QApplication app( argc, argv ); | ||
58 | |||
59 | if ( 1 ) | ||
60 | { | ||
61 | QCopEnvelope e( "QPE/System", "HotPlugEvent(QString, QStringList)" ); | ||
62 | e << event << list; | ||
63 | } | ||
64 | |||
43 | qDebug( "NOTE: hotplug-qcop ended" ); | 65 | qDebug( "NOTE: hotplug-qcop ended" ); |
44 | return 0; | 66 | return 0; |
45 | } | 67 | } |