fixed the problem of not clearing the profile

This commit is contained in:
Mitternacht822 2025-07-01 16:18:43 +04:00
parent a5705dbd70
commit bbb5a19700
3 changed files with 20 additions and 3 deletions

View file

@ -68,6 +68,13 @@ QVariant ProtocolsModel::data(const QModelIndex &index, int role) const
return QVariant();
}
void ProtocolsModel::reload()
{
beginResetModel();
endResetModel();
}
void ProtocolsModel::updateModel(const QJsonObject &content)
{
m_container = ContainerProps::containerFromString(content.value(config_key::container).toString());

View file

@ -26,6 +26,8 @@ public:
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Q_INVOKABLE void reload();
public slots:
void updateModel(const QJsonObject &content);

View file

@ -24,12 +24,19 @@ PageType {
ColumnLayout {
id: header
Connections {
/*Connections {
target: InstallController
function onCachedProfileCleared(message) {
ProtocolsModel.updateModel(ProtocolsModel.getConfig())
console.log("СИГНАЛ cachedProfileCleared СРАБОТАЛ:", message)
//ProtocolsModel.updateModel(ProtocolsModel.getConfig())
ProtocolsModel.clear()
console.log("isClientProtocolExists =", ProtocolsModel.get(0).isClientProtocolExists)
/*PageController.goToPage(PageEnum.PageMainSettings)
Qt.callLater(function() {
PageController.goToPage(PageEnum.PageSettingsServerProtocol)
})
}
}
}*/
anchors.top: parent.top
anchors.left: parent.left
@ -193,6 +200,7 @@ PageType {
PageController.showBusyIndicator(true)
InstallController.clearCachedProfile()
ProtocolsModel.reload()
PageController.showBusyIndicator(false)
}
var noButtonFunction = function() {