Subversion Repositories public

Rev

Rev 232 | Rev 246 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
88 andreas 1
/***************************************************************************
232 andreas 2
 *   Copyright (C) 2007 - 2009 by Andreas Theofilu                         *
119 andreas 3
 *   andreas@theosys.at                                                    *
88 andreas 4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation version 3 of the License.                *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
19
 
232 andreas 20
/*
21
 * Ported to KDE4 on Jul. 8 2009 by Andreas Theofilu.
22
 */
132 andreas 23
#include "config.h"
245 andreas 24
#include "sportwatcher.h"
25
#include <KApplication>
26
#include <KAboutData>
88 andreas 27
#include <kcmdlineargs.h>
245 andreas 28
#include <KLocale>
29
#include <k3mimesourcefactory.h>
119 andreas 30
#include <kstandarddirs.h>
245 andreas 31
#include <KIconLoader>
88 andreas 32
 
132 andreas 33
// #include <iostream.h>
34
extern KApplication *mapp;
35
KApplication *mapp;
119 andreas 36
 
88 andreas 37
static const char description[] =
245 andreas 38
    I18N_NOOP("Reading out the Garmin Forerunner over USB port.");
88 andreas 39
 
132 andreas 40
static const char version[] = VERSION;
88 andreas 41
 
245 andreas 42
int main(int argc, char *argv[])
88 andreas 43
{
245 andreas 44
    KAboutData about("sportwatcher", 0, ki18n("SportWatcher"), version, ki18n(description),
45
                     KAboutData::License_GPL_V3, ki18n("(C) 2007 - 2009 Andreas Theofilu"),
46
                     KLocalizedString(), "http://www.theosys.at", "andreas@theosys.at");
47
    about.addAuthor( ki18n("Andreas Theofilu"), ki18n("Maintainer, Project Management, Developer"), "andreas@theosys.at" );
48
    about.addCredit( ki18n("Dave Bailey"), KLocalizedString(), "dave@daveb.net");
49
    about.setTranslator (ki18n("Andreas Theofilu"), ki18n("andreas@theosys.at"));
88 andreas 50
 
51
    KCmdLineArgs::init(argc, argv, &about);
245 andreas 52
/*    KCmdLineOptions options;
232 andreas 53
    options.add ("+[URL]", ki18n ("Document to open"));
54
    KCmdLineArgs::addCmdLineOptions (options);
245 andreas 55
*/
56
//    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
57
 
88 andreas 58
    KApplication app;
245 andreas 59
    sportwatcher *mainWin = new sportwatcher;
60
    mainWin->show();
88 andreas 61
 
245 andreas 62
//    args->clear();
88 andreas 63
 
245 andreas 64
	K3MimeSourceFactory::install();
65
	K3MimeSourceFactory *kmsf = new K3MimeSourceFactory (KIconLoader::global());
66
	K3MimeSourceFactory::addFactory (kmsf);
67
	K3MimeSourceFactory::setDefaultFactory (kmsf);
232 andreas 68
 
245 andreas 69
	kmsf->addFilePath(KGlobal::dirs()->findResourceDir("icon", "hand.png"));
119 andreas 70
	QStringList icons = KGlobal::dirs()->resourceDirs("icon");
71
	QStringList::Iterator it;
72
 
73
	for (it = icons.begin(); it != icons.end(); ++it)
74
	{
245 andreas 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
	}
88 andreas 81
 
132 andreas 82
    mapp = &app;
88 andreas 83
    // mainWin has WDestructiveClose flag by default, so it will delete itself.
84
    return app.exec();
85
}
86