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 with 8 additions and 1 deletion.
  1. +5 −1 de_web_plugin.cpp
  2. +1 −0 de_web_plugin_private.h
  3. +2 −0 rest_configuration.cpp
{
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.
You can’t perform that action at this time.