New version 0.1.0
[quandoparte] / application / main.cpp
1 /*
2
3 Copyright (C) 2011 Luciano Montanaro <mikelima@cirulla.net>
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; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING.  If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19
20 */
21
22 #include "app.h"
23
24 #include <QApplication>
25 #include <QDebug>
26 #include <QLocale>
27 #include <QTranslator>
28
29 #ifndef QP_VERSION
30 #define QP_VERSION "0.0.2"
31 #endif
32
33 int main(int argc, char *argv[])
34 {
35     QApplication a(argc, argv);
36     a.setApplicationName("QuandoParte");
37     a.setOrganizationDomain("cirulla.net");
38     a.setApplicationVersion(QP_VERSION);
39
40     QString locale = QLocale::system().name();
41     QTranslator translator;
42     if (translator.load(QString("quandoparte_") + locale,
43                         App::dataDir() + "i18n")) {
44         qDebug() << "Translation for locale" << locale << "loaded";
45         a.installTranslator(&translator);
46     } else {
47         qDebug() << "Translation for locale" << locale << "not found";
48     }
49     App theApp;
50
51     return a.exec();
52 }