summary refs log tree commit diff
path: root/third_party/SingleApplication-3.3.2/examples/sending_arguments
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/SingleApplication-3.3.2/examples/sending_arguments')
-rw-r--r--third_party/SingleApplication-3.3.2/examples/sending_arguments/CMakeLists.txt20
-rwxr-xr-xthird_party/SingleApplication-3.3.2/examples/sending_arguments/main.cpp28
-rw-r--r--third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.cpp12
-rw-r--r--third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.h15
-rwxr-xr-xthird_party/SingleApplication-3.3.2/examples/sending_arguments/sending_arguments.pro9
5 files changed, 0 insertions, 84 deletions
diff --git a/third_party/SingleApplication-3.3.2/examples/sending_arguments/CMakeLists.txt b/third_party/SingleApplication-3.3.2/examples/sending_arguments/CMakeLists.txt
deleted file mode 100644

index 2cc55975..00000000 --- a/third_party/SingleApplication-3.3.2/examples/sending_arguments/CMakeLists.txt +++ /dev/null
@@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.7.0) - -project(sending_arguments LANGUAGES CXX) - -set(CMAKE_AUTOMOC ON) - -# SingleApplication base class -set(QAPPLICATION_CLASS QCoreApplication) -add_subdirectory(../.. SingleApplication) - -find_package(Qt${QT_DEFAULT_MAJOR_VERSION} COMPONENTS Core REQUIRED) - -add_executable(${PROJECT_NAME} - main.cpp - messagereceiver.cpp - messagereceiver.h - main.cpp -) - -target_link_libraries(${PROJECT_NAME} SingleApplication::SingleApplication) diff --git a/third_party/SingleApplication-3.3.2/examples/sending_arguments/main.cpp b/third_party/SingleApplication-3.3.2/examples/sending_arguments/main.cpp deleted file mode 100755
index a9d34dd9..00000000 --- a/third_party/SingleApplication-3.3.2/examples/sending_arguments/main.cpp +++ /dev/null
@@ -1,28 +0,0 @@ -#include <singleapplication.h> -#include "messagereceiver.h" - -int main(int argc, char *argv[]) -{ - // Allow secondary instances - SingleApplication app( argc, argv, true ); - - MessageReceiver msgReceiver; - - // If this is a secondary instance - if( app.isSecondary() ) { - app.sendMessage( app.arguments().join(' ').toUtf8() ); - qDebug() << "App already running."; - qDebug() << "Primary instance PID: " << app.primaryPid(); - qDebug() << "Primary instance user: " << app.primaryUser(); - return 0; - } else { - QObject::connect( - &app, - &SingleApplication::receivedMessage, - &msgReceiver, - &MessageReceiver::receivedMessage - ); - } - - return app.exec(); -} diff --git a/third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.cpp b/third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.cpp deleted file mode 100644
index 0560b072..00000000 --- a/third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.cpp +++ /dev/null
@@ -1,12 +0,0 @@ -#include <QDebug> -#include "messagereceiver.h" - -MessageReceiver::MessageReceiver(QObject *parent) : QObject(parent) -{ -} - -void MessageReceiver::receivedMessage(int instanceId, QByteArray message) -{ - qDebug() << "Received message from instance: " << instanceId; - qDebug() << "Message Text: " << message; -} diff --git a/third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.h b/third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.h deleted file mode 100644
index 50a970c8..00000000 --- a/third_party/SingleApplication-3.3.2/examples/sending_arguments/messagereceiver.h +++ /dev/null
@@ -1,15 +0,0 @@ -#ifndef MESSAGERECEIVER_H -#define MESSAGERECEIVER_H - -#include <QObject> - -class MessageReceiver : public QObject -{ - Q_OBJECT -public: - explicit MessageReceiver(QObject *parent = 0); -public slots: - void receivedMessage( int instanceId, QByteArray message ); -}; - -#endif // MESSAGERECEIVER_H diff --git a/third_party/SingleApplication-3.3.2/examples/sending_arguments/sending_arguments.pro b/third_party/SingleApplication-3.3.2/examples/sending_arguments/sending_arguments.pro deleted file mode 100755
index 897636a9..00000000 --- a/third_party/SingleApplication-3.3.2/examples/sending_arguments/sending_arguments.pro +++ /dev/null
@@ -1,9 +0,0 @@ -# Single Application implementation -include(../../singleapplication.pri) -DEFINES += QAPPLICATION_CLASS=QCoreApplication - -SOURCES += main.cpp \ - messagereceiver.cpp - -HEADERS += \ - messagereceiver.h