summaryrefslogtreecommitdiffstats
path: root/arts/kde/kiotest.cc
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
commitce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch)
tree5ac38a06f3dde268dc7927dc155896926aaf7012 /arts/kde/kiotest.cc
downloadtdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz
tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.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/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'arts/kde/kiotest.cc')
-rw-r--r--arts/kde/kiotest.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/arts/kde/kiotest.cc b/arts/kde/kiotest.cc
new file mode 100644
index 000000000..b5403ce0d
--- /dev/null
+++ b/arts/kde/kiotest.cc
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include <kmedia2.h>
+#include <kcmdlineargs.h>
+#include <connect.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include "qiomanager.h"
+#include "artskde.h"
+
+using namespace std;
+using namespace Arts;
+
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP("URL to open"), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData aboutData( "kiotest", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
+
+ KCmdLineArgs::init(argc,argv,&aboutData);
+ KCmdLineArgs::addCmdLineOptions(options);
+ KApplication app;
+ QIOManager qiomanager;
+ Dispatcher dispatcher(&qiomanager);
+ KIOInputStream stream;
+ StdoutWriter writer;
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if(args->count())
+ {
+ if(!stream.openURL(args->arg(0)))
+ {
+ printf("can't open url");
+ exit(1);
+ }
+ }
+ else
+ exit(1);
+
+ args->clear();
+
+ connect(stream, writer);
+
+ writer.start();
+ stream.start();
+
+ app.exec();
+}