diff options
Diffstat (limited to 'synchronizer/main.cpp')
-rw-r--r-- | synchronizer/main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp new file mode 100644 index 0000000..91c0a9a --- /dev/null +++ b/synchronizer/main.cpp | |||
@@ -0,0 +1,25 @@ | |||
1 | |||
2 | #include <QApplication> | ||
3 | |||
4 | #include "common/console.h" | ||
5 | #include "listener.h" | ||
6 | |||
7 | int main(int argc, char *argv[]) | ||
8 | { | ||
9 | QApplication app(argc, argv); | ||
10 | |||
11 | new Console(QString("Resource: %1").arg(argv[1])); | ||
12 | if (argc < 2) { | ||
13 | Console::main()->log("Not enough args"); | ||
14 | return app.exec(); | ||
15 | } | ||
16 | |||
17 | Listener *listener = new Listener(argv[1]); | ||
18 | |||
19 | QObject::connect(&app, &QCoreApplication::aboutToQuit, | ||
20 | listener, &Listener::closeAllConnections); | ||
21 | QObject::connect(listener, &Listener::noClients, | ||
22 | &app, &QCoreApplication::quit); | ||
23 | |||
24 | return app.exec(); | ||
25 | } \ No newline at end of file | ||