forked from PeterS242/YARRH
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
46 lines (37 loc) · 1.2 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
43
44
45
46
#include <QtGui/QApplication>
#include <QDebug>
#include <QTextCodec>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
//setting string codecs
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName ("UTF-8"));
QApplication a(argc, argv);
QString locale = QLocale::system().name();
QString message;
//get arguments
for (int a = 0; a < argc; ++a) {
message += argv[a];
message += "-||-";
}
// if (a.sendMessage(message))
// return 0;
// a.initialize(FALSE);
// if(a.isRunning()){
// return 0;
// }
QCoreApplication::setOrganizationName("wuflnor");
// XXX This domain is only for Mac settings.
QCoreApplication::setOrganizationDomain("wuflnor.github.org");
QCoreApplication::setApplicationName("YARRH");
QTranslator translator;
qDebug() << translator.load(QString(":/yarrh_")+locale);
a.installTranslator(&translator);
MainWindow w;
QObject::connect(&a, SIGNAL(messageReceived(const QString&)),
&w, SLOT(processMessage(const QString&)));
w.show();
w.processMessage(message);
return a.exec();
}