-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
63 lines (61 loc) · 1.69 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "blocklist.h"
#include <QInputDialog>
#include <QMessageBox>
#include <iostream>
#include "mainwindow.h"
#include <QApplication>
#include "updater.h"
#include "settings.h"
#include "helpdialog.h"
#include "extension/extension.h"
QNetworkAccessManager manager;
#ifdef Q_OS_WIN
#include <windows.h>
#include <winreg.h>
#endif
//QString logs;
/*void myMessageHandler(QtMsgType type, const QMessageLogContext &, const QString & msg)
{
QString txt;
switch (type) {
case QtInfoMsg:
txt = QString("Info: %1").arg(msg);
break;
case QtDebugMsg:
txt = QString("Debug: %1").arg(msg);
break;
case QtWarningMsg:
txt = QString("Warning: %1").arg(msg);
break;
case QtCriticalMsg:
txt = QString("Critical: %1").arg(msg);
break;
case QtFatalMsg:
txt = QString("Fatal: %1").arg(msg);
break;
}
std::cout<<txt.toStdString() << std::endl;
QFile outFile("out.txt");
outFile.open(QIODevice::WriteOnly | QIODevice::Append);
//std::cout<<outFile.errorString().toUtf8().data()<<std::endl;
QTextStream ts(&outFile);
ts << txt << endl;
outFile.close();
}*/
int main(int argc, char *argv[])
{
BlockList bl;
QNetworkProxyFactory::setUseSystemConfiguration(true);
/*QFile outFile("out.txt");
outFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
outFile.write("Start Logging\r\n");
outFile.close();*/
QApplication a(argc, argv);
//qInstallMessageHandler(myMessageHandler);
QDir dir("/home/christian/qdigi/extensions");
for(auto file:dir.entryList())
Extension* e=new Extension(dir.absoluteFilePath(file));
MainWindow w;
w.show();
a.exec();
}