xca/lib/main.cpp
Christian Hohnstaedt de851ed3a9 Changed all header includes to QT4 names and included the correct component name
By Andreas Piesk. Thanks!

adapt to HEAD since the patch is based on 0.6.4

drop qt4/Qt include in list of includes during configuration
2010-06-13 11:49:38 +02:00

66 lines
1.2 KiB
C++

/* vi: set sw=4 ts=4:
*
* Copyright (C) 2001 - 2007 Christian Hohnstaedt.
*
* All rights reserved.
*/
#include <QtGui/QApplication>
#include <QtCore/QTranslator>
#include <QtCore/QTextCodec>
#include <QtCore/QDir>
#include "widgets/MainWindow.h"
#include "lib/func.h"
#ifdef WIN32
#include <windows.h>
#endif
int main( int argc, char *argv[] )
{
int ret = 0, pkictr;
QString locale;
QTranslator qtTr;
QTranslator xcaTr;
MainWindow *mw;
QApplication a( argc, argv );
locale = QLocale::system().name();
QStringList dirs;
dirs << getPrefix()
<< "/usr/local/share/qt4/translations/"
<< "/usr/share/qt4/translations/"
<< "/usr/share/qt/translations/"
<< ".";
foreach(QString dir, dirs) {
if (qtTr.load(QString("qt_%1").arg(locale), dir)) {
break;
}
}
xcaTr.load(QString("xca_%1").arg(locale), getPrefix());
a.installTranslator(&qtTr);
a.installTranslator(&xcaTr);
#ifdef Q_WS_MAC
QStringList libp = a.libraryPaths();
libp.prepend(a.applicationDirPath() + "/../Plugins");
a.setLibraryPaths(libp);
#endif
mw = new MainWindow(NULL);
mw->read_cmdline();
if (mw->exitApp == 0) {
mw->show();
ret = a.exec();
}
delete mw;
pkictr = pki_base::get_pki_counter();
if (pkictr)
printf("PKI Counter (%d)\n", pkictr);
return ret;
}