|
|
|
@ -18,6 +18,7 @@
@@ -18,6 +18,7 @@
|
|
|
|
|
#include "misc/settings.h" |
|
|
|
|
#include "src/ipc.h" |
|
|
|
|
#include "src/widget/toxuri.h" |
|
|
|
|
#include "src/widget/toxsave.h" |
|
|
|
|
#include <QApplication> |
|
|
|
|
#include <QFontDatabase> |
|
|
|
|
#include <QDebug> |
|
|
|
@ -85,6 +86,7 @@ int main(int argc, char *argv[])
@@ -85,6 +86,7 @@ int main(int argc, char *argv[])
|
|
|
|
|
// Inter-process communication
|
|
|
|
|
IPC ipc; |
|
|
|
|
ipc.registerEventHandler(&toxURIEventHandler); |
|
|
|
|
ipc.registerEventHandler(&toxSaveEventHandler); |
|
|
|
|
|
|
|
|
|
// Process arguments
|
|
|
|
|
if (argc >= 2) |
|
|
|
@ -107,6 +109,21 @@ int main(int argc, char *argv[])
@@ -107,6 +109,21 @@ int main(int argc, char *argv[])
|
|
|
|
|
return EXIT_SUCCESS; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (firstParam.endsWith(".tox")) |
|
|
|
|
{ |
|
|
|
|
if (ipc.isCurrentOwner()) // Don't bother sending an event if we're going to process it ourselves
|
|
|
|
|
{ |
|
|
|
|
handleToxSave(firstParam.toUtf8()); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
time_t event = ipc.postEvent(firstParam.toUtf8()); |
|
|
|
|
ipc.waitUntilProcessed(event); |
|
|
|
|
// If someone else processed it, we're done here, no need to actually start qTox
|
|
|
|
|
if (!ipc.isCurrentOwner()) |
|
|
|
|
return EXIT_SUCCESS; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Run
|
|
|
|
|