diff options
author | Loren Burkholder <computersemiexpert@outlook.com> | 2020-12-10 19:18:00 -0500 |
---|---|---|
committer | Loren Burkholder <computersemiexpert@outlook.com> | 2020-12-16 22:17:24 -0500 |
commit | f236032cf988950c12ebd8ff5e3cd3f9778ea55a (patch) | |
tree | 1025557f8196116bf4c262c5ec4eecaf5707094e /singleapplication.cpp | |
parent | Update CHANGELOG.md (diff) | |
download | singleapplication-f236032cf988950c12ebd8ff5e3cd3f9778ea55a.tar.xz |
Allow adding unique userdata to instances
Diffstat (limited to 'singleapplication.cpp')
-rw-r--r-- | singleapplication.cpp | 12 |
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(); +} |