diff --git a/0001-fix-Memory-leak-Fix-the-memory-leak.patch b/0001-fix-Memory-leak-Fix-the-memory-leak-of-allocating-QP.patch similarity index 66% rename from 0001-fix-Memory-leak-Fix-the-memory-leak.patch rename to 0001-fix-Memory-leak-Fix-the-memory-leak-of-allocating-QP.patch index 17c02cee667db27c49e3bdadb1a66feddb7aa5c7..e492db54b5cdcd37e808d311e231cb0305444b48 100644 --- a/0001-fix-Memory-leak-Fix-the-memory-leak.patch +++ b/0001-fix-Memory-leak-Fix-the-memory-leak-of-allocating-QP.patch @@ -1,7 +1,8 @@ -From eae79d3e1836ed1aa31a92e32235f33515e4e584 Mon Sep 17 00:00:00 2001 +From 60547666dc4cafad4d65485c9830ced06a2e4d15 Mon Sep 17 00:00:00 2001 From: liuxinhao -Date: Tue, 8 Nov 2022 17:41:39 +0800 -Subject: [PATCH] fix(Memory leak): Fix the memory leak +Date: Tue, 8 Nov 2022 16:37:10 +0800 +Subject: [PATCH 1/4] fix(Memory leak): Fix the memory leak of allocating + QPalette when switching themes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -9,8 +10,7 @@ Content-Transfer-Encoding: 8bit 修复切换主题时分配QPalette的内存泄漏 --- platformtheme/kiran-theme.cpp | 8 ++++++++ - style/src/render-helper.cpp | 3 ++- - 2 files changed, 10 insertions(+), 1 deletion(-) + 1 file changed, 8 insertions(+) diff --git a/platformtheme/kiran-theme.cpp b/platformtheme/kiran-theme.cpp index 1955fc4..bf48006 100644 @@ -40,25 +40,6 @@ index 1955fc4..bf48006 100644 // 该接口原本用于windows通知窗口主题变化时使用,现用来通知调用QGuiApplicationPrivate::notifyThemeChanged QGuiApplicationPrivate::processThemeChanged(&event); emit qApp->paletteChanged(*palette(SystemPalette)); -diff --git a/style/src/render-helper.cpp b/style/src/render-helper.cpp -index 60f66e3..1a48998 100644 ---- a/style/src/render-helper.cpp -+++ b/style/src/render-helper.cpp -@@ -313,6 +313,7 @@ QPixmap RenderHelper::changeSVGFillColor(const QString &svgFile, const QColor &f - tinyDoc->draw(&tempPainter); - tempPainter.end(); - -+ delete tinyDoc; - return tempPixmap; - } - -@@ -381,4 +382,4 @@ void RenderHelper::renderTabBarTab(QPainter *painter, - painter->drawPath(painterPath); - } - --} // namespace Kiran -\ No newline at end of file -+} // namespace Kiran -- 2.33.0 diff --git a/0001-fix-arrow-Adjust-the-theme-drawing-arrow.patch b/0002-fix-arrow-Adjust-the-theme-drawing-arrow.patch similarity index 97% rename from 0001-fix-arrow-Adjust-the-theme-drawing-arrow.patch rename to 0002-fix-arrow-Adjust-the-theme-drawing-arrow.patch index 846c4ddda6705354c9043c3f99078b0ce7075823..f98a52a7c03ec17b77f3bb81c26ed0e508f6adac 100644 --- a/0001-fix-arrow-Adjust-the-theme-drawing-arrow.patch +++ b/0002-fix-arrow-Adjust-the-theme-drawing-arrow.patch @@ -1,7 +1,7 @@ From fdb75046726d3134ea4af3616385eae10f92df5d Mon Sep 17 00:00:00 2001 From: liuxinhao Date: Fri, 7 Apr 2023 09:26:09 +0800 -Subject: [PATCH 1/2] fix(arrow): Adjust the theme drawing arrow +Subject: [PATCH 2/4] fix(arrow): Adjust the theme drawing arrow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/0003-build-qt5.11.1-Adaptation-Qt5.11.1.patch b/0003-build-qt5.11.1-Adaptation-Qt5.11.1.patch new file mode 100644 index 0000000000000000000000000000000000000000..a245d06e7adf1df3479d46f256fcba26ac28ee6b --- /dev/null +++ b/0003-build-qt5.11.1-Adaptation-Qt5.11.1.patch @@ -0,0 +1,32 @@ +From b4a50383201b332bc13c90033f1d9821b2e0e0f7 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Fri, 7 Apr 2023 09:27:04 +0800 +Subject: [PATCH 3/4] build(qt5.11.1): Adaptation Qt5.11.1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 适配Qt5.11.1,通过宏区分调用Qt5.11.1的接口 +--- + style-helper/src/font-size-manager-private.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/style-helper/src/font-size-manager-private.h b/style-helper/src/font-size-manager-private.h +index a7a5577..eccf04b 100644 +--- a/style-helper/src/font-size-manager-private.h ++++ b/style-helper/src/font-size-manager-private.h +@@ -26,7 +26,11 @@ public: + void init() + { + connect(qGuiApp, &QGuiApplication::fontChanged, this, &FontSizeManagerPrivate::handleGuiAppFontChanged); ++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + connect(&m_destorySignalMapper, &QSignalMapper::mappedWidget, this, &FontSizeManagerPrivate::handleBindWidgetDestroyed); ++#else ++ connect(&m_destorySignalMapper, QOverload::of(&QSignalMapper::mapped), this, &FontSizeManagerPrivate::handleBindWidgetDestroyed); ++#endif + } + + void updateWidgetFont() +-- +2.33.0 + diff --git a/0004-feat-style-app-Adjust-the-topic-configuration-to-whi.patch b/0004-feat-style-app-Adjust-the-topic-configuration-to-whi.patch new file mode 100644 index 0000000000000000000000000000000000000000..ee951765fb4ac7d92af90edbb9daa39678347bf0 --- /dev/null +++ b/0004-feat-style-app-Adjust-the-topic-configuration-to-whi.patch @@ -0,0 +1,158 @@ +From 71223161f8c103846079ce5987ecce6a59f04a62 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Mon, 5 Jun 2023 15:40:41 +0800 +Subject: [PATCH 4/4] feat(style app): Adjust the topic configuration to + whitelist +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 调整主题配置为白名单,默认包括部分需要支持的kiran桌面环境进程名 +--- + common/data/kiran-qt5-integration.ini | 5 +++-- + common/src/kiran-integration-settings.cpp | 26 +++++++++++++++++++---- + common/src/kiran-integration-settings.h | 16 ++++++++++++-- + platformtheme/kiran-theme.cpp | 4 ++-- + style/src/kiran-style-plugin.cpp | 8 +++---- + 5 files changed, 45 insertions(+), 14 deletions(-) + +diff --git a/common/data/kiran-qt5-integration.ini b/common/data/kiran-qt5-integration.ini +index 478b608..d0fd969 100644 +--- a/common/data/kiran-qt5-integration.ini ++++ b/common/data/kiran-qt5-integration.ini +@@ -1,2 +1,3 @@ +-#[Style] +-#disable-kiran-style-apps=Do not load kiranstyle applications, eg: assistant-qt5,qdbusviewer +\ No newline at end of file ++[Style] ++#启用kiran style的应用列表,已内置部分kiran桌面环境的组件,eg: kiran-*,kiran-panel ++kiran-style-apps= +\ No newline at end of file +diff --git a/common/src/kiran-integration-settings.cpp b/common/src/kiran-integration-settings.cpp +index 7726fad..a781fd3 100644 +--- a/common/src/kiran-integration-settings.cpp ++++ b/common/src/kiran-integration-settings.cpp +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + KiranIntegrationSettings::KiranIntegrationSettings() + { +@@ -18,8 +19,8 @@ KiranIntegrationSettings::~KiranIntegrationSettings() + void KiranIntegrationSettings::init() + { + QSettings settings("/etc/kiran-qt5-integration/kiran-qt5-integration.ini",QSettings::IniFormat); +- QStringList disableStyleApps = settings.value("Style/disable-kiran-style-apps","").toStringList(); +- m_disableKiranStyleApps.append(disableStyleApps); ++ QStringList kiranStyleApps = settings.value("Style/kiran-style-apps","").toStringList(); ++ m_kiranStyleApps.unite(kiranStyleApps.toSet()); + } + + KiranIntegrationSettings* KiranIntegrationSettings::instance() +@@ -39,7 +40,24 @@ KiranIntegrationSettings* KiranIntegrationSettings::instance() + return pInst.data(); + } + +-QStringList KiranIntegrationSettings::getDisableKiranStyleApps() ++QSet KiranIntegrationSettings::getKiranStyleApps() + { +- return m_disableKiranStyleApps; ++ return m_kiranStyleApps; + } ++ ++bool KiranIntegrationSettings::appKiranStyleAvailable(const QString& app) ++{ ++ bool matched = false; ++ QRegExp regExp("",Qt::CaseSensitive,QRegExp::Wildcard); ++ ++ auto set = KiranIntegrationSettings::instance()->getKiranStyleApps(); ++ foreach(auto pattern,set) ++ { ++ regExp.setPattern(pattern); ++ matched = regExp.exactMatch(app); ++ if( matched ) ++ break; ++ } ++ ++ return matched; ++} +\ No newline at end of file +diff --git a/common/src/kiran-integration-settings.h b/common/src/kiran-integration-settings.h +index e43c1b6..ff99929 100644 +--- a/common/src/kiran-integration-settings.h ++++ b/common/src/kiran-integration-settings.h +@@ -1,6 +1,7 @@ + #pragma once + + #include ++#include + + class KiranIntegrationSettings + { +@@ -8,12 +9,23 @@ public: + static KiranIntegrationSettings* instance(); + ~KiranIntegrationSettings(); + +- QStringList getDisableKiranStyleApps(); ++ QSet getKiranStyleApps(); ++ static bool appKiranStyleAvailable(const QString& app); + + private: + KiranIntegrationSettings(); + void init(); + + private: +- QStringList m_disableKiranStyleApps = {"lightdm-kiran-greeter","kiran-screensaver"}; ++ QSet m_kiranStyleApps = { ++ "kiran-control-panel", ++ "kiran-cpanel-*", ++ "kiran-polkit-agent", ++ "kiran-avatar-editor", ++ "kiran-calculator", ++ "kiran-power-status-icon", ++ "kiran-network-status-icon", ++ "kiran-audio-status-icon", ++ "kiran-flameshot" ++ }; + }; +\ No newline at end of file +diff --git a/platformtheme/kiran-theme.cpp b/platformtheme/kiran-theme.cpp +index bf48006..9fec043 100644 +--- a/platformtheme/kiran-theme.cpp ++++ b/platformtheme/kiran-theme.cpp +@@ -100,8 +100,8 @@ const QPalette* KiranTheme::palette(QPlatformTheme::Palette type) const + return QGenericUnixTheme::palette(type); + } + +- QStringList blackapps = KiranIntegrationSettings::instance()->getDisableKiranStyleApps(); +- if( blackapps.contains(qAppName()) ) ++ bool enable = KiranIntegrationSettings::appKiranStyleAvailable(qAppName()); ++ if( !enable ) + { + return QGenericUnixTheme::palette(type); + } +diff --git a/style/src/kiran-style-plugin.cpp b/style/src/kiran-style-plugin.cpp +index aefbabc..08eaae2 100644 +--- a/style/src/kiran-style-plugin.cpp ++++ b/style/src/kiran-style-plugin.cpp +@@ -28,11 +28,11 @@ QStyle *KiranStylePlugin::create(const QString & key) + { + if( key.compare("kiran",Qt::CaseInsensitive) == 0 ) + { +- QStringList disableApps = KiranIntegrationSettings::instance()->getDisableKiranStyleApps(); +- QString processName = qAppName(); +- if( disableApps.contains(processName) ) ++ auto processName = qAppName(); ++ bool enable = KiranIntegrationSettings::appKiranStyleAvailable(processName); ++ if( !enable ) + { +- qDebug("%s in black list,create fusion style for it.",processName.toStdString().c_str()); ++ qDebug("%s not enable kiran style,create fusion style for it.",processName.toStdString().c_str()); + return QStyleFactory::create("fusion"); + } + else +-- +2.33.0 + diff --git a/kiran-qt5-integration.spec b/kiran-qt5-integration.spec index 7984073b0d2a53653e2ef94c9d3dbf6085543a17..210608da6b9154b39cb6f1e4ac7cf305e3e2d7f0 100644 --- a/kiran-qt5-integration.spec +++ b/kiran-qt5-integration.spec @@ -1,13 +1,15 @@ Name: kiran-qt5-integration Version: 2.4.0 -Release: 3 +Release: 6 Summary: Kiran desktop platform integration plugin. License: MulanPSL-2.0 Source0: %{name}-%{version}.tar.gz -Patch0001: 0001-fix-Memory-leak-Fix-the-memory-leak.patch -Patch0002: 0001-fix-arrow-Adjust-the-theme-drawing-arrow.patch -Patch0003: 0002-build-qt5.11.1-Adaptation-Qt5.11.1.patch + +Patch0001: 0001-fix-Memory-leak-Fix-the-memory-leak-of-allocating-QP.patch +Patch0002: 0002-fix-arrow-Adjust-the-theme-drawing-arrow.patch +Patch0003: 0003-build-qt5.11.1-Adaptation-Qt5.11.1.patch +Patch0004: 0004-feat-style-app-Adjust-the-topic-configuration-to-whi.patch BuildRequires: cmake >= 3.2 BuildRequires: gcc-c++ @@ -63,6 +65,15 @@ make %{?_smp_mflags} %{_libdir}/pkgconfig/kiran-style-helper.pc %changelog +* Mon Jun 05 2023 liuxinhao - 2.4.0-6 +- KYOS-F: Adjust the topic configuration to whitelist + +* Wed Apr 12 2023 kpkg - 2.4.0-5 +- rebuild for KY3.4-5-GC-KiranUI-2.5 + +* Fri Apr 07 2023 kpkg - 2.4.0-4 +- rebuild for KiranUI-2.5-next + * Fri Apr 07 2023 liuxinhao - 2.4.0-3 - KYOS-F: Adaptation Qt5.11.1,Adjust the theme drawing arrow