fix logic
[personal-kdelibs.git] / khtml / java / tests / testkjavaappletserver.cpp
blob454f832bd042c42ddb234dd4fca65bf7d903443f
1 #include <QtCore/QDebug>
2 #include <kapplication.h>
3 #include <kcmdlineargs.h>
4 #include <kdebug.h>
5 #include <QtCore/QString>
6 #include <stdio.h>
7 #include <unistd.h>
9 #include "java/kjavaappletserver.h"
10 #include "java/kjavaapplet.h"
11 #include "java/kjavaappletcontext.h"
12 #include "java/kjavaappletwidget.h"
14 int main(int argc, char **argv)
16 KCmdLineArgs::init( argc, argv, "testKJASSever", 0, ki18n("testKJASServer"), "0.0", ki18n("test program"));
18 KCmdLineOptions options;
19 options.add("+kdelibspath", ki18n("path to kdelibs directory"));
21 KCmdLineArgs::addCmdLineOptions( options );
22 //KCmdLineArgs::addStdCmdLineOptions();
24 KApplication app;
26 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
27 QByteArray path;
28 #if 0
29 path = args->getOption("kdelibspath");
30 if (path.isEmpty())
32 kWarning() << "you need to specify a path to your kdelibs source dir, see \"--help\"";
33 return -1;
35 #else
36 #ifdef __GNUC__
37 #warning better adjust this :)
38 #endif
39 path = "/home/danimo/src/kde/trunk/KDE/kdelibs/";
40 #endif
41 QString testpath = "file://" + path + "/kdelibs/khtml/test/";
43 KJavaAppletContext *context = new KJavaAppletContext;
44 KJavaAppletWidget *a = new KJavaAppletWidget;
45 a->applet()->setAppletContext(context);
47 a->show();
49 // c->registerApplet(a->applet());
51 a->applet()->setBaseURL( testpath );
52 a->applet()->setAppletName( "Lake" );
53 a->applet()->setAppletClass( "lake.class" );
54 a->applet()->setParameter( "image", "konqi.gif" );
56 a->showApplet();
57 a->applet()->start();
59 app.exec();