1
0

qml: rm QEConfig.serverString. Network.server is sufficient

If there is no network object, it's ok not to be able to customise it.
This commit is contained in:
SomberNight
2023-03-29 21:56:33 +00:00
parent d46d23b103
commit 9ef6d6a56f
4 changed files with 1 additions and 13 deletions

View File

@@ -42,7 +42,6 @@ ElDialog {
icon.source: '../../icons/confirmed.png' icon.source: '../../icons/confirmed.png'
onClicked: { onClicked: {
Config.autoConnect = serverconfig.auto_connect Config.autoConnect = serverconfig.auto_connect
Config.serverString = serverconfig.address
Network.server = serverconfig.address Network.server = serverconfig.address
rootItem.close() rootItem.close()
} }

View File

@@ -24,7 +24,6 @@ Wizard {
Config.autoConnect = wizard_data['autoconnect'] Config.autoConnect = wizard_data['autoconnect']
if (!wizard_data['autoconnect']) { if (!wizard_data['autoconnect']) {
Network.server = wizard_data['server'] Network.server = wizard_data['server']
Config.serverString = wizard_data['server']
} }
} }

View File

@@ -93,7 +93,7 @@ Item {
Component.onCompleted: { Component.onCompleted: {
root.auto_connect = Config.autoConnectDefined ? Config.autoConnect : false root.auto_connect = Config.autoConnectDefined ? Config.autoConnect : false
root.address = Config.serverString ? Config.serverString : Network.server root.address = Network.server
// TODO: initial setup should not connect already, is Network.server defined? // TODO: initial setup should not connect already, is Network.server defined?
} }
} }

View File

@@ -57,16 +57,6 @@ class QEConfig(AuthMixin, QObject):
def autoConnectDefined(self): def autoConnectDefined(self):
return self.config.get('auto_connect') is not None return self.config.get('auto_connect') is not None
serverStringChanged = pyqtSignal()
@pyqtProperty('QString', notify=serverStringChanged)
def serverString(self):
return self.config.get('server')
@serverString.setter
def serverString(self, server):
self.config.set_key('server', server, True)
self.serverStringChanged.emit()
manualServerChanged = pyqtSignal() manualServerChanged = pyqtSignal()
@pyqtProperty(bool, notify=manualServerChanged) @pyqtProperty(bool, notify=manualServerChanged)
def manualServer(self): def manualServer(self):