aboutsummaryrefslogtreecommitdiff
path: root/singleapplication.cpp
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2020-12-10 19:18:00 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2020-12-16 22:17:24 -0500
commitf236032cf988950c12ebd8ff5e3cd3f9778ea55a (patch)
tree1025557f8196116bf4c262c5ec4eecaf5707094e /singleapplication.cpp
parentUpdate CHANGELOG.md (diff)
downloadsingleapplication-f236032cf988950c12ebd8ff5e3cd3f9778ea55a.tar.xz
Allow adding unique userdata to instances
Diffstat (limited to 'singleapplication.cpp')
-rw-r--r--singleapplication.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/singleapplication.cpp b/singleapplication.cpp
index a4f842e..276ceee 100644
--- a/singleapplication.cpp
+++ b/singleapplication.cpp
@@ -36,7 +36,7 @@
* @param options Optional flags to toggle specific behaviour
* @param timeout Maximum time blocking functions are allowed during app load
*/
-SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSecondary, Options options, int timeout )
+SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSecondary, Options options, int timeout, QString userData )
: app_t( argc, argv ), d_ptr( new SingleApplicationPrivate( this ) )
{
Q_D( SingleApplication );
@@ -51,6 +51,10 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
// Store the current mode of the program
d->options = options;
+ // Add any unique user data
+ if ( ! userData.isEmpty() )
+ d->addAppData( userData );
+
// Generating an application ID used for identifying the shared memory
// block and QLocalServer
d->genBlockServerName();
@@ -262,3 +266,9 @@ void SingleApplication::abortSafely()
delete d;
::exit( EXIT_FAILURE );
}
+
+QStringList SingleApplication::userData()
+{
+ Q_D( SingleApplication );
+ return d->appData();
+}