mirror of
https://github.com/chris2511/xca.git
synced 2026-09-13 18:46:25 +05:00
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
66 lines
1.2 KiB
C++
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;
|
|
}
|