forked from UTAwesome/UTLauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
42 lines (36 loc) · 1.36 KB
/
main.cpp
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
#include "utlauncher.h"
#include <QtPlugin>
#include <QDebug>
#include <iostream>
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
QByteArray localMsg = msg.toLocal8Bit();
switch (type) {
case QtDebugMsg:
fprintf(stderr, "Debug: %s\n\0 (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
break;
case QtWarningMsg:
fprintf(stderr, "Warning: %s\n\0 (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
break;
case QtCriticalMsg:
fprintf(stderr, "Critical: %s\n\0 (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
break;
case QtFatalMsg:
fprintf(stderr, "Fatal: %s\n\0 (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
abort();
}
}
int main(int argc, char** argv)
{
qInstallMessageHandler(myMessageOutput);
qDebug() << "Starting application";
QCoreApplication::setOrganizationName("CodeCharm");
QCoreApplication::setOrganizationDomain("codecharm.co.uk");
QCoreApplication::setApplicationName("UTLauncher");
// QApplication::setDesktopSettingsAware(false);
UTLauncher app(argc, argv);
return app.exec();
}
#ifdef STATIC_PLUGIN_WINDOWS
Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin);
#endif