small simplification.
[Rockbox.git] / rbutil / rbutilqt / main.cpp
blobd9c1b32e2e37b00d764d079941514c64853c5e38
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Riebeling
10 * $Id$
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
21 #include <QtGui>
22 #include "rbutilqt.h"
25 int main( int argc, char ** argv ) {
26 QApplication app( argc, argv );
28 QString absolutePath = qApp->applicationDirPath();
29 // portable installation:
30 // check for a configuration file in the program folder.
31 QSettings *user;
32 if(QFileInfo(absolutePath + "/RockboxUtility.ini").isFile())
33 user = new QSettings(absolutePath + "/RockboxUtility.ini", QSettings::IniFormat, 0);
34 else user = new QSettings(QSettings::IniFormat, QSettings::UserScope, "rockbox.org", "RockboxUtility");
36 QTranslator translator;
37 if(user->value("defaults/lang").toString() != "")
38 // install translator
39 if(user->value("defaults/lang", "").toString() != "") {
40 if(!translator.load(user->value("defaults/lang").toString(), absolutePath))
41 translator.load(user->value("defaults/lang").toString(), ":/lang");
43 delete user;
44 app.installTranslator(&translator);
46 RbUtilQt window(0);
47 window.show();
49 // app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );
50 return app.exec();