diff options
Diffstat (limited to 'synchronizer')
-rw-r--r-- | synchronizer/main.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/synchronizer/main.cpp b/synchronizer/main.cpp index e000e03..8335e67 100644 --- a/synchronizer/main.cpp +++ b/synchronizer/main.cpp | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include "listener.h" | 29 | #include "listener.h" |
30 | #include "log.h" | 30 | #include "log.h" |
31 | #include "test.h" | ||
31 | 32 | ||
32 | #undef DEBUG_AREA | 33 | #undef DEBUG_AREA |
33 | #define DEBUG_AREA "resource" | 34 | #define DEBUG_AREA "resource" |
@@ -123,13 +124,23 @@ int main(int argc, char *argv[]) | |||
123 | 124 | ||
124 | QCoreApplication app(argc, argv); | 125 | QCoreApplication app(argc, argv); |
125 | 126 | ||
126 | if (argc < 3) { | 127 | QByteArrayList arguments; |
128 | for (int i = 0; i < argc; i++) { | ||
129 | arguments << argv[i]; | ||
130 | } | ||
131 | if (arguments.contains("--test")) { | ||
132 | Log() << "Running in test-mode"; | ||
133 | arguments.removeAll("--test"); | ||
134 | Sink::Test::setTestModeEnabled(true); | ||
135 | } | ||
136 | |||
137 | if (arguments.count() < 3) { | ||
127 | Warning() << "Not enough args passed, no resource loaded."; | 138 | Warning() << "Not enough args passed, no resource loaded."; |
128 | return app.exec(); | 139 | return app.exec(); |
129 | } | 140 | } |
130 | 141 | ||
131 | const QByteArray instanceIdentifier = argv[1]; | 142 | const QByteArray instanceIdentifier = arguments.at(1); |
132 | const QByteArray resourceType = argv[2]; | 143 | const QByteArray resourceType = arguments.at(2); |
133 | app.setApplicationName(instanceIdentifier); | 144 | app.setApplicationName(instanceIdentifier); |
134 | 145 | ||
135 | QLockFile lockfile(instanceIdentifier + ".lock"); | 146 | QLockFile lockfile(instanceIdentifier + ".lock"); |