!13 修复网络和音频插件的部分缺陷

From: @luoqing_kylinsec 
Reviewed-by: @liubuguiii 
Signed-off-by: @liubuguiii
This commit is contained in:
openeuler-ci-bot 2022-07-26 03:39:27 +00:00 committed by Gitee
commit a589128192
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 5 additions and 6208 deletions

View File

@ -1,37 +0,0 @@
From ff0fefbe49bf121cbb35d83913e1b1a1b5e1fb50 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Mon, 11 Jul 2022 17:42:51 +0800
Subject: [PATCH] build(system): add system plugin build library printsupport
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 系统信息页编译加入Qt PrintSupport支持
---
plugins/system/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/system/CMakeLists.txt b/plugins/system/CMakeLists.txt
index 7609e37..04b4b89 100644
--- a/plugins/system/CMakeLists.txt
+++ b/plugins/system/CMakeLists.txt
@@ -7,7 +7,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(PkgConfig REQUIRED)
-find_package(Qt5 COMPONENTS Widgets Svg DBus LinguistTools)
+find_package(Qt5 COMPONENTS Widgets Svg DBus LinguistTools PrintSupport)
pkg_search_module(KLOG_QT5 REQUIRED klog-qt5)
pkg_search_module(KIRAN_CC_DAEMON REQUIRED kiran-cc-daemon)
pkg_search_module(KIRAN_STYLE_HELPER REQUIRED kiran-style-helper)
@@ -37,6 +37,7 @@ target_link_libraries(${TARGET_NAME}
Qt5::Widgets
Qt5::DBus
Qt5::Svg
+ Qt5::PrintSupport
${KIRAN_WIDGETS_QT5_LIBRARIES}
${KLOG_QT5_LIBRARIES}
${KIRAN_STYLE_HELPER_LIBRARIES})
--
2.33.0

View File

@ -1,133 +0,0 @@
From b8f521105e333a62ead53d2babb3ef4b0cd22e98 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Mon, 11 Jul 2022 14:25:28 +0800
Subject: [PATCH] feature(audio):fix unplugging headphones causes crash
problems
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复拔出耳机导致崩溃问题
---
plugins/audio/src/plugin/input-page.cpp | 23 ++++++++++++++---------
plugins/audio/src/plugin/output-page.cpp | 7 +++----
plugins/audio/src/plugin/volume-scale.cpp | 4 ----
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/plugins/audio/src/plugin/input-page.cpp b/plugins/audio/src/plugin/input-page.cpp
index 3f4c5e3..66fa996 100644
--- a/plugins/audio/src/plugin/input-page.cpp
+++ b/plugins/audio/src/plugin/input-page.cpp
@@ -280,15 +280,15 @@ void InputPage::initConnet()
connect(m_defaultSource, &AudioDeviceInterface::active_portChanged, [=](const QString &value) {
handleActivePortChanged(value);
});
+
+ //Fix:SourceAdded 和 SourceDelete没有被激发
connect(m_audioInterface, &AudioInterface::SourceAdded, [this](uint index) {
handleSourceAdded(index);
});
connect(m_audioInterface, &AudioInterface::SourceDelete, [this](uint index) {
handleSourceDelete(index);
});
- connect(m_audioInterface, &AudioInterface::DefaultSourceChange, [this](uint index) {
- handleDefaultSourceChanged(index);
- });
+ connect(m_audioInterface, &AudioInterface::DefaultSourceChange, this,&InputPage::handleDefaultSourceChanged,Qt::QueuedConnection);
}
void InputPage::handleActivePortChanged(const QString &value)
@@ -315,29 +315,34 @@ void InputPage::handleVolumeChanged(double value)
ui->volumeSetting->blockSignals(false);
}
+/*
+ * TODO:
+ * 1、处理快速拔插设备
+ * 2、设备插入后是否需要等待设备准备好
+ * */
+
void InputPage::handleDefaultSourceChanged(int index)
{
KLOG_DEBUG() << "DefaultSourceChanged:" << index;
-
//delete and restart init defaultSource
- delete m_defaultSource;
+ m_defaultSource->deleteLater();
m_defaultSource = nullptr;
+
ui->inputDevices->clear();
initInputDevice();
initInputSettins();
ui->volumeScale->setPercent(0);
+
if(m_audioInfo != nullptr)
{
m_audioInfo->stop();
- delete m_audioInfo;
+ m_audioInfo->deleteLater();
m_audioInfo = nullptr;
}
if(m_audioInput != nullptr)
{
- m_audioInput->stop();
- m_audioInput->disconnect(this);
- delete m_audioInput;
+ m_audioInput->deleteLater();
m_audioInput = nullptr;
}
if(isValidPort)
diff --git a/plugins/audio/src/plugin/output-page.cpp b/plugins/audio/src/plugin/output-page.cpp
index 3040e29..768d613 100644
--- a/plugins/audio/src/plugin/output-page.cpp
+++ b/plugins/audio/src/plugin/output-page.cpp
@@ -160,9 +160,8 @@ void OutputPage::initConnect()
connect(m_audioInterface, &AudioInterface::SinkDelete, [this](uint index) {
handleSinkDelete(index);
});
- connect(m_audioInterface, &AudioInterface::DefaultSinkChange, [this](uint index) {
- handleDefaultSinkChanged(index);
- });
+ connect(m_audioInterface, &AudioInterface::DefaultSinkChange, this,&OutputPage::handleDefaultSinkChanged,Qt::QueuedConnection);
+
connect(ui->outputDevices, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), [=](int index) {
QString namePort = ui->outputDevices->itemData(index, Qt::UserRole).toString();
@@ -211,7 +210,7 @@ void OutputPage::handleDefaultSinkChanged(int index)
{
KLOG_DEBUG() << "DefaultSinkChanged";
//delete and restart init defaultSource
- delete m_defaultSink;
+ m_defaultSink->deleteLater();
m_defaultSink = nullptr;
ui->outputDevices->clear();
diff --git a/plugins/audio/src/plugin/volume-scale.cpp b/plugins/audio/src/plugin/volume-scale.cpp
index e86311f..71c9f19 100644
--- a/plugins/audio/src/plugin/volume-scale.cpp
+++ b/plugins/audio/src/plugin/volume-scale.cpp
@@ -43,12 +43,9 @@ void VolumeScale::drawTicks(QPainter *painter)
int posX = 0;
int posY = 0;
int length = geometry().width();
- KLOG_DEBUG() << "geometry().width():" <<geometry().width();
int ticksCount = length / TICK_SPACE;
- KLOG_DEBUG() << "ticksCount: " << ticksCount;
-
int percentTicks = m_percent * ticksCount;
for (int i = 0; i < ticksCount; i++) {
@@ -62,7 +59,6 @@ void VolumeScale::drawTicks(QPainter *painter)
}
painter->drawRect(posX,10,TICK_WIDTH,TICK_HEIGHT);
posX += TICK_SPACE;
- KLOG_DEBUG() << "drawRect:" << posX << ":" << i;
}
}
void VolumeScale::setPercent(qreal percent)
--
2.33.0

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,12 @@
Name: kiran-control-panel
Version: 2.3.1
Release: 4
Version: 2.3.2
Release: 1
Summary: Kiran Control Panel
Summary(zh_CN): Kiran桌面控制面板
License: Mulan PSL v2
Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-feature-audio-fix-unplugging-headphones-causes-crash.patch
Patch0002: 0001-build-system-add-system-plugin-build-library-printsu.patch
Patch0003: 0001-fix-translator-update-translator.patch
BuildRequires: gcc-c++
BuildRequires: cmake >= 3.2
BuildRequires: glib2-devel
@ -168,6 +164,9 @@ make %{?_smp_mflags}
rm -rf %{buildroot}
%changelog
* Fri Jul 22 2022 luoqing <luoqing@kylinsec.com.cn> - 2.3.2-1
- KYOS-B: fix some bugs of network and audio plugins
* Tue Jul 12 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.1-4
- KYOS-B: fix kiran control panel translator