summaryrefslogtreecommitdiffstats
path: root/kmobile/testlibkmobile.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmobile/testlibkmobile.cpp
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmobile/testlibkmobile.cpp')
-rw-r--r--kmobile/testlibkmobile.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/kmobile/testlibkmobile.cpp b/kmobile/testlibkmobile.cpp
new file mode 100644
index 000000000..f89d3871f
--- /dev/null
+++ b/kmobile/testlibkmobile.cpp
@@ -0,0 +1,40 @@
+/*
+ * Test program for the KDE KMobile Library
+ * Copyright (C) 2003 Helge Deller <deller@kde.org>
+ */
+
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <qdatastream.h>
+#include <qstring.h>
+#include <kdebug.h>
+
+int main(int argc, char **argv)
+{
+ bool ok;
+
+ KApplication app(argc, argv, "kmobile_client", false);
+
+ // get our DCOP client and attach so that we may use it
+ DCOPClient *client = app.dcopClient();
+ client->attach();
+
+ QByteArray data;
+ QDataStream ds(data, IO_WriteOnly);
+// ds << QString("a");
+
+ QCString replyType;
+ QByteArray replyData;
+ ok = client->call("kmobile", "kmobileIface", "deviceNames()", data, replyType, replyData);
+
+ QDataStream reply(replyData, IO_ReadOnly);
+ QStringList deviceNames;
+ reply >> deviceNames;
+
+ kdDebug() << QString("%1\n").arg(ok?"Ok":"Failure");
+ kdDebug() << QString("Number of currently registered drivers: %1\n").arg(deviceNames.count());
+ for (int i=0; i<deviceNames.count(); i++)
+ kdDebug() << QString("Device %1: %2\n").arg(i+1).arg(deviceNames[i]);
+
+ // return app.exec();
+}