kiran-control-panel/0003-fix-network-fix-the-problem-of-network-and-details-c.patch
luoqing fd13947a9a fix(network):fix the problem of network and details corresponding error,Add error prompt box when saving configuration,fix invalid configuration created for the first time,fix crash and wireless network disable function defects
- 保存配置时,增加错误提示框
  修复网络详情页面中网络与详情对应错误
  修复初次创建配置失效的问题
  修复无线网络禁用的缺陷
2022-08-23 17:40:19 +08:00

67 lines
2.6 KiB
Diff

From 50c2ccba7af88dfe335a5dfdeff54e4371238316 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 19 Aug 2022 15:24:13 +0800
Subject: [PATCH 3/7] fix(network):fix the problem of network and details
corresponding error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复网络详情页面中网络与详情对应错误
Close #I5M0L9
---
plugins/network/src/plugin/details-page.cpp | 10 ++++++----
plugins/network/src/plugin/details-page.h | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/plugins/network/src/plugin/details-page.cpp b/plugins/network/src/plugin/details-page.cpp
index dfee3f6..5ba4d12 100644
--- a/plugins/network/src/plugin/details-page.cpp
+++ b/plugins/network/src/plugin/details-page.cpp
@@ -75,11 +75,11 @@ void DetailsPage::initMultiConnectionDetailsWidget()
QWidget *widget = new ConnectionDetailsWidget(device, this);
ui->stackedWidget->addWidget(widget);
}
- connect(ui->activatedConnectionComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
- &DetailsPage::handleActivatedConnectionComboBoxChanged);
+ connect(ui->activatedConnectionComboBox, QOverload<int>::of(&QComboBox::activated), this,
+ &DetailsPage::handleActivatedConnectionComboBoxActivated, Qt::UniqueConnection);
}
-void DetailsPage::handleActivatedConnectionComboBoxChanged(int index)
+void DetailsPage::handleActivatedConnectionComboBoxActivated(int index)
{
ui->stackedWidget->setCurrentIndex(index);
}
@@ -131,10 +131,12 @@ void DetailsPage::clear()
{
m_deviceList.clear();
ui->activatedConnectionComboBox->clear();
- for (int i = 0; i < ui->stackedWidget->count(); ++i)
+ int count = ui->stackedWidget->count();
+ for (int i = 0; i < count; i++)
{
QWidget *widget = ui->stackedWidget->currentWidget();
ui->stackedWidget->removeWidget(widget);
+ widget->deleteLater();
}
}
diff --git a/plugins/network/src/plugin/details-page.h b/plugins/network/src/plugin/details-page.h
index e7cb744..f0cceb1 100644
--- a/plugins/network/src/plugin/details-page.h
+++ b/plugins/network/src/plugin/details-page.h
@@ -39,7 +39,7 @@ public:
void reload();
public slots:
- void handleActivatedConnectionComboBoxChanged(int index);
+ void handleActivatedConnectionComboBoxActivated(int index);
void handleDeviceAdded(const QString &devicePath);
void handleDeviceRemoved(const QString &devicePath);
void handleActiveConnectionAdded(const QString &activeConnectionPath);
--
2.33.0