fix(search&network): Adjusting the display style of manually registered search keywords,fix network crash
This commit is contained in:
parent
7a628e9cd6
commit
946b3d8e4e
@ -0,0 +1,69 @@
|
||||
From f6d26e5eae0bdc8f3e37b83caea40c750d5166a2 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Thu, 18 Apr 2024 16:57:29 +0800
|
||||
Subject: [PATCH 6/7] fix(search): Adjusting the display style of manually
|
||||
registered search keywords and subfunctional keywords
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 调整手动注册搜索关键字和子功能关键字显示样式
|
||||
|
||||
Closes #35340,#35278
|
||||
---
|
||||
src/search-edit/search-model.cpp | 22 +++++++++++++++-------
|
||||
1 file changed, 15 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/search-edit/search-model.cpp b/src/search-edit/search-model.cpp
|
||||
index 7c5a6f0..6afcffe 100644
|
||||
--- a/src/search-edit/search-model.cpp
|
||||
+++ b/src/search-edit/search-model.cpp
|
||||
@@ -51,6 +51,16 @@ void SearchModel::loadSearchModel()
|
||||
|
||||
auto subitems = category->getSubItems();
|
||||
|
||||
+ if(subitems.size() > 0)
|
||||
+ {
|
||||
+ // 添加分类搜索项
|
||||
+ appendItem(categoryName, categoryID, subitems.at(0)->getID());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * NOTE: 分类下单个子功能项应不添加搜索项
|
||||
+ * 避免 显示设置分类下显示设置子功能项,构成"显示设置->显示设置"这种搜索项
|
||||
+ */
|
||||
bool addSubItemNamePrefix = true;
|
||||
if (subitems.size() == 1)
|
||||
{
|
||||
@@ -65,15 +75,13 @@ void SearchModel::loadSearchModel()
|
||||
QString subItemPrefix;
|
||||
if (addSubItemNamePrefix)
|
||||
{
|
||||
- QString searchText = QString("%1 -> %2").arg(categoryName).arg(subitemName);
|
||||
- appendItem(searchText, categoryID, subitemID);
|
||||
- subItemPrefix = searchText;
|
||||
+ QString subItemSearchKey = QString("%1 -> %2").arg(categoryName).arg(subitemName);
|
||||
+ appendItem(subItemSearchKey, categoryID, subitemID);
|
||||
+ subItemPrefix = subItemSearchKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
- QString searchText = categoryName;
|
||||
- appendItem(searchText, categoryID, subitemID);
|
||||
- subItemPrefix = searchText;
|
||||
+ subItemPrefix = categoryName;
|
||||
}
|
||||
|
||||
auto searchItems = subitem->getSearchKeys();
|
||||
@@ -81,7 +89,7 @@ void SearchModel::loadSearchModel()
|
||||
{
|
||||
QString searchName = searchItem.first;
|
||||
QString searchKey = searchItem.second;
|
||||
- QString searchText = QString("%1 : %2").arg(subItemPrefix).arg(searchName);
|
||||
+ QString searchText = QString("%1 -> %2").arg(subItemPrefix).arg(searchName);
|
||||
appendItem(searchText, categoryID, subitemID, searchKey);
|
||||
}
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
148
0007-fix-network-Crash-caused-by-mismatch-between-registe.patch
Normal file
148
0007-fix-network-Crash-caused-by-mismatch-between-registe.patch
Normal file
@ -0,0 +1,148 @@
|
||||
From 71520f1092cf973bbb63306b141b2d5c3f141d98 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Fri, 19 Apr 2024 10:44:44 +0800
|
||||
Subject: [PATCH 7/7] fix(network): Crash caused by mismatch between registered
|
||||
search terms and actual content
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复网络插件注册的搜索项和实际内容对应不上导致的崩溃
|
||||
|
||||
Closes #35252
|
||||
---
|
||||
lib/plugin-framework/category-manager.cpp | 8 +++++
|
||||
.../network/src/plugin/network-subitem.cpp | 33 +++++++------------
|
||||
src/search-edit/search-model.cpp | 11 ++++---
|
||||
3 files changed, 26 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/lib/plugin-framework/category-manager.cpp b/lib/plugin-framework/category-manager.cpp
|
||||
index 96eb696..a01a2ac 100644
|
||||
--- a/lib/plugin-framework/category-manager.cpp
|
||||
+++ b/lib/plugin-framework/category-manager.cpp
|
||||
@@ -288,6 +288,9 @@ void CategoryManager::removeSubItem(const QString& categoryID, Plugin* plugin, c
|
||||
}
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * NOTE: 该方法为插件调用触发,主面板处理子功能项目信息发生变化
|
||||
+*/
|
||||
void CategoryManager::handlePluginSubItemInfoChanged(const QString& subiemID)
|
||||
{
|
||||
Plugin* plugin = qobject_cast<Plugin*>(sender());
|
||||
@@ -301,11 +304,16 @@ void CategoryManager::handlePluginSubItemInfoChanged(const QString& subiemID)
|
||||
{
|
||||
QString categoryID = cacheItem.categoryID;
|
||||
Category* category = m_categorysMap[categoryID];
|
||||
+ // 发出主分类子功能项信息变化信号,感兴趣类通过该方法
|
||||
+ // 重新加载该主分类下子功能项的信息,例如搜索项
|
||||
emit category->subItemInfoChanged(subiemID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * NOTE: 该方法为插件调用触发,主面板处理子功能变更,更新二级分类
|
||||
+*/
|
||||
void CategoryManager::handlePluginSubItemChanged()
|
||||
{
|
||||
Plugin* plugin = qobject_cast<Plugin*>(sender());
|
||||
diff --git a/plugins/network/src/plugin/network-subitem.cpp b/plugins/network/src/plugin/network-subitem.cpp
|
||||
index 03456d8..b896ba4 100644
|
||||
--- a/plugins/network/src/plugin/network-subitem.cpp
|
||||
+++ b/plugins/network/src/plugin/network-subitem.cpp
|
||||
@@ -116,40 +116,29 @@ void NetworkSubItem::handleSubItemsChanged()
|
||||
m_interface->handlePluginSubItemInfoChanged(getID());
|
||||
}
|
||||
|
||||
+//TODO:
|
||||
+//1.用翻译文本做Key后续得改
|
||||
+//2.这些文本存在多次拷贝,后续改到一处,避免后续改动不全出问题
|
||||
QStringList NetworkSubItem::subItemsList()
|
||||
{
|
||||
QStringList subItemsList;
|
||||
auto wiredList = NetworkUtils::getManagedDeviceList(NetworkManager::Device::Ethernet);
|
||||
auto wirelessList = NetworkUtils::getManagedDeviceList(NetworkManager::Device::Wifi);
|
||||
- for (int i = 0; i < wiredList.count(); i++)
|
||||
+
|
||||
+ if (!wiredList.isEmpty())
|
||||
{
|
||||
- QString subItemName = tr("Wired Network %1");
|
||||
- QString subItemNameStr = subItemName.arg(i + 1);
|
||||
- if (wiredList.count() == 1)
|
||||
- {
|
||||
- QString name = tr("Wired Network");
|
||||
- subItemsList << name;
|
||||
- }
|
||||
- else
|
||||
- subItemsList << subItemNameStr;
|
||||
+ QString name = tr("Wired Network");
|
||||
+ subItemsList << name;
|
||||
}
|
||||
|
||||
- for (int i = 0; i < wirelessList.count(); i++)
|
||||
+ if( !wirelessList.isEmpty() )
|
||||
{
|
||||
- QString subItemName = tr("Wireless Network %1");
|
||||
- QString subItemNameStr = subItemName.arg(i + 1);
|
||||
-
|
||||
- if (wirelessList.count() == 1)
|
||||
- {
|
||||
- QString name = tr("Wireless Network");
|
||||
- subItemsList << name;
|
||||
- }
|
||||
- else
|
||||
- subItemsList << subItemNameStr;
|
||||
+ QString name = tr("Wireless Network");
|
||||
+ subItemsList << name;
|
||||
}
|
||||
|
||||
subItemsList << tr("VPN");
|
||||
subItemsList << tr("Network Details");
|
||||
|
||||
return subItemsList;
|
||||
-}
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/search-edit/search-model.cpp b/src/search-edit/search-model.cpp
|
||||
index 6afcffe..618342b 100644
|
||||
--- a/src/search-edit/search-model.cpp
|
||||
+++ b/src/search-edit/search-model.cpp
|
||||
@@ -50,13 +50,14 @@ void SearchModel::loadSearchModel()
|
||||
QString categoryID = category->getID();
|
||||
|
||||
auto subitems = category->getSubItems();
|
||||
-
|
||||
- if(subitems.size() > 0)
|
||||
+ if( subitems.size() == 0 )
|
||||
{
|
||||
- // 添加分类搜索项
|
||||
- appendItem(categoryName, categoryID, subitems.at(0)->getID());
|
||||
+ continue;
|
||||
}
|
||||
|
||||
+ // 添加分类搜索项
|
||||
+ appendItem(categoryName, categoryID, subitems.at(0)->getID());
|
||||
+
|
||||
/**
|
||||
* NOTE: 分类下单个子功能项应不添加搜索项
|
||||
* 避免 显示设置分类下显示设置子功能项,构成"显示设置->显示设置"这种搜索项
|
||||
@@ -77,6 +78,7 @@ void SearchModel::loadSearchModel()
|
||||
{
|
||||
QString subItemSearchKey = QString("%1 -> %2").arg(categoryName).arg(subitemName);
|
||||
appendItem(subItemSearchKey, categoryID, subitemID);
|
||||
+
|
||||
subItemPrefix = subItemSearchKey;
|
||||
}
|
||||
else
|
||||
@@ -89,6 +91,7 @@ void SearchModel::loadSearchModel()
|
||||
{
|
||||
QString searchName = searchItem.first;
|
||||
QString searchKey = searchItem.second;
|
||||
+
|
||||
QString searchText = QString("%1 -> %2").arg(subItemPrefix).arg(searchName);
|
||||
appendItem(searchText, categoryID, subitemID, searchKey);
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: kiran-control-panel
|
||||
Version: 2.6.1
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
Summary: Kiran Control Panel
|
||||
Summary(zh_CN): Kiran桌面控制面板
|
||||
|
||||
@ -13,6 +13,8 @@ Patch002: 0002-fix-audio-network-Compatible-for-versions-below-5.15.patch
|
||||
Patch003: 0003-fix-power-Fix-has-really-battery-while-it-is-present.patch
|
||||
Patch004: 0004-fix-network-Fix-network-configuration-filtering-for-.patch
|
||||
Patch005: 0005-fix-touchpad-Fix-touchpad-display-with-the-type-psmo.patch
|
||||
Patch006: 0006-fix-search-Adjusting-the-display-style-of-manually-r.patch
|
||||
Patch007: 0007-fix-network-Crash-caused-by-mismatch-between-registe.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: cmake >= 3.2
|
||||
@ -162,6 +164,10 @@ make %{?_smp_mflags}
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Fri Apr 19 2024 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.6.1-7
|
||||
- KYOS-B: Fix Crash caused by mismatch between registered search terms and actual content(#35252)
|
||||
- KYOS-B: Adjusting the display style of manually registered search keywords and subfunctional keywords(#35340,#35278)
|
||||
|
||||
* Wed Apr 17 2024 meizhigang <meizhigang@kylinsec.com.cn> - 2.6.1-6
|
||||
- KYOS-B: Fix touchpad display with the type psmouse (#34878)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user