diff --git a/0003-fix-LC_TIME-set-LC_TIME-to-UTF-8.patch b/0003-fix-LC_TIME-set-LC_TIME-to-UTF-8.patch new file mode 100644 index 0000000..5ee43f8 --- /dev/null +++ b/0003-fix-LC_TIME-set-LC_TIME-to-UTF-8.patch @@ -0,0 +1,47 @@ +From 78e2ba6f38de67917befdabfe9d40a910b02a88c Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Fri, 15 Dec 2023 16:13:08 +0800 +Subject: [PATCH 03/17] fix(LC_TIME): set LC_TIME to UTF-8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +根据环境变量重新设置LC_TIME为UTF-8 + +Closes #21517,#24064 +--- + src/main.cpp | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/src/main.cpp b/src/main.cpp +index 05f7153..981fdbf 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -165,6 +165,24 @@ int main(int argc, char *argv[]) + exit(EXIT_SUCCESS); + } + ++ /// NOTE: 由于strftime获取系统locale进行格式化,Qt使用UTF8,若编码设置不为UTF8中文环境下会导致乱码 ++ /// 所以LANG后面的编码若不为UTF-8,修改成UTF-8,使获取时间都为UTF-8格式 ++ QString lang = qgetenv("LANG"); ++ if (lang.contains(".")) ++ { ++#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) ++ QStringList splitRes = lang.split(".", QString::SkipEmptyParts); ++#else ++ QStringList splitRes = lang.split(".", Qt::SkipEmptyParts); ++#endif ++ if(splitRes.size() == 2 && splitRes.at(1)!="UTF-8" ) ++ { ++ splitRes.replace(1, "UTF-8"); ++ QString newLocale = splitRes.join("."); ++ setlocale(LC_TIME, newLocale.toStdString().c_str()); ++ } ++ } ++ + // 安装翻译 + installTranslator(); + +-- +2.33.0 + diff --git a/0004-fix-network-fix-compile-issues-QString-SkipEmptyPart.patch b/0004-fix-network-fix-compile-issues-QString-SkipEmptyPart.patch new file mode 100644 index 0000000..46e9e8a --- /dev/null +++ b/0004-fix-network-fix-compile-issues-QString-SkipEmptyPart.patch @@ -0,0 +1,50 @@ +From f803d07ba85e579776fb185f4878b6fcd6c17ddf Mon Sep 17 00:00:00 2001 +From: luoqing +Date: Thu, 21 Dec 2023 09:25:47 +0800 +Subject: [PATCH 04/17] fix(network):fix compile issues,QString::SkipEmptyParts + is used under Qt 5.14 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复编译问题,在Qt 5.14 以下使用QString::SkipEmptyParts +--- + plugins/network/src/plugin/setting-widget/ipv4-widget.cpp | 4 ++++ + plugins/network/src/plugin/setting-widget/ipv6-widget.cpp | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp +index da46dab..fa23708 100644 +--- a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp ++++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp +@@ -131,7 +131,11 @@ void Ipv4Widget::saveSettings() + { + //多个DNS以分号分隔 + QString dnsString = ui->ipv4DNS->text(); ++#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) ++ QStringList dnsList = dnsString.split(";",QString::SkipEmptyParts); ++#else + QStringList dnsList = dnsString.split(";",Qt::SkipEmptyParts); ++#endif + for(auto dns : dnsList) + { + ipv4DNS << QHostAddress(dns); +diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp +index feefdcf..d19a5e0 100644 +--- a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp ++++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp +@@ -124,7 +124,11 @@ void Ipv6Widget::saveSettings() + { + //多个DNS以分号分隔 + QString dnsString = ui->ipv6DNS->text(); ++#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) ++ QStringList dnsList = dnsString.split(";",QString::SkipEmptyParts); ++#else + QStringList dnsList = dnsString.split(";",Qt::SkipEmptyParts); ++#endif + for(auto dns : dnsList) + { + ipv6DNS << QHostAddress(dns); +-- +2.33.0 + diff --git a/0005-fix-audio-listen-to-mute-property-change-to-fix-shor.patch b/0005-fix-audio-listen-to-mute-property-change-to-fix-shor.patch new file mode 100644 index 0000000..9f1ce02 --- /dev/null +++ b/0005-fix-audio-listen-to-mute-property-change-to-fix-shor.patch @@ -0,0 +1,202 @@ +From b7eb0462cb754bccde3afc53b151a9b6b61e4143 Mon Sep 17 00:00:00 2001 +From: luoqing +Date: Wed, 3 Jan 2024 13:49:14 +0800 +Subject: [PATCH 05/17] fix(audio):listen to mute property change to fix + shortcut key mute, volume icon unchanged issue +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 监听mute静音属性变化,以修复快捷键静音,音量图标未变化的问题 + +Related #25508 +--- + .../src/system-tray/audio-system-tray.cpp | 12 ++++ + .../src/system-tray/volume-setting-page.cpp | 69 ++++++++++++------- + .../src/system-tray/volume-setting-page.h | 5 +- + 3 files changed, 60 insertions(+), 26 deletions(-) + +diff --git a/plugins/audio/src/system-tray/audio-system-tray.cpp b/plugins/audio/src/system-tray/audio-system-tray.cpp +index eb554b2..ed4412f 100644 +--- a/plugins/audio/src/system-tray/audio-system-tray.cpp ++++ b/plugins/audio/src/system-tray/audio-system-tray.cpp +@@ -124,6 +124,18 @@ void AudioSystemTray::initConnect() + setTrayIcon(currentVolume); + }); + ++ connect(m_volumeSettingPage,&VolumeSettingPage::sinkMuteChanged,[this](bool mute,double currentVolume) ++ { ++ if(mute) ++ { ++ setTrayIcon(0); ++ } ++ else ++ { ++ setTrayIcon(currentVolume); ++ } ++ }); ++ + connect(Kiran::StylePalette::instance(), &Kiran::StylePalette::themeChanged, [this](Kiran::PaletteType paletteType) + { + //获取当前音量值重新设置TrayIcon +diff --git a/plugins/audio/src/system-tray/volume-setting-page.cpp b/plugins/audio/src/system-tray/volume-setting-page.cpp +index 03116c7..dbb1cd8 100644 +--- a/plugins/audio/src/system-tray/volume-setting-page.cpp ++++ b/plugins/audio/src/system-tray/volume-setting-page.cpp +@@ -15,8 +15,8 @@ + #include "dbus/audio-device-interface.h" + #include "dbus/audio-interface.h" + #include "dbus/audio-stream-interface.h" +-#include "ui_volume-setting-page.h" + #include "logging-category.h" ++#include "ui_volume-setting-page.h" + + #include + #include +@@ -41,7 +41,9 @@ VolumeSettingPage::VolumeSettingPage(enum AudioNode audio, const QString objectP + m_sink = new AudioDeviceInterface(AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus(), this); + initAudioDevice(); + +- connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged); ++ connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged, Qt::UniqueConnection); ++ connect(m_sink, &AudioDeviceInterface::muteChanged, this, &VolumeSettingPage::changeSinkMute, Qt::UniqueConnection); ++ + connect(ui->volumeSetting, &QSlider::valueChanged, [this](int value) + { + double volumeValue = value / 100.0; +@@ -101,6 +103,7 @@ void VolumeSettingPage::initAudioStream() + initSettings(m_sinkInput); + ui->volumeName->setText(m_sinkInput->GetProperty("application.name")); + connect(m_sinkInput, &AudioStreamInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged); ++ connect(m_sinkInput, &AudioStreamInterface::muteChanged, this, &VolumeSettingPage::changeSinkInputMute); + connect(ui->volumeSetting, &QSlider::valueChanged, [this](int value) + { + double volumeValue = value / 100.0; +@@ -123,10 +126,38 @@ void VolumeSettingPage::initSettings(Audio *audio) + ui->volume->setText(QString::number(currentVolume) + "%"); + } + ++void VolumeSettingPage::changeSinkMute(bool value) ++{ ++ KLOG_DEBUG() << "change sink mute:" << value; ++ double currentVolume = m_sink->volume() * 100; ++ emit sinkMuteChanged(value, currentVolume); ++ if (value) ++ { ++ setVolumeIcon(0); ++ } ++ else ++ { ++ setVolumeIcon(currentVolume); ++ } ++} ++void VolumeSettingPage::changeSinkInputMute(bool value) ++{ ++ KLOG_DEBUG() << "change sink input mute:" << value; ++ double currentVolume = m_sinkInput->volume() * 100; ++ if (value) ++ { ++ setVolumeIcon(0); ++ } ++ else ++ { ++ setVolumeIcon(currentVolume); ++ } ++} ++ + void VolumeSettingPage::handleVolumeChanged(double value) + { +- QSignalBlocker blocker(ui->volumeSetting); // 为了避免拖动的同时设置位置会出现问题 +- int currentVolume = round(value * 100); // 表示数值的时候向上取整 ++ QSignalBlocker blocker(ui->volumeSetting); // 为了避免拖动的同时设置位置会出现问题 ++ int currentVolume = round(value * 100); // 表示数值的时候向上取整 + ui->volume->setText(QString::number(currentVolume) + "%"); + setVolumeIcon(currentVolume); + ui->volumeSetting->setValue(currentVolume); +@@ -136,9 +167,9 @@ void VolumeSettingPage::handleVolumeChanged(double value) + void VolumeSettingPage::handleMuteButtonClicked() + { + if (m_audioNode == AUDIO_DEVICE) +- clickMuteButton(m_sink); ++ switchMute(m_sink); + else +- clickMuteButton(m_sinkInput); ++ switchMute(m_sinkInput); + } + + void VolumeSettingPage::handleDefaultSinkChanged(int index) +@@ -154,7 +185,8 @@ void VolumeSettingPage::handleDefaultSinkChanged(int index) + QDBusPendingReply defaultSinkPath = m_audioInterface->GetDefaultSink(); + m_sink = new AudioDeviceInterface(AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus(), this); + initAudioDevice(); +- connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged); ++ connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged, Qt::UniqueConnection); ++ connect(m_sink, &AudioDeviceInterface::muteChanged, this, &VolumeSettingPage::changeSinkMute, Qt::UniqueConnection); + } + + void VolumeSettingPage::handleSinkAdded(int index) +@@ -187,30 +219,17 @@ void VolumeSettingPage::handleSinkDelete(int index) + } + + template +-void VolumeSettingPage::clickMuteButton(Audio *audio) ++void VolumeSettingPage::switchMute(Audio *audio) + { +- double currentVolumeDouble = audio->volume() * 100; +- int currentVolume = round(currentVolumeDouble); +- +- if (currentVolume != 0) ++ if (!audio->mute()) + { +- m_volumeBeforeMute = currentVolume; +- if (!audio->mute()) +- { +- audio->SetMute(true); +- } +- audio->SetVolume(0); +- KLOG_DEBUG(qLcAudio) << "current sink is mute :" << audio->mute(); ++ audio->SetMute(true); + } + else + { +- if (m_volumeBeforeMute != 0) +- { +- //重新设置音量时,会自动解除静音状态 +- audio->SetVolume(m_volumeBeforeMute / 100.0); +- m_volumeBeforeMute = 0; +- } ++ audio->SetMute(false); + } ++ KLOG_DEBUG() << "current defalut sink mute:" << audio->mute(); + } + + // XXX:频繁调用函数,需要优化 +diff --git a/plugins/audio/src/system-tray/volume-setting-page.h b/plugins/audio/src/system-tray/volume-setting-page.h +index 80f0098..4a556fe 100644 +--- a/plugins/audio/src/system-tray/volume-setting-page.h ++++ b/plugins/audio/src/system-tray/volume-setting-page.h +@@ -41,6 +41,8 @@ public: + void disableSettings(); + + public slots: ++ void changeSinkMute(bool value); ++ void changeSinkInputMute(bool value); + void handleVolumeChanged(double value); + void handleMuteButtonClicked(); + void handleDefaultSinkChanged(int index); +@@ -57,10 +59,11 @@ private: + template + void initSettings(Audio *audio); + template +- void clickMuteButton(Audio *audio); ++ void switchMute(Audio *audio); + + signals: + void volumeChanged(double value); ++ void sinkMuteChanged(bool mute, double currentVolume); + + private: + Ui::VolumeSettingPage *ui; +-- +2.33.0 + diff --git a/0006-fix-network-fixd-an-issue-where-the-network-tray-ico.patch b/0006-fix-network-fixd-an-issue-where-the-network-tray-ico.patch new file mode 100644 index 0000000..382a947 --- /dev/null +++ b/0006-fix-network-fixd-an-issue-where-the-network-tray-ico.patch @@ -0,0 +1,183 @@ +From 2bae469f6fdd42c15d574a0d4642d13a2fcf3d8b Mon Sep 17 00:00:00 2001 +From: luoqing +Date: Thu, 4 Jan 2024 11:17:57 +0800 +Subject: [PATCH 06/17] fix(network):fixd an issue where the network tray icon + was incorrectly displayed when there was no primary connection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复当没有主连接时,网络托盘图标显示不准确的问题 + +Closes #25475, #25037, #25032 +--- + plugins/network/src/general.h | 1 + + plugins/network/src/tray/network-tray.cpp | 90 +++++++++++++++++------ + 2 files changed, 68 insertions(+), 23 deletions(-) + +diff --git a/plugins/network/src/general.h b/plugins/network/src/general.h +index 8aa4f67..c65ce78 100644 +--- a/plugins/network/src/general.h ++++ b/plugins/network/src/general.h +@@ -24,6 +24,7 @@ + + enum NetworkState + { ++ UNKNOWN, + WIRED_CONNECTED, + WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET, + WIRELESS_CONNECTED, +diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp +index 00b6685..db6e0cd 100644 +--- a/plugins/network/src/tray/network-tray.cpp ++++ b/plugins/network/src/tray/network-tray.cpp +@@ -20,17 +20,17 @@ + #include + #include + #include ++#include ++#include + #include + #include "config.h" ++#include "logging-category.h" + #include "status-notification.h" + #include "status-notifier-manager.h" + #include "tray-page.h" + #include "utils.h" + #include "wired-tray-widget.h" + #include "wireless-tray-widget.h" +-#include +-#include +-#include "logging-category.h" + + using namespace NetworkManager; + +@@ -359,42 +359,70 @@ void NetworkTray::getTrayGeometry() + void NetworkTray::updateTrayIcon() + { + auto status = NetworkManager::status(); +- if (status != NetworkManager::Status::Connected) ++ if (status < NetworkManager::Status::ConnectedLinkLocal) + { + setTrayIcon(DISCONNECTED); + return; + } + ++#define SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state) \ ++ if (state != UNKNOWN) \ ++ { \ ++ setTrayIcon(state); \ ++ checkInternetConnectivity(); \ ++ return; \ ++ } ++ ++ NetworkState state = UNKNOWN; + // 判断主连接类型,托盘网络图标以主连接类型为准 + // NetworkManager::primaryConnectionType() 更新不及时,暂时不用 ++ /** ++ * NOTE: ++ * 注意特殊情况,如果当网络状态为已连接,但是没有主连接,则遍历所有已激活的连接, ++ * 按有线优先于无线的原则,如果存在激活的有线连接,则显示有线网络图标;其次显示无线网络图标 ++ * 如果既不是有线也不是无线,则显示有线网络图标 ++ */ + ActiveConnection::Ptr primaryActiveConnection = primaryConnection(); +- if (primaryActiveConnection.isNull()) ++ if (!primaryActiveConnection.isNull()) + { +- KLOG_INFO(qLcNetwork) << "update tray icon failed, primary active connection is null"; +- return; ++ if (primaryActiveConnection->type() == ConnectionSettings::Wireless) ++ { ++ state = WIRELESS_CONNECTED_BUT_NOT_ACCESS_INTERNET; ++ } ++ else ++ { ++ state = WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET; ++ } + } ++ SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state); + +- // NetworkManager::connectivity() 不准确,使用checkConnectivity +- QDBusPendingReply reply = NetworkManager::checkConnectivity(); +- reply.waitForFinished(); +- uint result = reply.value(); +- +- if (result == NetworkManager::Connectivity::Full) ++ KLOG_INFO(qLcNetwork) << "primary active connection is null"; ++ ActiveConnection::List list = activeConnections(); ++ for (auto connection : list) + { +- checkInternetConnectivity(); +- return; ++ if (connection->type() == ConnectionSettings::ConnectionType::Wired) ++ { ++ state = WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET; ++ break; ++ } + } ++ SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state); + +- NetworkState state; +- if (primaryActiveConnection->type() == ConnectionSettings::Wireless) ++ for (auto connection : list) + { +- state = WIRELESS_CONNECTED_BUT_NOT_ACCESS_INTERNET; ++ if (connection->type() == ConnectionSettings::ConnectionType::Wireless) ++ { ++ state = WIRELESS_CONNECTED_BUT_NOT_ACCESS_INTERNET; ++ break; ++ } + } +- else ++ ++ //最后如果既不是有线也不是无线,则显示有线网络图标 ++ if (state == UNKNOWN) + { + state = WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET; + } +- setTrayIcon(state); ++ SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state); + } + + void NetworkTray::setTrayIcon(NetworkState state) +@@ -712,6 +740,15 @@ void NetworkTray::initTcpSocket() + + void NetworkTray::checkInternetConnectivity() + { ++ // NetworkManager::connectivity() 不准确,使用checkConnectivity ++ QDBusPendingReply reply = NetworkManager::checkConnectivity(); ++ reply.waitForFinished(); ++ uint result = reply.value(); ++ if (result != NetworkManager::Connectivity::Full) ++ { ++ return; ++ } ++ + QSettings confSettings(SETTINGS_PATH, QSettings::NativeFormat); + QVariant enable = confSettings.value(QString("Network/CheckInternetConnectivity")); + KLOG_DEBUG(qLcNetwork) << "check Internet Connectivity : " << enable; +@@ -728,11 +765,18 @@ void NetworkTray::checkInternetConnectivity() + void NetworkTray::internetConnected() + { + KLOG_DEBUG(qLcNetwork) << "Connectivity check pass"; +- ActiveConnection::Ptr primaryActiveConnection = primaryConnection(); + NetworkState state; +- if (primaryActiveConnection->type() == ConnectionSettings::Wireless) ++ ActiveConnection::Ptr primaryActiveConnection = primaryConnection(); ++ if (!primaryActiveConnection.isNull()) + { +- state = WIRELESS_CONNECTED; ++ if (primaryActiveConnection->type() == ConnectionSettings::Wireless) ++ { ++ state = WIRELESS_CONNECTED; ++ } ++ else ++ { ++ state = WIRED_CONNECTED; ++ } + } + else + { +-- +2.33.0 + diff --git a/0007-fix-application-add-a-compilation-switch-to-control-.patch b/0007-fix-application-add-a-compilation-switch-to-control-.patch new file mode 100644 index 0000000..f6f78e0 --- /dev/null +++ b/0007-fix-application-add-a-compilation-switch-to-control-.patch @@ -0,0 +1,63 @@ +From 3ccdcfbc6d104f1f691b7feaf6ed58daae21da63 Mon Sep 17 00:00:00 2001 +From: niko_yhc +Date: Mon, 8 Jan 2024 13:48:50 +0800 +Subject: [PATCH 07/17] fix(application):add a compilation switch to control + whether the application-plugin is turned on +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 添加编译开关控制application-plugin是否打开 +--- + cmake/options.cmake | 3 ++- + data/CMakeLists.txt | 5 +++++ + plugins/CMakeLists.txt | 4 +++- + 3 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/cmake/options.cmake b/cmake/options.cmake +index f21d2b9..bc56591 100644 +--- a/cmake/options.cmake ++++ b/cmake/options.cmake +@@ -3,4 +3,5 @@ option(PASSWD_EXPIRATION_POLICY_VISIBLE "Is password expiration policy visible" + + OPTION(ENABLE_USER_GROUP "Enable user group" OFF) + OPTION(ENABLE_NETWORK "Enable network plugin" ON) +-OPTION(ENABLE_AUDIO "Enable audio plugin" ON) +\ No newline at end of file ++OPTION(ENABLE_AUDIO "Enable audio plugin" ON) ++OPTION(ENABLE_APPLICATION "Enable application plugin" ON) +\ No newline at end of file +diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt +index 9f66d68..8b1ed54 100644 +--- a/data/CMakeLists.txt ++++ b/data/CMakeLists.txt +@@ -14,6 +14,11 @@ endif() + if(NOT ENABLE_USER_GROUP) + list(FILTER CATEGORY_DESKTOP EXCLUDE REGEX "group.desktop") + endif() ++ ++if(NOT ENABLE_APPLICATION) ++ list(FILTER CATEGORY_DESKTOP EXCLUDE REGEX "application.desktop") ++endif() ++ + install(FILES ${CATEGORY_DESKTOP} DESTINATION ${CATEGORY_DESKTOP_DIR}) + + # 安装主分类相关图标文件 +diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt +index 9acb921..ecad7b6 100644 +--- a/plugins/CMakeLists.txt ++++ b/plugins/CMakeLists.txt +@@ -8,7 +8,9 @@ add_subdirectory(timedate) + add_subdirectory(display) + add_subdirectory(keybinding) + add_subdirectory(authentication) +-add_subdirectory(application) ++if (ENABLE_APPLICATION) ++ add_subdirectory(application) ++endif() + if(ENABLE_NETWORK) + add_subdirectory(network) + endif() +-- +2.33.0 + diff --git a/0008-refactor-account-Remove-useless-password-encryption-.patch b/0008-refactor-account-Remove-useless-password-encryption-.patch new file mode 100644 index 0000000..4607bc5 --- /dev/null +++ b/0008-refactor-account-Remove-useless-password-encryption-.patch @@ -0,0 +1,137 @@ +From 3a30343a3958caafad6b27e1900c0e7b6b9ab26b Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Mon, 8 Jan 2024 15:04:41 +0800 +Subject: [PATCH 08/17] refactor(account): Remove useless password encryption + interfaces and remove the dependency of libcrypt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 删除目前无用的密码加密接口,去除libcrypt的依赖 +--- + plugins/account/CMakeLists.txt | 7 +-- + plugins/account/utils/passwd-helper.cpp | 57 ------------------------- + plugins/account/utils/passwd-helper.h | 1 - + 3 files changed, 2 insertions(+), 63 deletions(-) + +diff --git a/plugins/account/CMakeLists.txt b/plugins/account/CMakeLists.txt +index 586c6c8..e96fa92 100644 +--- a/plugins/account/CMakeLists.txt ++++ b/plugins/account/CMakeLists.txt +@@ -6,7 +6,6 @@ endif () + + pkg_search_module(CRYPTOPP REQUIRED cryptopp) + pkg_search_module(PAM REQUIRED pam) +-pkg_search_module(LIBCRYPT REQUIRED libcrypt) + + file(GLOB_RECURSE ACCOUNT_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp +@@ -29,8 +28,7 @@ target_include_directories(${TARGET_NAME} PRIVATE + ${KIRAN_CC_DAEMON_INCLUDE_DIRS} + ${KLOG_INCLUDE_DIRS} + ${KIRAN_STYLE_INCLUDE_DIRS} +- ${CRYPTOPP_INCLUDE_DIRS} +- ${LIBCRYPT_INCLUDE_DIRS}) ++ ${CRYPTOPP_INCLUDE_DIRS}) + + target_link_libraries(${TARGET_NAME} + common-widgets +@@ -43,7 +41,6 @@ target_link_libraries(${TARGET_NAME} + ${KIRAN_CC_DAEMON_LIBRARIES} + ${KLOG_LIBRARIES} + ${KIRAN_STYLE_LIBRARIES} +- ${CRYPTOPP_LIBRARIES} +- ${LIBCRYPT_LIBRARIES}) ++ ${CRYPTOPP_LIBRARIES}) + + install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_DIR}/) +diff --git a/plugins/account/utils/passwd-helper.cpp b/plugins/account/utils/passwd-helper.cpp +index f6b76f2..a5641c7 100644 +--- a/plugins/account/utils/passwd-helper.cpp ++++ b/plugins/account/utils/passwd-helper.cpp +@@ -14,7 +14,6 @@ + + #include "passwd-helper.h" + +-#include + #include + #include + #include +@@ -33,62 +32,6 @@ + + using namespace CryptoPP; + +-bool PasswdHelper::encryptPassword(const QString &pwd, QString &encrypted) +-{ +- QByteArray byteArray = pwd.toLatin1(); +- QString saltChar = "ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz./0123456789"; +- +- QString rand16SaltChar; +- +- std::default_random_engine randomEngine; +- std::uniform_int_distribution uniformIntDistribution(0, saltChar.size() - 1); +- for (int i = 0; i < 16; i++) +- { +- char ch = saltChar.at(uniformIntDistribution(randomEngine)).toLatin1(); +- rand16SaltChar.append(ch); +- } +- +- QString salt = QString("$6$%1$").arg(rand16SaltChar); +- QByteArray saltByteArray = salt.toLatin1(); +- +- char *cryptedResult = nullptr; +- QByteArray cryptedResultBuffer(100, 0); +- +- //NOTE:兼容低版本libcrypt(不带有crypt_rn接口的版本) +-#if 0 +- forever +- { +- cryptedResult = crypt_rn(byteArray.data(), +- saltByteArray.data(), +- cryptedResultBuffer.data(), +- cryptedResultBuffer.size()); +- if (cryptedResult == nullptr) +- { +- if (errno == ERANGE) +- { +- cryptedResultBuffer.resize(cryptedResultBuffer.size() * 2); +- continue; +- } +- else +- { +- KLOG_WARNING() << "encrypt passwd failed," << strerror(errno); +- } +- } +- break; +- } +-#else +- crypt_data cryptData{}; +- cryptedResult = crypt_r(byteArray.data(), +- saltByteArray.data(), +- &cryptData); +-#endif +- +- if (cryptedResult) +- encrypted = cryptedResult; +- +- return cryptedResult != nullptr; +-} +- + bool PasswdHelper::encryptPasswordByRsa(const QString &publicKey, const QString &pwd, QString &encrypted) + { + CryptoPP::RandomPool random_pool; +diff --git a/plugins/account/utils/passwd-helper.h b/plugins/account/utils/passwd-helper.h +index b09d246..fc98068 100644 +--- a/plugins/account/utils/passwd-helper.h ++++ b/plugins/account/utils/passwd-helper.h +@@ -18,7 +18,6 @@ + class QString; + namespace PasswdHelper + { +-bool encryptPassword(const QString &pwd, QString &encrypted); + bool encryptPasswordByRsa(const QString &publicKey, const QString &pwd, QString &encrypted); + bool checkUserPassword(const QString &user, const QString &pwd); + } // namespace PasswdHelper +-- +2.33.0 + diff --git a/0009-fix-translations-Fix-translation-errors-in-battery-s.patch b/0009-fix-translations-Fix-translation-errors-in-battery-s.patch new file mode 100644 index 0000000..a8fea62 --- /dev/null +++ b/0009-fix-translations-Fix-translation-errors-in-battery-s.patch @@ -0,0 +1,30 @@ +From 24d7fe811440d3ab46a03db079136309f60519a8 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Mon, 8 Jan 2024 15:06:03 +0800 +Subject: [PATCH 09/17] fix(translations): Fix translation errors in battery + settings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复电池设置中错误的翻译 +--- + translations/kiran-control-panel.zh_CN.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts +index 6fb278f..970c5a0 100644 +--- a/translations/kiran-control-panel.zh_CN.ts ++++ b/translations/kiran-control-panel.zh_CN.ts +@@ -533,7 +533,7 @@ + + + Reduce screen brightness when no power +- 低点亮时减少亮度 ++ 低电量时减少亮度 + + + +-- +2.33.0 + diff --git a/0010-fix-account-Fix-the-issue-of-setting-default-selecti.patch b/0010-fix-account-Fix-the-issue-of-setting-default-selecti.patch new file mode 100644 index 0000000..7ef61bf --- /dev/null +++ b/0010-fix-account-Fix-the-issue-of-setting-default-selecti.patch @@ -0,0 +1,47 @@ +From 2b6125c1a32d3de702a60a10e2baceee481f28c0 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Tue, 9 Jan 2024 16:59:21 +0800 +Subject: [PATCH 10/17] fix(account): Fix the issue of setting default + selection sidebar errors +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复设置默认选择侧边栏错误的问题 + +Closes #24761 +--- + plugins/account/account-widget.cpp | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/plugins/account/account-widget.cpp b/plugins/account/account-widget.cpp +index 957b154..59b6cad 100644 +--- a/plugins/account/account-widget.cpp ++++ b/plugins/account/account-widget.cpp +@@ -106,17 +106,15 @@ void AccountWidget::appendUser(const QString &userPath) + + void AccountWidget::setDefaultSelectedUser() + { +- if (m_tabList->count() <= 1) ++ auto items = m_tabList->findItems(AccountsGlobalInfo::instance()->getCurrentUser(), Qt::MatchCaseSensitive); ++ if (items.size() >= 1) + { +- m_tabList->setCurrentRow(0); +- return; ++ auto userItem = items.at(0); ++ m_tabList->setCurrentRow(m_tabList->row(userItem)); + } +- +- auto items = m_tabList->findItems(AccountsGlobalInfo::instance()->getCurrentUser(), Qt::MatchCaseSensitive); +- if (items.size() > 0) ++ else + { +- auto item = items.at(0); +- m_tabList->setCurrentRow(m_tabList->row(item)); ++ m_tabList->setCurrentRow(0); + } + } + +-- +2.33.0 + diff --git a/0011-fix-build-delete-useless-methods.patch b/0011-fix-build-delete-useless-methods.patch new file mode 100644 index 0000000..0702e2e --- /dev/null +++ b/0011-fix-build-delete-useless-methods.patch @@ -0,0 +1,56 @@ +From 783eee898cda93ed345a91000834b972c971c327 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Tue, 9 Jan 2024 20:05:45 +0800 +Subject: [PATCH 11/17] fix(build): delete useless methods +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 删除无用的方法 +--- + plugins/appearance/utils/exclusion-group.cpp | 13 ------------- + plugins/appearance/utils/exclusion-group.h | 4 ---- + 2 files changed, 17 deletions(-) + +diff --git a/plugins/appearance/utils/exclusion-group.cpp b/plugins/appearance/utils/exclusion-group.cpp +index 12fb734..8db48ca 100644 +--- a/plugins/appearance/utils/exclusion-group.cpp ++++ b/plugins/appearance/utils/exclusion-group.cpp +@@ -125,19 +125,6 @@ void ExclusionGroup::removeExclusionItem(ExclusionWidget* widget) + m_exclusionItems.remove(widget); + } + +-template ::value>> +-QList ExclusionGroup::getExclusionItems() +-{ +- QList list; +- +- for( auto item : m_exclusionItems) +- { +- list << qobject_cast(item); +- } +- +- return list; +-} +- + void ExclusionGroup::onItemSelectedChanged(bool selected) + { + auto item = qobject_cast(sender()); +diff --git a/plugins/appearance/utils/exclusion-group.h b/plugins/appearance/utils/exclusion-group.h +index 4ca9bd0..7d66a1f 100644 +--- a/plugins/appearance/utils/exclusion-group.h ++++ b/plugins/appearance/utils/exclusion-group.h +@@ -65,10 +65,6 @@ public: + + void addExclusionItem(ExclusionWidget* widget); + void removeExclusionItem(ExclusionWidget* widget); +- +- template ::value>> +- QList getExclusionItems(); +- + signals: + void currentItemChanged(); + +-- +2.33.0 + diff --git a/0012-fix-font-Fix-the-issue-of-ineffective-font-changes.patch b/0012-fix-font-Fix-the-issue-of-ineffective-font-changes.patch new file mode 100644 index 0000000..0e4154e --- /dev/null +++ b/0012-fix-font-Fix-the-issue-of-ineffective-font-changes.patch @@ -0,0 +1,39 @@ +From 4f311e12f5c61c56aece10097d106a980f633c85 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Tue, 9 Jan 2024 17:09:06 +0800 +Subject: [PATCH 12/17] fix(font): Fix the issue of ineffective font changes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复字体更改后不生效的问题 + +Closes #25084 +--- + plugins/appearance/pages/font/fonts.cpp | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +diff --git a/plugins/appearance/pages/font/fonts.cpp b/plugins/appearance/pages/font/fonts.cpp +index e722123..c1c6875 100644 +--- a/plugins/appearance/pages/font/fonts.cpp ++++ b/plugins/appearance/pages/font/fonts.cpp +@@ -113,14 +113,9 @@ void Fonts::initConnections() + connect(AppearanceGlobalInfo::instance(), &AppearanceGlobalInfo::fontChanged, + this, &Fonts::onBackendFontChanged); + +- for (auto fontTypeCombos : m_fontTypeComboBoxMap.values()) ++ for (auto fontTypeCombo : m_comboFontTypesMap.keys()) + { +- auto fontNameComboBox = fontTypeCombos.first; +- auto fontSizeComboBox = fontTypeCombos.second; +- +- connect(fontNameComboBox, QOverload::of(&QComboBox::currentIndexChanged), +- this, &Fonts::onCurrentFontFamilyChanged); +- connect(fontSizeComboBox, QOverload::of(&QComboBox::currentIndexChanged), ++ connect(fontTypeCombo, QOverload::of(&QComboBox::currentIndexChanged), + this, &Fonts::onCurrentFontFamilyChanged); + } + +-- +2.33.0 + diff --git a/0013-fix-theme-change-the-light-and-dark-theme-name.patch b/0013-fix-theme-change-the-light-and-dark-theme-name.patch new file mode 100644 index 0000000..55d90c8 --- /dev/null +++ b/0013-fix-theme-change-the-light-and-dark-theme-name.patch @@ -0,0 +1,82 @@ +From 0422be13648a36784fcffc5a04ba725c7984b290 Mon Sep 17 00:00:00 2001 +From: yuanxing +Date: Thu, 11 Jan 2024 23:23:37 +0800 +Subject: [PATCH 13/17] fix(theme):change the light and dark theme name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修改深浅色主题名为冰晶白、曜岩黑 + +Fixes #24747 +--- + plugins/appearance/pages/theme/theme-page.cpp | 2 +- + plugins/appearance/pages/theme/theme-page.ui | 9 +-------- + translations/kiran-control-panel.zh_CN.ts | 4 ++-- + 3 files changed, 4 insertions(+), 11 deletions(-) + +diff --git a/plugins/appearance/pages/theme/theme-page.cpp b/plugins/appearance/pages/theme/theme-page.cpp +index 7c303b7..24a5c7a 100644 +--- a/plugins/appearance/pages/theme/theme-page.cpp ++++ b/plugins/appearance/pages/theme/theme-page.cpp +@@ -27,7 +27,7 @@ + #include + + #define DARK_THEME "Kiran-dark" +-#define LIGHT_THEME "Kiran" ++#define LIGHT_THEME "Kiran-white" + #define THEME_AUTO_NAME "Kiran-auto" + + #define SETTING_THEME_NUM 2 +diff --git a/plugins/appearance/pages/theme/theme-page.ui b/plugins/appearance/pages/theme/theme-page.ui +index eecc81e..7c61009 100644 +--- a/plugins/appearance/pages/theme/theme-page.ui ++++ b/plugins/appearance/pages/theme/theme-page.ui +@@ -78,7 +78,7 @@ + + + +- Dark and Light Theme ++ Themes Settings + + + +@@ -103,13 +103,6 @@ + + 10 + +- +- +- +- Themes Settings +- +- +- + + + +diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts +index 970c5a0..8e39486 100644 +--- a/translations/kiran-control-panel.zh_CN.ts ++++ b/translations/kiran-control-panel.zh_CN.ts +@@ -5303,7 +5303,7 @@ This is line 50 of the test text + + + Light Theme +- 浅色 ++ 冰晶白 + + + +@@ -5313,7 +5313,7 @@ This is line 50 of the test text + + + Dark Theme +- 深色 ++ 曜岩黑 + + + +-- +2.33.0 + diff --git a/0014-fix-shortcut-add-custom-app-icon-Error-prompt-for-mo.patch b/0014-fix-shortcut-add-custom-app-icon-Error-prompt-for-mo.patch new file mode 100644 index 0000000..ef16052 --- /dev/null +++ b/0014-fix-shortcut-add-custom-app-icon-Error-prompt-for-mo.patch @@ -0,0 +1,482 @@ +From 55049f4ee286633b486936c7f4d19d3d426453a0 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Mon, 15 Jan 2024 16:31:01 +0800 +Subject: [PATCH 14/17] fix(shortcut): add custom app icon,Error prompt for + modifying input shortcut keys +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修改录入快捷键错误提示,新增自定义应用图标显示 + +Closes #25199,#25198 +--- + plugins/keybinding/shortcut.cpp | 79 ++++++++++++---- + plugins/keybinding/shortcut.h | 10 +- + translations/kiran-control-panel.zh_CN.ts | 106 ++++++++++++---------- + 3 files changed, 127 insertions(+), 68 deletions(-) + +diff --git a/plugins/keybinding/shortcut.cpp b/plugins/keybinding/shortcut.cpp +index bab4ad1..84c0cba 100644 +--- a/plugins/keybinding/shortcut.cpp ++++ b/plugins/keybinding/shortcut.cpp +@@ -31,12 +31,15 @@ + #include + #include + +-Q_DECLARE_METATYPE(QList) ++#define DEFAULT_APP_ICON "application-script-blank" ++#define APP_ICON_WIDTH 20 + ++Q_DECLARE_METATYPE(QList) + using namespace Kiran; + +-Shortcut::Shortcut(QWidget *parent) : QWidget(parent), +- ui(new Ui::Shortcut) ++Shortcut::Shortcut(QWidget *parent) ++ : QWidget(parent), ++ ui(new Ui::Shortcut) + { + ui->setupUi(this); + init(); +@@ -100,16 +103,24 @@ void Shortcut::initUI() + } + + QHBoxLayout *hLayoutCustomApp = new QHBoxLayout(ui->lineEdit_custom_app); ++ m_customAppIcon = new QLabel; ++ m_customAppIcon->setFixedSize(24, 24); ++ m_customAppIcon->setPixmap(QIcon::fromTheme(DEFAULT_APP_ICON).pixmap(20, 20)); ++ hLayoutCustomApp->addWidget(m_customAppIcon, 0, Qt::AlignVCenter); ++ ++ hLayoutCustomApp->addStretch(); ++ + m_btnCustomApp = new QToolButton; + m_btnCustomApp->setObjectName("btn_custom_app"); + m_btnCustomApp->setAccessibleName("ButtonAddCustomApp"); + m_btnCustomApp->setText(tr("Add")); + m_btnCustomApp->setFixedSize(56, 30); + m_btnCustomApp->setCursor(Qt::PointingHandCursor); +- hLayoutCustomApp->addStretch(); + hLayoutCustomApp->addWidget(m_btnCustomApp); +- ui->lineEdit_custom_app->setTextMargins(0, 0, m_btnCustomApp->width(), 0); ++ ++ ui->lineEdit_custom_app->setTextMargins(25, 0, m_btnCustomApp->width(), 0); + connect(m_btnCustomApp, &QToolButton::clicked, this, &Shortcut::openFileSys); ++ connect(ui->lineEdit_custom_app,&QLineEdit::textChanged,this,&Shortcut::handleCustomAppTextChanged); + + QHBoxLayout *hLayoutModifyApp = new QHBoxLayout(ui->lineEdit_modify_app); + m_btnModifyApp = new QToolButton; +@@ -354,7 +365,7 @@ bool Shortcut::isValidKeycode(QList keycodes) + return !pureModifier; + } + +-bool Shortcut::getExecFromDesktop(QString fileName, QString &exec) ++bool Shortcut::extractDesktopInfo(const QString &fileName, QString &exec, QString &icon) + { + QSettings settings(fileName, QSettings::IniFormat); + QString str = settings.value("Desktop Entry/Exec").toString(); +@@ -368,6 +379,10 @@ bool Shortcut::getExecFromDesktop(QString fileName, QString &exec) + str = str.replace("%u", "", Qt::CaseInsensitive); + + exec = str; ++ ++ str = settings.value("Desktop Entry/Icon").toString(); ++ icon = str.isEmpty() ? DEFAULT_APP_ICON : str; ++ + return true; + } + +@@ -376,23 +391,38 @@ void Shortcut::openFileSys() + QToolButton *senderbtn = qobject_cast(sender()); + QLineEdit *lineEdit = qobject_cast(senderbtn->parent()); + +- QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "/usr/share/applications"); ++ QString fileName = QFileDialog::getOpenFileName(this, ++ tr("Open File"), ++ "/usr/share/applications", ++ tr("Desktop entries(*.desktop)")); + if (fileName.isNull()) + return; + +- QString exec = fileName; +- if (fileName.endsWith(".desktop")) ++ QString cmd; ++ QString icon = DEFAULT_APP_ICON; ++ if (!extractDesktopInfo(fileName, cmd, icon)) + { +- QString tmp; +- if (!getExecFromDesktop(fileName, tmp)) +- { +- KLOG_ERROR(qLcKeybinding) << "cant't get Exec key from " << fileName; +- return; +- } +- exec = tmp; ++ KLOG_ERROR(qLcKeybinding) << "cant't get Exec key from " << fileName; ++ KiranMessageBox::message(this, tr("Error"), ++ "Extracting the program to be executed from the application's desktop file failed", ++ KiranMessageBox::Ok); ++ return; ++ } ++ ++ // 缓存该次添加的应用以及图标信息 ++ // 后续启动命令修改的时候,应复位图标 ++ m_lastIcon = icon; ++ m_lastIconExec = cmd; ++ ++ QIcon appIcon = QIcon::fromTheme(icon); ++ if( appIcon.isNull() ) ++ { ++ m_lastIcon = DEFAULT_APP_ICON; ++ appIcon = QIcon::fromTheme(DEFAULT_APP_ICON); + } + +- lineEdit->setText(exec); ++ m_customAppIcon->setPixmap(appIcon.pixmap(QSize(APP_ICON_WIDTH,APP_ICON_WIDTH))); ++ lineEdit->setText(cmd); + } + + void Shortcut::handleSearchTimerTimeout() +@@ -787,6 +817,16 @@ void Shortcut::handleResetClicked() + } + } + ++void Shortcut::handleCustomAppTextChanged(const QString& text) ++{ ++ // 直接编辑自定义应用输入框,修改命令 ++ // 导致和desktop读取出来的不一致时清空图标 ++ if( !text.isEmpty() && text != m_lastIconExec ) ++ { ++ m_customAppIcon->setPixmap(QIcon::fromTheme(DEFAULT_APP_ICON).pixmap(20,20)); ++ } ++} ++ + void Shortcut::handleInputKeycode(QList keycodes) + { + CustomLineEdit *senderLineEdit = qobject_cast(sender()); +@@ -803,8 +843,9 @@ void Shortcut::handleInputKeycode(QList keycodes) + { + KiranMessageBox::message(nullptr, + tr("Failed"), +- QString(tr("Cannot use shortcut \"%1\", Because you cannot enter with this key." +- "Please try again using Ctrl, Alt, or Shift at the same time.")) ++ QString(tr("Cannot use shortcut \"%1\"," ++ "Please keep pressing the modifier keys such as Ctrl," ++ "Alt, and Shift before pressing the last key of the shortcut key")) + .arg(keyStr), + KiranMessageBox::Ok); + return; +diff --git a/plugins/keybinding/shortcut.h b/plugins/keybinding/shortcut.h +index fc078fb..3504b1b 100644 +--- a/plugins/keybinding/shortcut.h ++++ b/plugins/keybinding/shortcut.h +@@ -35,6 +35,8 @@ class ShortcutItem; + class KeyMap; + class CustomLineEdit; + class KeybindingBackEndProxy; ++class QLabel; ++ + class Shortcut : public QWidget + { + Q_OBJECT +@@ -59,7 +61,7 @@ private: + ShortcutItem *createShortcutItem(QVBoxLayout *parent, ShortcutInfoPtr shortcutInfo, int type); + bool isConflict(QString &originName, QString newKeyCombination); + bool isValidKeycode(QList keycodes); +- bool getExecFromDesktop(QString fileName, QString &exec); ++ bool extractDesktopInfo(const QString& fileName, QString &exec, QString &icon); + void updateShorcut(ShortcutInfoPtr newShortcut); + void insertShortcut(ShortcutInfoPtr shortcutInfo); + void clearFilterItems(); +@@ -72,6 +74,7 @@ public slots: + void handledShortcutDeleted(QString result); + void handleShortcutChanged(QString result); + ++ void handleCustomAppTextChanged(const QString& text); + void handleInputKeycode(QList keycodes); + + void handleItemDeleteClicked(QString uid); +@@ -96,8 +99,13 @@ private: + QList m_shortcutItem; + QList m_filterItem; + ++ //记录上次通过应用打开的desktop文件记录的Exec和Icon ++ QString m_lastIconExec; ++ QString m_lastIcon; ++ + QToolButton *m_btnModifyApp; + QToolButton *m_btnCustomApp; ++ QLabel *m_customAppIcon; + CustomLineEdit *m_lECustomKey; + CustomLineEdit *m_lEModifyKey; + +diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts +index 970c5a0..31fc01e 100644 +--- a/translations/kiran-control-panel.zh_CN.ts ++++ b/translations/kiran-control-panel.zh_CN.ts +@@ -33,18 +33,18 @@ + AccountWidget + + +- ++ + disable + 禁用 + + + +- ++ + enable + 启用 + + +- ++ + Create new user + 创建新用户 + +@@ -2983,22 +2983,22 @@ + 请用分号分隔多个DNS + + +- ++ + Ipv6 DNS invalid + 无效的Ipv6 DNS + + +- ++ + Ipv6 address can not be empty + Ipv6地址不能为空 + + +- ++ + Ipv6 address invalid + 无效的Ipv6地址 + + +- ++ + Ipv6 Gateway invalid + 无效的Ipv6网关 + +@@ -4675,8 +4675,8 @@ This is line 50 of the test text + + + +- +- ++ ++ + Edit + 编辑 + +@@ -4688,8 +4688,8 @@ This is line 50 of the test text + + + +- +- ++ ++ + Add + 添加 + +@@ -4742,7 +4742,7 @@ This is line 50 of the test text + + + Cancel +- 取消 ++ 取消 + + + +@@ -4772,7 +4772,7 @@ This is line 50 of the test text + + + Save +- 保存 ++ 保存 + + + +@@ -4782,129 +4782,139 @@ This is line 50 of the test text + + + return +- 返回 ++ 返回 + + +- ++ + Please enter a search keyword... + 请输入搜索关键字... + + +- ++ + Required + 必填 + + +- +- ++ ++ + Please press the new shortcut key + 请输入新快捷键 + + +- ++ + Finished + 完成 + + +- ++ + failed to load shortcut key data! + 加载快捷键数据失败! + + +- ++ + List shortcut failed,error:%1 + 列出快捷键失败,错误:%1 + + +- ++ ++ + Error + 错误 + + +- ++ + Get shortcut failed,error: + 获取快捷键失败,错误: + + +- ++ + Open File + 打开文件 + + +- ++ ++ Desktop entries(*.desktop) ++ 桌面文件(*.desktop) ++ ++ ++ + System + 系统 + + +- ++ + Sound + 声音 + + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + Failed + 失败 + + +- ++ + Delete shortcut failed,error: + 删除快捷键失败,错误: + + +- +- ++ ++ + Warning +- 警告 ++ 警告 + + +- +- ++ ++ + Please complete the shortcut information! + 请完善快捷键信息! + + +- ++ + Set shortcut + 设置快捷键 + + +- ++ + Are you sure you want to disable this shortcut? + 是否确定要禁用此快捷键? + + +- ++ + Modify system shortcut failed,error: + 修改系统快捷键失败,错误: + + +- ++ + Modify custom shortcut failed,error: + 修改自定义快捷键失败,错误: + + +- ++ + Add custom shortcut failed,error: + 添加自定义快捷键失败,错误: + + +- ++ + Reset shortcut failed,error: + 重置快捷键失败,错误: + + +- ++ ++ Cannot use shortcut "%1",Please keep pressing the modifier keys such as Ctrl,Alt, and Shift before pressing the last key of the shortcut key ++ 无法使用快捷键"%1", 请保持按压Ctrl、Alt、Shift等修饰键后,再按压快捷键的最后一个键 ++ ++ + Cannot use shortcut "%1", Because you cannot enter with this key.Please try again using Ctrl, Alt, or Shift at the same time. +- 无法使用快捷键"%1",因为使用此键将无法输入,请同时使用Ctrl,Alt,Shift再试一次。 ++ 无法使用快捷键"%1",因为使用此键将无法输入,请同时使用Ctrl,Alt,Shift再试一次。 + + +- ++ + Shortcut keys %1 are already used in %2,Please try again! + 快捷键%1已用于%2,请再试一次! + +-- +2.33.0 + diff --git a/0015-fix-power-profile-mode-using-kiran-cc-daemon-power-i.patch b/0015-fix-power-profile-mode-using-kiran-cc-daemon-power-i.patch new file mode 100644 index 0000000..4d07058 --- /dev/null +++ b/0015-fix-power-profile-mode-using-kiran-cc-daemon-power-i.patch @@ -0,0 +1,669 @@ +From 26d4b8d60a30821c398ef4be3b6352f5041a56a3 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Mon, 15 Jan 2024 17:28:15 +0800 +Subject: [PATCH 15/17] fix(power): profile mode using kiran-cc-daemon power + interface +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 计算机模式接口使用控制中心后端所提供的接口 + +Closes #25242 +--- + plugins/power/CMakeLists.txt | 9 +- + ...com.kylinsec.Kiran.SessionDaemon.Power.xml | 16 ++ + .../power/data/net.hadess.PowerProfiles.xml | 144 ------------------ + plugins/power/dbus/power-profiles-wrapper.cpp | 124 --------------- + plugins/power/dbus/power-profiles-wrapper.h | 50 ------ + plugins/power/pages/general-settings-page.cpp | 47 ++++-- + plugins/power/pages/general-settings-page.h | 4 +- + translations/kiran-control-panel.zh_CN.ts | 59 ++++--- + 8 files changed, 86 insertions(+), 367 deletions(-) + delete mode 100644 plugins/power/data/net.hadess.PowerProfiles.xml + delete mode 100644 plugins/power/dbus/power-profiles-wrapper.cpp + delete mode 100644 plugins/power/dbus/power-profiles-wrapper.h + +diff --git a/plugins/power/CMakeLists.txt b/plugins/power/CMakeLists.txt +index 37d025d..99dc819 100644 +--- a/plugins/power/CMakeLists.txt ++++ b/plugins/power/CMakeLists.txt +@@ -7,6 +7,7 @@ set(TARGET_NAME kiran-cpanel-power) + pkg_search_module(UPOWER_GLIB REQUIRED upower-glib) + + set(POWER_PLUGIN_DBUS_SRC_LIST "") ++ + # com.kylinsec.Kiran.SessionDaemon.Power + set(KSD_POWER_XML data/com.kylinsec.Kiran.SessionDaemon.Power.xml) + set_source_files_properties(${KSD_POWER_XML} +@@ -17,13 +18,7 @@ kiran_qt5_add_dbus_interface_ex(KSD_POWER_SRC + ksd_power_proxy + KSDPowerProxy) + list(APPEND POWER_PLUGIN_DBUS_SRC_LIST ${KSD_POWER_SRC}) +-# net.hadess.PowerProfiles +-set(POWERPROFILES_XML data/net.hadess.PowerProfiles.xml) +-kiran_qt5_add_dbus_interface_ex(POWER_PROFILES_SRC +- ${POWERPROFILES_XML} +- power_profiles_proxy +- PowerProfilesProxy) +-list(APPEND POWER_PLUGIN_DBUS_SRC_LIST ${POWER_PROFILES_SRC}) ++ + # org.gnome.SessionManager.xml - kiran-session-manager + set(GNOME_SESSION_MANAGER_XML data/org.gnome.SessionManager.xml) + kiran_qt5_add_dbus_interface_ex(GNOME_SESSION_MANAGER_SOUCE +diff --git a/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml b/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml +index 281ffdb..c32bbb5 100644 +--- a/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml ++++ b/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml +@@ -82,6 +82,13 @@ + Enable cpu save energy when the ups or battery power is low. + + ++ ++ ++ The profile mode. Refer to PowerProfileMode in power-i.h ++ ++ Switch profile mode. ++ ++ + + + Indicates whether the system is running on battery power. +@@ -107,6 +114,11 @@ + Whether does the cpu save energy when the ups or battery power is low. + + ++ ++ ++ The active profile mode. ++ ++ + + + +@@ -120,5 +132,9 @@ + + + ++ ++ ++ ++ + + +diff --git a/plugins/power/data/net.hadess.PowerProfiles.xml b/plugins/power/data/net.hadess.PowerProfiles.xml +deleted file mode 100644 +index a3241fb..0000000 +--- a/plugins/power/data/net.hadess.PowerProfiles.xml ++++ /dev/null +@@ -1,144 +0,0 @@ +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +diff --git a/plugins/power/dbus/power-profiles-wrapper.cpp b/plugins/power/dbus/power-profiles-wrapper.cpp +deleted file mode 100644 +index 6262fdc..0000000 +--- a/plugins/power/dbus/power-profiles-wrapper.cpp ++++ /dev/null +@@ -1,124 +0,0 @@ +-/** +- * Copyright (c) 2020 ~ 2023 KylinSec Co., Ltd. +- * kiran-control-panel is licensed under Mulan PSL v2. +- * You can use this software according to the terms and conditions of the Mulan PSL v2. +- * You may obtain a copy of Mulan PSL v2 at: +- * http://license.coscl.org.cn/MulanPSL2 +- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +- * See the Mulan PSL v2 for more details. +- * +- * Author: liuxinhao +- */ +-#include "power-profiles-wrapper.h" +-#include +-#include +-#include +-#include +-#include +-#include "power_profiles_proxy.h" +- +-#define POWERPROFILES_SERVICE_NAME "net.hadess.PowerProfiles" +-#define POWERPROFILES_SERVICE_PATH "/net/hadess/PowerProfiles" +-#define POWERPROFILES_SERVICE_PROPERTY_ACTIVE_PROFILE "ActiveProfile" +-#define POWERPROFILES_SERVICE_PROPERTY_PROFILES "Profiles" +- +-#define FREEDESKTOP_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties" +-#define FREEDESKTOP_PROPERTIES_METHOD_GET "Get" +-#define FREEDESKTOP_PROPERTIES_METHOD_SET "Set" +-#define FREEDESKTOP_PROPERTIES_SIGNAL_PROPERTIES_CHANGED "PropertiesChanged" +- +-Q_DECLARE_METATYPE(QList) +-PowerProfilesWrapper::PowerProfilesWrapper(QObject* parent) +- : QObject(parent), +- m_profileProxy(new PowerProfilesProxy(POWERPROFILES_SERVICE_NAME, POWERPROFILES_SERVICE_PATH, QDBusConnection::systemBus(), this)) +-{ +- qDBusRegisterMetaType>(); +- if (QDBusConnection::systemBus().interface()->isServiceRegistered(POWERPROFILES_SERVICE_NAME)) +- { +- m_isValid = true; +- auto powerProfiles = m_profileProxy->profiles(); +- for (auto powerProfile : powerProfiles) +- { +- KLOG_DEBUG() << powerProfile["Profile"].toString()<< powerProfile["Driver"].toString(); +- if (powerProfile.contains("Profile")) +- { +- m_profiles << profileNameTransToLocale(powerProfile["Profile"].toString()); +- } +- } +- +- auto activeProfile = m_profileProxy->activeProfile(); +- m_activeProfile = activeProfile; +- connect(m_profileProxy, &PowerProfilesProxy::ActiveProfileChanged, +- this, &PowerProfilesWrapper::onActiveProfileChanged); +- } +- else +- { +- KLOG_WARNING() << "power profiles init failed," << POWERPROFILES_SERVICE_NAME << "isn't registered"; +- } +-} +- +-PowerProfilesWrapper::~PowerProfilesWrapper() +-{ +-} +- +-bool PowerProfilesWrapper::isValid() +-{ +- return m_isValid; +-} +- +-QStringList PowerProfilesWrapper::supportedProfiles() +-{ +- return m_profiles; +-} +- +-QString PowerProfilesWrapper::activeProfile() +-{ +- return profileNameTransToLocale(m_activeProfile); +-} +- +-void PowerProfilesWrapper::setActiveProfile(const QString& profileName) +-{ +- QString value = localeTransToProfileName(profileName); +- m_profileProxy->setActiveProfile(value); +-} +- +-void PowerProfilesWrapper::onActiveProfileChanged(const QString& profileName) +-{ +- m_activeProfile = profileName; +- QString localeProfileName = profileNameTransToLocale(profileName); +- emit activeProfileChanged(localeProfileName); +-} +- +-QString PowerProfilesWrapper::profileNameTransToLocale(const QString& profileName) +-{ +- QMap transMap = { +- {"power-saver", tr("power-saver")}, +- {"balanced", tr("balanced")}, +- {"performance", tr("performance")}}; +- +- QString localeProfileName = profileName; +- if (transMap.contains(profileName)) +- { +- localeProfileName = transMap[profileName]; +- } +- +- return localeProfileName; +-} +- +-QString PowerProfilesWrapper::localeTransToProfileName(const QString& locale) +-{ +- QMap transMap = { +- {tr("power-saver"), "power-saver"}, +- {tr("balanced"), "balanced"}, +- {tr("performance"), "performance"}}; +- +- QString profileName = locale; +- if (transMap.contains(locale)) +- { +- profileName = transMap[locale]; +- } +- +- return profileName; +-} +diff --git a/plugins/power/dbus/power-profiles-wrapper.h b/plugins/power/dbus/power-profiles-wrapper.h +deleted file mode 100644 +index 0e5723c..0000000 +--- a/plugins/power/dbus/power-profiles-wrapper.h ++++ /dev/null +@@ -1,50 +0,0 @@ +-/** +- * Copyright (c) 2020 ~ 2023 KylinSec Co., Ltd. +- * kiran-control-panel is licensed under Mulan PSL v2. +- * You can use this software according to the terms and conditions of the Mulan PSL v2. +- * You may obtain a copy of Mulan PSL v2 at: +- * http://license.coscl.org.cn/MulanPSL2 +- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +- * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +- * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +- * See the Mulan PSL v2 for more details. +- * +- * Author: liuxinhao +- */ +-#pragma once +- +-#include +-#include +- +-class PowerProfilesProxy; +-class PowerProfilesWrapper : public QObject +-{ +- Q_OBJECT +-public: +- PowerProfilesWrapper(QObject* parent = nullptr); +- ~PowerProfilesWrapper(); +- +- bool isValid(); +- +- QStringList supportedProfiles(); +- QString activeProfile(); +- void setActiveProfile(const QString& profileName); +- +-private slots: +- void onActiveProfileChanged(const QString& profileName); +- +-signals: +- void activeProfileChanged(const QString& profileName); +- +-private: +- // 由英文的ProfileName装换成本地locale的翻译文本 +- QString profileNameTransToLocale(const QString& profileName); +- // 由于locale的翻译文本,转换成英文的ProfileName +- QString localeTransToProfileName(const QString& locale); +- +-private: +- PowerProfilesProxy* m_profileProxy = nullptr; +- bool m_isValid = false; +- QString m_activeProfile; +- QStringList m_profiles; +-}; +\ No newline at end of file +diff --git a/plugins/power/pages/general-settings-page.cpp b/plugins/power/pages/general-settings-page.cpp +index 9176a00..430d103 100644 +--- a/plugins/power/pages/general-settings-page.cpp ++++ b/plugins/power/pages/general-settings-page.cpp +@@ -19,7 +19,6 @@ + #include + #include + #include "dbus/kwin-color-correct.h" +-#include "dbus/power-profiles-wrapper.h" + #include "dbus/power.h" + #include "kiran-message-box.h" + #include "kiran-session-daemon/power-i.h" +@@ -41,8 +40,7 @@ GeneralSettingsPage::GeneralSettingsPage(QWidget* parent) + : QWidget(parent), + ui(new Ui::GeneralSettingsPage), + m_powerInterface(PowerInterface::getInstance()), +- m_kwinColorCorrect(new KWinColorCorrect(this)), +- m_powerprofiles(new PowerProfilesWrapper(this)) ++ m_kwinColorCorrect(new KWinColorCorrect(this)) + { + ui->setupUi(this); + init(); +@@ -147,13 +145,18 @@ void GeneralSettingsPage::initUI() + } + + // 初始化计算机模式 +- if (m_powerprofiles->isValid()) ++ struct PowerProfileInfo + { +- ui->combo_computerMode->addItems(m_powerprofiles->supportedProfiles()); +- } +- else ++ QString name; ++ int index; ++ }; ++ QList profiles = { ++ {tr("Energy-saving mode"), POWER_PROFILE_MODE_SAVER}, ++ {tr("Balanced mode"), POWER_PROFILE_MODE_BALANCED}, ++ {tr("High performance mode"), POWER_PROFILE_MODE_PERFORMANCE}}; ++ for (auto profile : profiles) + { +- ui->widget_computerMode->setVisible(false); ++ ui->combo_computerMode->addItem(profile.name, profile.index); + } + + /// 初始化QSlider,和延迟设置的Timer +@@ -209,7 +212,7 @@ void GeneralSettingsPage::initConnection() + connect(ui->combo_closingLid, QOverload::of(&QComboBox::currentIndexChanged), + this, &GeneralSettingsPage::updateEventAction); + +- connect(ui->combo_computerMode, &QComboBox::currentTextChanged, ++ connect(ui->combo_computerMode, QOverload::of(&QComboBox::currentIndexChanged), + this, &GeneralSettingsPage::updateCurrentComputerMode); + + connect(&m_brightnessSettingTimer, &QTimer::timeout, +@@ -271,10 +274,15 @@ void GeneralSettingsPage::load() + updateEventActionComboCurrent(ui->combo_closingLid, POWER_EVENT_LID_CLOSED); + + // 计算机模式 +- if (m_powerprofiles->isValid()) ++ QSignalBlocker blocker(ui->combo_computerMode); ++ int activePorfileComboxIdx = ui->combo_computerMode->findData(m_powerInterface->activeProfile()); ++ if (activePorfileComboxIdx != -1) + { +- QSignalBlocker blocker(ui->combo_computerMode); +- ui->combo_computerMode->setCurrentText(m_powerprofiles->activeProfile()); ++ ui->combo_computerMode->setCurrentIndex(activePorfileComboxIdx); ++ } ++ else ++ { ++ KLOG_ERROR() << "can not fidn current active computer mode in combobox:" << m_powerInterface->activeProfile(); + } + + // 显示器亮度调整 +@@ -496,9 +504,20 @@ void GeneralSettingsPage::onSliderColorTempValueChanged(int value) + m_colorTempSettingTimer.start(); + } + +-void GeneralSettingsPage::updateCurrentComputerMode(const QString& text) ++void GeneralSettingsPage::updateCurrentComputerMode(int idx) + { +- m_powerprofiles->setActiveProfile(text); ++ auto computerMode = ui->combo_computerMode->itemData(idx); ++ auto reply = m_powerInterface->SwitchProfile(computerMode.toInt()); ++ reply.waitForFinished(); ++ if (reply.isError()) ++ { ++ KLOG_ERROR() << "set current computer mode" << computerMode.toInt() ++ << "failed," << reply.error(); ++ } ++ else ++ { ++ KLOG_DEBUG() << "set current computer mode" << computerMode.toInt(); ++ } + } + + void GeneralSettingsPage::setUiBrightnessPercent(int percent) +diff --git a/plugins/power/pages/general-settings-page.h b/plugins/power/pages/general-settings-page.h +index 63e8591..e270253 100644 +--- a/plugins/power/pages/general-settings-page.h ++++ b/plugins/power/pages/general-settings-page.h +@@ -29,7 +29,6 @@ class PowerInterface; + class KiranSwitchButton; + class QGSettings; + class KWinColorCorrect; +-class PowerProfilesWrapper; + class GeneralSettingsPage : public QWidget + { + Q_OBJECT +@@ -62,13 +61,12 @@ private slots: + void onSwitchAutoColorTempToggoled(bool checked); + void updateColorTempatureValue(); + void onSliderColorTempValueChanged(int value); +- void updateCurrentComputerMode(const QString& text); ++ void updateCurrentComputerMode(int idx); + + private: + Ui::GeneralSettingsPage *ui; + PowerInterface* m_powerInterface; + KWinColorCorrect* m_kwinColorCorrect; +- PowerProfilesWrapper* m_powerprofiles; + QTimer m_brightnessSettingTimer; + QTimer m_idleTimeSettingTimer; + QTimer m_colorTempSettingTimer; +diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts +index 31fc01e..83cac3b 100644 +--- a/translations/kiran-control-panel.zh_CN.ts ++++ b/translations/kiran-control-panel.zh_CN.ts +@@ -2297,50 +2297,65 @@ + 待机时唤醒需要输入密码 + + +- +- ++ ++ + shutdown + 关机 + + +- +- +- ++ ++ ++ + hibernate + 休眠 + + +- +- +- ++ ++ ++ + suspend + 待机 + + +- +- ++ ++ + display off + 关闭显示器 + + +- +- +- ++ ++ ++ + do nothing + 不执行操作 + + +- ++ ++ Energy-saving mode ++ 节能模式 ++ ++ ++ ++ Balanced mode ++ 平衡模式 ++ ++ ++ ++ High performance mode ++ 高性能模式 ++ ++ ++ + ERROR + 错误 + + +- ++ + %1hour + %1小时 + + +- ++ + %1minute + %1分钟 + +@@ -4329,22 +4344,16 @@ This is line 50 of the test text + + PowerProfilesWrapper + +- +- + power-saver +- 省电模式 ++ 省电模式 + + +- +- + balanced +- 平衡模式 ++ 平衡模式 + + +- +- + performance +- 性能模式 ++ 性能模式 + + + +-- +2.33.0 + diff --git a/0016-fix-launcher-Fix-the-space-before-the-parameter-caus.patch b/0016-fix-launcher-Fix-the-space-before-the-parameter-caus.patch new file mode 100644 index 0000000..da264dd --- /dev/null +++ b/0016-fix-launcher-Fix-the-space-before-the-parameter-caus.patch @@ -0,0 +1,35 @@ +From b3ac61f93e733f3ec0d9cea4452d0eee159e8957 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Mon, 15 Jan 2024 17:52:29 +0800 +Subject: [PATCH 16/17] fix(launcher): Fix the space before the parameter + causing a jump event when the launcher jumps +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复启动器跳转时参数前的空格导致跳转失败 + +Closes #24794 +--- + src/main.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/main.cpp b/src/main.cpp +index 981fdbf..4258832 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -65,7 +65,11 @@ void processCommandLine() + cmdParser.process(*singleApp); + + QString category = cmdParser.value(categoryOption); ++ category = category.trimmed(); ++ + QString subItem = cmdParser.value(subItemOption); ++ subItem = subItem.trimmed(); ++ + if( !subItem.isEmpty() && category.isEmpty() ) + { + std::cerr << "failed to set sub item without category" << std::endl; +-- +2.33.0 + diff --git a/0017-fix-audio-fixed-volume-tray-icon-level-display-not-m.patch b/0017-fix-audio-fixed-volume-tray-icon-level-display-not-m.patch new file mode 100644 index 0000000..da4df22 --- /dev/null +++ b/0017-fix-audio-fixed-volume-tray-icon-level-display-not-m.patch @@ -0,0 +1,75 @@ +From 251cff7db6e926b9df02276acf49d80c8e8b958f Mon Sep 17 00:00:00 2001 +From: luoqing +Date: Tue, 9 Jan 2024 17:13:10 +0800 +Subject: [PATCH 17/17] fix(audio):fixed volume tray icon level display not + meeting requirements +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复音量托盘图标级别显示不符合需求 + +Close #25235 +--- + plugins/audio/src/system-tray/audio-system-tray.cpp | 4 ++-- + plugins/audio/src/system-tray/volume-setting-page.cpp | 4 ++-- + plugins/network/src/signal-forward.cpp | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/plugins/audio/src/system-tray/audio-system-tray.cpp b/plugins/audio/src/system-tray/audio-system-tray.cpp +index ed4412f..b20ad15 100644 +--- a/plugins/audio/src/system-tray/audio-system-tray.cpp ++++ b/plugins/audio/src/system-tray/audio-system-tray.cpp +@@ -266,12 +266,12 @@ void AudioSystemTray::setTrayIcon(int value) + icon.addPixmap(trayIconColorSwitch("kcp-audio-mute")); + icon.addPixmap(trayIconColorSwitch("kcp-audio-mute", 64)); + } +- else if (0 < value && value <= 33) ++ else if (0 < value && value <= 34) + { + icon.addPixmap(trayIconColorSwitch("kcp-audio-low")); + icon.addPixmap(trayIconColorSwitch("kcp-audio-low", 64)); + } +- else if (33 < value && value <= 66) ++ else if (33 < value && value <= 67) + { + icon.addPixmap(trayIconColorSwitch("kcp-audio-medium")); + icon.addPixmap(trayIconColorSwitch("kcp-audio-medium", 64)); +diff --git a/plugins/audio/src/system-tray/volume-setting-page.cpp b/plugins/audio/src/system-tray/volume-setting-page.cpp +index dbb1cd8..d95b039 100644 +--- a/plugins/audio/src/system-tray/volume-setting-page.cpp ++++ b/plugins/audio/src/system-tray/volume-setting-page.cpp +@@ -239,11 +239,11 @@ void VolumeSettingPage::setVolumeIcon(int value) + { + ui->muteButton->setIcon(trayIconColorSwitch("kcp-audio-mute")); + } +- else if (0 < value && value <= 33) ++ else if (0 < value && value <= 34) + { + ui->muteButton->setIcon(trayIconColorSwitch("kcp-audio-low")); + } +- else if (33 < value && value <= 66) ++ else if (33 < value && value <= 67) + { + ui->muteButton->setIcon(trayIconColorSwitch("kcp-audio-medium")); + } +diff --git a/plugins/network/src/signal-forward.cpp b/plugins/network/src/signal-forward.cpp +index 82f4de9..de8415d 100644 +--- a/plugins/network/src/signal-forward.cpp ++++ b/plugins/network/src/signal-forward.cpp +@@ -172,10 +172,10 @@ void SignalForward::addDevice(const QString &uni) + switch (device->type()) + { + case Device::Type::Ethernet: +- emit wiredDeviceAdded(uni);; ++ emit wiredDeviceAdded(uni); + break; + case Device::Type::Wifi: +- emit wirelessDeviceAdded(uni);; ++ emit wirelessDeviceAdded(uni); + break; + default: + emit otherDeviceAdded(uni); +-- +2.33.0 + diff --git a/kiran-control-panel.spec b/kiran-control-panel.spec index 5922c1c..3df0039 100644 --- a/kiran-control-panel.spec +++ b/kiran-control-panel.spec @@ -1,6 +1,6 @@ Name: kiran-control-panel Version: 2.6.0 -Release: 4%{?dist}.kb1 +Release: 6%{?dist} Summary: Kiran Control Panel Summary(zh_CN): Kiran桌面控制面板 @@ -10,6 +10,21 @@ Source0: %{name}-%{version}.tar.gz Patch0000: 0000-fix-pkgconfig-Fix-the-issue-of-incorrect-content-in-.patch Patch0001: 0001-fix-appearance-remove-the-Kiran-and-Adwaita-icon-the.patch Patch0002: 0002-fix-plugins-Fix-runtime-plugin-loading-errors.patch +Patch0003: 0003-fix-LC_TIME-set-LC_TIME-to-UTF-8.patch +Patch0004: 0004-fix-network-fix-compile-issues-QString-SkipEmptyPart.patch +Patch0005: 0005-fix-audio-listen-to-mute-property-change-to-fix-shor.patch +Patch0006: 0006-fix-network-fixd-an-issue-where-the-network-tray-ico.patch +Patch0007: 0007-fix-application-add-a-compilation-switch-to-control-.patch +Patch0008: 0008-refactor-account-Remove-useless-password-encryption-.patch +Patch0009: 0009-fix-translations-Fix-translation-errors-in-battery-s.patch +Patch00010: 0010-fix-account-Fix-the-issue-of-setting-default-selecti.patch +Patch00011: 0011-fix-build-delete-useless-methods.patch +Patch00012: 0012-fix-font-Fix-the-issue-of-ineffective-font-changes.patch +Patch00013: 0013-fix-theme-change-the-light-and-dark-theme-name.patch +Patch00014: 0014-fix-shortcut-add-custom-app-icon-Error-prompt-for-mo.patch +Patch00015: 0015-fix-power-profile-mode-using-kiran-cc-daemon-power-i.patch +Patch00016: 0016-fix-launcher-Fix-the-space-before-the-parameter-caus.patch +Patch00017: 0017-fix-audio-fixed-volume-tray-icon-level-display-not-m.patch BuildRequires: gcc-c++ BuildRequires: cmake >= 3.2 @@ -157,6 +172,18 @@ make %{?_smp_mflags} rm -rf %{buildroot} %changelog +* Thu Jan 18 2024 luoqing - 2.6.0-6 +- KYOS-B: Fix the issue of setting default selection sidebar errors (#24761) +- KYOS-B: Fix the issue of ineffective font changes (#25084) +- KYOS-B: change the light and dark theme name (#24747) +- KYOS-B: add custom app icon,Error prompt for modifying input shortcut keys (#25199,#25198) +- KYOS-B: profile mode using kiran-cc-daemon power interface (#25242) +- KYOS-B: Fix the space before the parameter causing a jump event when the launcher jumps (#24794) +- KYOS-B: fixed volume tray icon level display not meeting requirements (#25235) + +* Tue Dec 19 2023 liuxinhao - 2.6.0-5.kb1 +- KYOS-B: set LC_TIME to UTF-8 for avoid garbled characters (#24064) + * Fri Dec 15 2023 liuxinhao - 2.6.0-4.kb1 - KYOS-B: Fix runtime plugin loading errors