Skip to content

Commit 048180e

Browse files
committed
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.
1 parent 54efc6e commit 048180e

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

de_web_plugin.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16396,7 +16396,11 @@ void DeRestPluginPrivate::reconnectNetwork()
1639616396
{
1639716397
reconnectTimer->stop();
1639816398
}
16399-
qApp->exit(APP_RET_RESTART_APP);
16399+
16400+
if (needRestartApp)
16401+
{
16402+
qApp->exit(APP_RET_RESTART_APP);
16403+
}
1640016404
return;
1640116405
}
1640216406

de_web_plugin_private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,7 @@ public Q_SLOTS:
16311631
int networkDisconnectAttempts;
16321632
int networkReconnectAttempts;
16331633
bool networkConnectedBefore;
1634+
bool needRestartApp = false;
16341635

16351636
// delete device state machine
16361637
enum ResetDeviceState

rest_configuration.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,6 +2320,7 @@ int DeRestPluginPrivate::importConfig(const ApiRequest &req, ApiResponse &rsp)
23202320
rspItem["success"] = rspItemState;
23212321
rsp.list.append(rspItem);
23222322

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

2392+
needRestartApp = true;
23912393
QTimer *restartTimer = new QTimer(this);
23922394
restartTimer->setSingleShot(true);
23932395
connect(restartTimer, SIGNAL(timeout()),

0 commit comments

Comments
 (0)