Ref T195, application restart functions

* allow to get current arguments joined with new ones
* removed old inheritedArguments function
* unregisterAsRunning (for restart)
* restart function
This commit is contained in:
Klaus Basan
2017-11-16 02:18:46 +01:00
parent 948a0c1eee
commit f33c198d5d
4 changed files with 129 additions and 37 deletions

View File

@@ -545,12 +545,12 @@ namespace BlackCore
return m_interimPositionReceivers;
}
QStringList CNetworkVatlib::inheritedArguments()
QStringList CNetworkVatlib::vatlibArguments()
{
QStringList args;
int id = 0;
QString key;
if (!getCmdLineClientIdAndKey(id, key)) return args;
if (!getCmdLineClientIdAndKey(id, key)) { return args; }
args << "--idAndKey";
args << sApp->getParserValue("clientIdAndKey"); // as typed in
return args;
@@ -723,6 +723,11 @@ namespace BlackCore
bool CNetworkVatlib::getCmdLineClientIdAndKey(int &id, QString &key)
{
// init values
id = 0;
key = "";
// split parser values
const QString clientIdAndKey = sApp->getParserValue("clientIdAndKey").toLower();
if (clientIdAndKey.isEmpty() || !clientIdAndKey.contains(':')) { return false; }
const auto stringList = clientIdAndKey.split(':');

View File

@@ -117,7 +117,7 @@ namespace BlackCore
//! @}
//! Arguments to be passed to another swift appplication
static QStringList inheritedArguments();
static QStringList vatlibArguments();
//! \name Weather functions
//! @{