Skip to content
Permalink
Browse files
Only restart after network connect when the configuration was modified
Issues: #2046 #2033

The deCONZ core was further fixed to preserve the original argc and argv on each restart. QApplication would otherwise strip parameters like "-platform minimal" and
start the GUI albeit headless mode was specified.
  • Loading branch information
manup committed Nov 9, 2019
1 parent 54efc6e commit 048180ee819d050160b6d2ecb2ab61bd1ea56635
Showing 3 changed files with 8 additions and 1 deletion.
@@ -16396,7 +16396,11 @@ void DeRestPluginPrivate::reconnectNetwork()
{
reconnectTimer->stop();
}
qApp->exit(APP_RET_RESTART_APP);

if (needRestartApp)
{
qApp->exit(APP_RET_RESTART_APP);
}
return;
}

@@ -1631,6 +1631,7 @@ public Q_SLOTS:
int networkDisconnectAttempts;
int networkReconnectAttempts;
bool networkConnectedBefore;
bool needRestartApp = false;

// delete device state machine
enum ResetDeviceState
@@ -2320,6 +2320,7 @@ int DeRestPluginPrivate::importConfig(const ApiRequest &req, ApiResponse &rsp)
rspItem["success"] = rspItemState;
rsp.list.append(rspItem);

needRestartApp = true;
QTimer *restartTimer = new QTimer(this);
restartTimer->setSingleShot(true);
connect(restartTimer, SIGNAL(timeout()),
@@ -2388,6 +2389,7 @@ int DeRestPluginPrivate::resetConfig(const ApiRequest &req, ApiResponse &rsp)
//wait some seconds that deCONZ can finish Enpoint config,
//then restart app to apply network config (only on raspbee gw)

needRestartApp = true;
QTimer *restartTimer = new QTimer(this);
restartTimer->setSingleShot(true);
connect(restartTimer, SIGNAL(timeout()),

0 comments on commit 048180e

Please sign in to comment.