[go: up one dir, main page]

Menu

[47b41e]: / src / main.cpp~  Maximize  Restore  History

Download this file

53 lines (48 with data), 2.2 kB

/***************************************************************************
 *   Copyright (C) 2009 by Andrey Sharoyko   *
 *   rabidvan@mail.ru   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include <QDebug>
#include <QApplication>
#include <QIcon>
#include <QString>
#include "translator.h"
#include "database.h"
#include "mainwindow.h"

using namespace BlogStats;

int main ( int argc, char *argv[], char *envp[] )
{
	Q_INIT_RESOURCE ( application );
	QApplication app ( argc, argv );
    Translator trans(envp);
    if( trans.bInstall)
        app.installTranslator(&trans);
    app.setOrganizationName(QObject::tr("Vanyamba Software"));
    app.setOrganizationDomain("vanyamba-software.com");
    app.setApplicationName(QObject::tr("BlogStats"));
    app.setWindowIcon(QIcon(QString(":/images/blogstatsapp.png")));
	if ( !Database::checkDrivers() )
	{
		qCritical () << QObject::tr("Can't find Sqlite driver for Qt.");
		exit ( EXIT_FAILURE );
	}
    Database db;
	MainWindow * mw = new MainWindow();
	mw->show();
	return app.exec();
}