1 #include "mainwindow.h"
4 #include "httpserver.h"
9 #include <QApplication>
11 #include <QDesktopServices>
14 #include <QLinkedList>
19 int main(int argc, char *argv[])
21 SetDebugMemoryLeaks();
22 QApplication a(argc, argv);
24 a.setOrganizationName("Wordring");
25 a.setApplicationName("TM");
27 QString path = QStandardPaths::writableLocation(
28 QStandardPaths::ConfigLocation) + "/settings.ini";
29 QSettings settings(path, QSettings::IniFormat);
30 QString apppath = QCoreApplication::applicationDirPath();
31 settings.setValue("language/japanese/mecabdic", "C:/Users/Kouichi/Documents/mecab ipadic");
34 TM::Service *service = new TM::Service(&settings, &a);
35 MainWindow w(service, &settings);
36 w.setFont(QFont("Meiryo", 10.5));
37 service->load_languages(QApplication::applicationDirPath() + "/plugins");
39 HttpServer *server = new HttpServer(&w);
40 if(!server->listen({ 80, 8080, 3128, 0 }, QHostAddress::LocalHost))
41 qFatal("Could not open http server.");
42 TM::SocketServer *socket = new TM::SocketServer(w.widget(), 0, &w);
44 server->install(new TM::ProxyModule(
45 "/tm?", server->port(), socket->port(), server));
48 int result = a.exec();