summaryrefslogtreecommitdiffstats
path: root/arts/kde/kiotest.cpp
blob: ed9a3fadf2a5fef46151008cbba4b86459721598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <stdio.h>
#include <kmedia2.h>
#include <tdecmdlineargs.h>
#include <connect.h>
#include <tdelocale.h>
#include <tdeapplication.h>
#include <tdeaboutdata.h>
#include "qiomanager.h"
#include "artskde.h"

using namespace std;
using namespace Arts;


static TDECmdLineOptions options[] =
{
    { "+[URL]", I18N_NOOP("URL to open"), 0 },
    TDECmdLineLastOption
};

int main(int argc, char **argv)
{
	TDEAboutData aboutData( "kiotest", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", TDEAboutData::License_GPL, "");
							  
	TDECmdLineArgs::init(argc,argv,&aboutData);
	TDECmdLineArgs::addCmdLineOptions(options); 	
	TDEApplication app;
	QIOManager qiomanager;
	Dispatcher dispatcher(&qiomanager);
	TDEIOInputStream stream;
	StdoutWriter writer;

	TDECmdLineArgs *args = TDECmdLineArgs::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();
}