blob: fd5256a54c5ee5a563dec19992fb1d5f25cc1a61 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#include <QErrorMessage>
#include <QLocale>
#include <QTranslator>
#include "fb2app.hpp"
#include "fb2logs.hpp"
#include "fb2main.hpp"
#ifndef PACKAGE_NAME
#define PACKAGE_NAME "fb2edit"
#define PACKAGE_VENDOR "LinTest"
#define PACKAGE_VERSION "0.XX.XX"
#endif // PACKAGE_VERSION
QString FbApplication::lastCommit()
{
#ifdef COMMIT_INFO
return QString(COMMIT_INFO).replace("//", "<br>");
#else
return QString();
#endif // PACKAGE_VERSION
}
void FbApplication::handleMessage(QtMsgType type, const QString& msg)
{
emit logMessage(type, msg);
}
static void fb2MessageHandler(QtMsgType type, const QMessageLogContext&, const QString& msg)
{
((FbApplication*)qApp)->handleMessage(type, msg);
}
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(fb2edit);
FbApplication app(argc, argv);
app.setApplicationName(QString(PACKAGE_NAME));
app.setOrganizationName(QString(PACKAGE_VENDOR));
app.setApplicationVersion(QString(PACKAGE_VERSION));
QTranslator translator;
translator.load(QLocale::system().name(), ":ts");
app.installTranslator(&translator);
int count = app.arguments().count();
for (int i = 1; i < count; ++i) {
QString arg = app.arguments().at(i);
(new FbMainWindow(arg))->show();
}
if (count == 1) (new FbMainWindow)->show();
qInstallMessageHandler(fb2MessageHandler);
return app.exec();
}
|