Subversion Repositories public

Rev

Rev 245 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 245 Rev 246
Line 27... Line 27...
27
#include <kcmdlineargs.h>
27
#include <kcmdlineargs.h>
28
#include <KLocale>
28
#include <KLocale>
29
#include <k3mimesourcefactory.h>
29
#include <k3mimesourcefactory.h>
30
#include <kstandarddirs.h>
30
#include <kstandarddirs.h>
31
#include <KIconLoader>
31
#include <KIconLoader>
-
 
32
#include <stdlib.h>
32
 
33
 
33
// #include <iostream.h>
34
// #include <iostream.h>
34
extern KApplication *mapp;
35
extern KApplication *mapp;
35
KApplication *mapp;
36
KApplication *mapp;
36
 
37
 
Line 39... Line 40...
39
 
40
 
40
static const char version[] = VERSION;
41
static const char version[] = VERSION;
41
 
42
 
42
int main(int argc, char *argv[])
43
int main(int argc, char *argv[])
43
{
44
{
-
 
45
#ifdef HAVE_GDAL
-
 
46
    /*
-
 
47
     * To make sure, we can draw a map, especialy if we use a WMS-server,
-
 
48
     * we must make sure, that the environment variable LC_NUMERIC is set
-
 
49
     * to C. Otherwise some functions may translate numbers into a localized
-
 
50
     * version, who may not work.
-
 
51
     * This is a known error of GDAL 1.5. Hopefully this is corrected with
-
 
52
     * GDAL 1.6, to have numbers in the application shown correct.
-
 
53
     */
-
 
54
    if (setenv ("LC_NUMERIC", "C", 1) == -1)
-
 
55
       fprintf (stderr, "Error setting the environment variable \"LC_NUMERIC\"!");
-
 
56
#endif
44
    KAboutData about("sportwatcher", 0, ki18n("SportWatcher"), version, ki18n(description),
57
    KAboutData about("sportwatcher", 0, ki18n("SportWatcher"), version, ki18n(description),
45
                     KAboutData::License_GPL_V3, ki18n("(C) 2007 - 2009 Andreas Theofilu"),
58
                     KAboutData::License_GPL_V3, ki18n("(C) 2007 - 2009 Andreas Theofilu"),
46
                     KLocalizedString(), "http://www.theosys.at", "andreas@theosys.at");
59
                     KLocalizedString(), "http://www.theosys.at", "andreas@theosys.at");
47
    about.addAuthor( ki18n("Andreas Theofilu"), ki18n("Maintainer, Project Management, Developer"), "andreas@theosys.at" );
60
    about.addAuthor( ki18n("Andreas Theofilu"), ki18n("Maintainer, Project Management, Developer"), "andreas@theosys.at" );
48
    about.addCredit( ki18n("Dave Bailey"), KLocalizedString(), "dave@daveb.net");
61
    about.addCredit( ki18n("Dave Bailey"), KLocalizedString(), "dave@daveb.net");
49
    about.setTranslator (ki18n("Andreas Theofilu"), ki18n("andreas@theosys.at"));
62
    about.setTranslator (ki18n("Andreas Theofilu"), ki18n("andreas@theosys.at"));
50
 
63
 
51
    KCmdLineArgs::init(argc, argv, &about);
64
    KCmdLineArgs::init(argc, argv, &about);
52
/*    KCmdLineOptions options;
-
 
53
    options.add ("+[URL]", ki18n ("Document to open"));
-
 
54
    KCmdLineArgs::addCmdLineOptions (options);
-
 
55
*/
-
 
56
//    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-
 
57
 
65
 
58
    KApplication app;
66
    KApplication app;
59
    sportwatcher *mainWin = new sportwatcher;
67
    sportwatcher *mainWin = new sportwatcher;
60
    mainWin->show();
68
    mainWin->show();
61
 
69
 
62
//    args->clear();
-
 
63
 
-
 
64
	K3MimeSourceFactory::install();
-
 
65
	K3MimeSourceFactory *kmsf = new K3MimeSourceFactory (KIconLoader::global());
-
 
66
	K3MimeSourceFactory::addFactory (kmsf);
-
 
67
	K3MimeSourceFactory::setDefaultFactory (kmsf);
-
 
68
 
-
 
69
	kmsf->addFilePath(KGlobal::dirs()->findResourceDir("icon", "hand.png"));
-
 
70
	QStringList icons = KGlobal::dirs()->resourceDirs("icon");
-
 
71
	QStringList::Iterator it;
-
 
72
 
-
 
73
	for (it = icons.begin(); it != icons.end(); ++it)
-
 
74
	{
-
 
75
	   kmsf->addFilePath(*it);
-
 
76
	   kmsf->addFilePath(*it);
-
 
77
	   kmsf->addFilePath(*it + "sportwatcher/16x16/actions/");
-
 
78
	   kmsf->addFilePath(*it + "hicolor/16x16/actions/");
-
 
79
	   kmsf->addFilePath(*it + "default.kde/16x16/actions/");
-
 
80
	}
-
 
81
 
-
 
82
    mapp = &app;
70
    mapp = &app;
83
    // mainWin has WDestructiveClose flag by default, so it will delete itself.
71
    // mainWin has WDestructiveClose flag by default, so it will delete itself.
84
    return app.exec();
72
    return app.exec();
85
}
73
}
86
 
74