diff -Nru ukui-control-center-4.10.0.0/debian/changelog ukui-control-center-4.10.0.0/debian/changelog --- ukui-control-center-4.10.0.0/debian/changelog 2024-12-13 15:51:13.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/changelog 2025-01-01 16:22:05.000000000 +0800 @@ -1,3 +1,17 @@ +ukui-control-center (4.10.0.0-ok53) nile; urgency=medium + + * BUG:#277741 【显示器】缩放率修改注销后未生效 + * BUG:#291357 【主题设置】关闭特效模式,重启/注销登录后特效模式自动打开,透明度为100% + * BUG:#277741 【显示器】缩放率修改注销后未生效 + * BUG:#301485 点击输入法的编辑按钮无反应 + * BUG:#292337 中文用户下手册图片不正确 + * BUG:#310473 不能切换分辨率、方向、刷新率,切换无保存提示 + * 需求号: 无 + * 其他改动说明:解决编译问题 + * 其他改动影响域:无 + + -- zhoubin <zhoubin@kylinos.cn> Wed, 01 Jan 2025 16:22:05 +0800 + ukui-control-center (4.10.0.0-ok52) nile; urgency=medium * BUG:#294817 【时间日期】每次打开时间日期界面缺失严重 diff -Nru ukui-control-center-4.10.0.0/debian/patches/0101-113.patch ukui-control-center-4.10.0.0/debian/patches/0101-113.patch --- ukui-control-center-4.10.0.0/debian/patches/0101-113.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0101-113.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,59 @@ +From: nil <zhoubin@kylinos.cn> +Date: Tue, 17 Dec 2024 10:12:37 +0000 +Subject: =?utf-8?b?ITExMyDkv67mlLnljZXlhYPmtYvor5XohJrmnKwgTWVyZ2UgcHVsbCBy?= + =?utf-8?b?ZXF1ZXN0ICExMTMgZnJvbSDkvZXmgJ3og5wvbmlsZQ==?= + +--- + tests/auto_test.sh | 10 +++++++--- + tests/unit_test_mouse/unit_test_mouse.pro | 2 +- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/tests/auto_test.sh b/tests/auto_test.sh +index 5c8885a..d6a1793 100755 +--- a/tests/auto_test.sh ++++ b/tests/auto_test.sh +@@ -10,9 +10,12 @@ run_unit_tests() { + # 遍历所有匹配模式的目录 + for dir in $pattern; do + if [ -d "$dir" ] && [ -x "$dir/$(basename "$dir")" ]; then +- echo "Running tests in $dir and Collecting coverage data..." ++ echo "Running tests in $dir..." ++ # 执行单元测试 ++ (cd "$dir" && "./$(basename "$dir")") + # 收集代码覆盖率数据 +- (cd "$dir" && "./$(basename "$dir")" && (find ./ -name '*.o' | xargs gcov --preserve-paths)) ++ echo "Collecting coverage data..." ++ (cd "$dir" && (find ./ -name '*.o' | xargs gcov --preserve-paths)) + else + echo "Skipping non-existent or non-executable directory: $dir, $dir/$(basename "$dir")" + fi +@@ -20,6 +23,7 @@ run_unit_tests() { + } + + # 上传 result.zip 到平台 ++URL=$1 + upload_result() { + echo "current pwd : $(pwd)" + # 收集覆盖率信息 +@@ -34,7 +38,7 @@ upload_result() { + # 打包 + zip -r result.zip result + # 上传平台 +- curl --insecure -X POST -F "file=@/$(pwd)/result.zip" -F "package=ukui-control-center" -F "username=$1" $2 ++ curl --insecure -X POST -F "file=@/$(pwd)/result.zip" -F "package=ukui-control-center" -F "username=hesisheng" $URL + echo "all parameter : $@" + } + +diff --git a/tests/unit_test_mouse/unit_test_mouse.pro b/tests/unit_test_mouse/unit_test_mouse.pro +index 4424f86..d6044a8 100644 +--- a/tests/unit_test_mouse/unit_test_mouse.pro ++++ b/tests/unit_test_mouse/unit_test_mouse.pro +@@ -19,7 +19,7 @@ QMAKE_CXXFLAGS += --coverage -fno-inline -fno-access-control + INCLUDEPATH += $$PROJECT_ROOTDIR + + LIBS += -lgtest_main -lpthread +-LIBS += -L$$[QT_INSTALL_LIBS] -lXi -lgsettings-qt -lgtest -lgcov ++LIBS += -L$$[QT_INSTALL_LIBS] -lgsettings-qt -lgtest -lgcov + + #OBJECTS_DIR = ./obj/ + #MOC_DIR = ./moc/ diff -Nru ukui-control-center-4.10.0.0/debian/patches/0102-114-issue-IB1REM-ARM.patch ukui-control-center-4.10.0.0/debian/patches/0102-114-issue-IB1REM-ARM.patch --- ukui-control-center-4.10.0.0/debian/patches/0102-114-issue-IB1REM-ARM.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0102-114-issue-IB1REM-ARM.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,614 @@ +From: =?utf-8?b?6IuP5Zej5YW4?= <susidian@kylinos.cn> +Date: Wed, 18 Dec 2024 07:28:25 +0000 +Subject: =?utf-8?b?ITExNCBpc3N1ZT1JQjFSRU0g44CQQVJN44CR44CQ5Li76KaB44CR44CQ?= + =?utf-8?b?5pi+56S65Zmo44CR5L6n6L655qCP5Lit5Y+v5Lul6LCD6IqC5pi+56S65Zmo5Lqu?= + =?utf-8?b?5bqm77yM5L2G5o6n5Yi26Z2i5p2/5pi+56S65Zmo55WM6Z2i5o+Q56S65peg5rOV?= + =?utf-8?b?6I635Y+W5Lqu5bqm5L+h5oGvIE1lcmdlIHB1bGwgcmVxdWVzdCAhMTE0IGZyb20g?= + =?utf-8?b?6IuP5Zej5YW4L29wZW5reWxpbi9uaWxlLTExMjY=?= + +--- + plugins/system/display/brightnessFrame.cpp | 152 ++++++++++++++++++++++++++++- + plugins/system/display/brightnessFrame.h | 48 ++++++++- + plugins/system/display/usdbrightness.h | 50 ++++++++++ + plugins/system/display/widget.cpp | 109 +++++++++++++++++++-- + plugins/system/display/widget.h | 28 +++++- + 5 files changed, 375 insertions(+), 12 deletions(-) + create mode 100755 plugins/system/display/usdbrightness.h + +diff --git a/plugins/system/display/brightnessFrame.cpp b/plugins/system/display/brightnessFrame.cpp +index efb4b53..919914e 100644 +--- a/plugins/system/display/brightnessFrame.cpp ++++ b/plugins/system/display/brightnessFrame.cpp +@@ -1,3 +1,22 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * Copyright (C) 2019 KylinSoft Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ */ + #include "brightnessFrame.h" + #include <QHBoxLayout> + #include <QtConcurrent> +@@ -7,16 +26,27 @@ + #include <unistd.h> + #include <QDBusReply> + #include <QDBusInterface> ++#include <QDBusMetaType> ++#include <KF5/KScreen/kscreen/edid.h> + #include "ukcccommon.h" ++#include "usdbrightness.h" ++#include "utils.h" + using namespace ukcc; + + #define POWER_SCHMES "org.ukui.power-manager" + #define POWER_KEY "brightness-ac" + #define POWER_KEY_C "brightnessAc" ++#define POWER_KEY_MAX_BG "max-brightness" ++#define GAMMA_FOR_BRIGHTNESS_KEY "gammaforbrightness" ++#define UKUI_CONTORLCENTER_PANEL_SCHEMAS "org.ukui.control-center.panel.plugins" + +-BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, const QString &edidHash, QWidget *parent) ++BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, const QString &edidHash,const KScreen::OutputPtr &output, QWidget *parent) + : UkccFrame(parent, UkccFrame::BorderRadiusStyle::None, false) + { ++ this->setFrameShape(QFrame::Shape::NoFrame); ++ ++ m_powerGSettings = new QGSettings(QByteArray(POWER_SCHMES), QByteArray(), this); ++ + QHBoxLayout *layout = new QHBoxLayout; + layout->setSpacing(6); + layout->setMargin(0); +@@ -59,6 +89,7 @@ BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, con + this->edidHash = edidHash; + this->i2cBus = "-1"; + this->mGetBrightnessThread = nullptr; ++ this->m_output = output; + + labelValue->setText("0"); //最低亮度10,获取前显示为0 + slider->setEnabled(false); //成功连接了再改为true,否则表示无法修改亮度 +@@ -67,7 +98,13 @@ BrightnessFrame::BrightnessFrame(const QString &name, const bool &isBattery, con + } else { + this->setFixedHeight(PC_HEIGHT + 36); + } +- ++ updateBrightness(); ++ QByteArray id(UKUI_CONTORLCENTER_PANEL_SCHEMAS); ++ if (QGSettings::isSchemaInstalled(id)) { ++ m_panelGsettings = new QGSettings(id, QByteArray(), this); ++ } else { ++ qDebug() << Q_FUNC_INFO << "org.ukui.control-center.panel.plugins not install"; ++ } + connect(this, &BrightnessFrame::tabletModeChanged, this, [=](bool isTablet) { + if (isTablet) { + if (labelMsg) { +@@ -111,7 +148,9 @@ void BrightnessFrame::runConnectThread(const bool &openFlag) + { + outputEnable = openFlag; + if (false == isBattery) { +- if (!mGetBrightnessThread) { ++ if (m_brightnessByGamma) { ++ initBrightnessGamma(); ++ } else if (!mGetBrightnessThread) { + mGetBrightnessThread = new GetBrightnessThread(this->edidHash, this->i2cBus); + connect(mGetBrightnessThread, &GetBrightnessThread::finished, this, [=](){ + mGetBrightnessThread->deleteLater(); +@@ -258,3 +297,110 @@ void BrightnessFrame::setI2cbus(QString busNum) + this->i2cBus = busNum; + return; + } ++ ++void BrightnessFrame::setBrightnessByGamma(bool b) ++{ ++ m_brightnessByGamma = b; ++} ++ ++void BrightnessFrame::sliderValueChangeSlot(QString outputName) { ++ m_changedBySlider = true; ++ QDBusMessage msg = m_usdInterface->call("setScreenBrightness", "ukcc", outputName, uint(slider->value())); ++ qDebug() << outputName << "gamma brightness" << " is changed, value = " << slider->value() << msg.type(); ++ setTextLabelValue(QString::number(slider->value())); ++} ++ ++void BrightnessFrame::initBrightnessGamma() ++{ ++ if (!m_usdInterface) { ++ qRegisterMetaType<UsdBrightness>("UsdBrightness"); ++ qDBusRegisterMetaType<UsdBrightness>(); ++ m_usdInterface = new QDBusInterface("org.ukui.SettingsDaemon", ++ "/org/ukui/SettingsDaemon/GammaManager", ++ "org.ukui.SettingsDaemon.GammaManager", ++ QDBusConnection::sessionBus(), ++ this); ++ } ++ if (m_usdInterface->isValid()) { ++ QDBusMessage replyMsg = m_usdInterface->call("getScreensGammaList", qAppName()); ++ if (replyMsg.type() == QDBusMessage::ErrorMessage) { ++ qCritical()<<"call getScreensGammaList error:"<<replyMsg.errorMessage(); ++ } else { ++ QDBusArgument argument = replyMsg.arguments().at(0).value<QDBusArgument>(); ++ UsdBrightnessList list = {}; ++ argument.beginArray(); ++ while (!argument.atEnd()) { ++ UsdBrightness cfg; ++ argument >> cfg; ++ list.push_back(cfg); ++ } ++ argument.endArray(); ++ qDebug() << Q_FUNC_INFO << "getScreensGammaList size" << list.size(); ++ QString outputName = m_output.data()->outputName(); ++ if (!list.isEmpty()) { ++ for (UsdBrightness u : list) { ++ qDebug() << Q_FUNC_INFO << "gamma screenName" << u.screenName << "kscreen outputName" << outputName << "kscreen name" << m_output.data()->name(); ++ if (u.screenName == outputName) { ++ int brightnessValue = u.gammaB; ++ qDebug() << Q_FUNC_INFO << "gamma brightness" << brightnessValue; ++ setTextLabelValue(QString::number(brightnessValue)); ++ slider->blockSignals(true); ++ slider->setValue(brightnessValue); ++ slider->blockSignals(false); ++ setSliderEnable(true); ++ labelMsg->hide(); ++ disconnect(slider,&QSlider::valueChanged,this,0); ++ connect(slider, &QSlider::valueChanged, this, [=, outputName](){ ++ sliderValueChangeSlot(outputName); ++ }); ++ QDBusConnection::sessionBus().disconnect("org.ukui.SettingsDaemon", ++ "/org/ukui/SettingsDaemon/GammaManager", ++ "org.ukui.SettingsDaemon.GammaManager", ++ "screenBrightnessSetSignal", ++ this, ++ SLOT(usdBrightnessSlot(QString, int))); ++ ++ QDBusConnection::sessionBus().connect("org.ukui.SettingsDaemon", ++ "/org/ukui/SettingsDaemon/GammaManager", ++ "org.ukui.SettingsDaemon.GammaManager", ++ "screenBrightnessSetSignal", ++ this, ++ SLOT(usdBrightnessSlot(QString, int))); ++ break; ++ } ++ } ++ } ++ } ++ } else { ++ qCritical() << "interface org.ukui.SettingsDaemon error:" << m_usdInterface->lastError(); ++ } ++} ++ ++void BrightnessFrame::usdBrightnessSlot(QString name, int brightness) ++{ ++ qDebug() << "gamma screenName" << name << "gamma brightness" << brightness << m_output.data()->outputName(); ++ if (name == m_output.data()->outputName() && !m_changedBySlider) { ++ setTextLabelValue(QString::number(brightness)); ++ slider->blockSignals(true); ++ slider->setValue(brightness); ++ slider->blockSignals(false); ++ } ++ m_changedBySlider = false; ++} ++ ++int BrightnessFrame::getMaxBrightnessAC() ++{ ++ int maxBrightness = -1; ++ if (m_powerGSettings->keys().contains("maxBrightness") && isBattery) { ++ maxBrightness = m_powerGSettings->get(POWER_KEY_MAX_BG).toInt(); ++ } ++ return ((maxBrightness <= 100 && maxBrightness >=0) ? maxBrightness : -1); ++} ++ ++void BrightnessFrame::updateBrightness() ++{ ++ int maxBrightness = getMaxBrightnessAC(); ++ if ((maxBrightness != -1) && isBattery) { ++ slider->setRange(0, maxBrightness); ++ } ++} +diff --git a/plugins/system/display/brightnessFrame.h b/plugins/system/display/brightnessFrame.h +index 89ab081..5fa8c27 100644 +--- a/plugins/system/display/brightnessFrame.h ++++ b/plugins/system/display/brightnessFrame.h +@@ -1,3 +1,22 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * Copyright (C) 2019 KylinSoft Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ */ + #ifndef BRIGHTNESSFRAME_H + #define BRIGHTNESSFRAME_H + +@@ -8,18 +27,27 @@ + #include "uslider.h" + #include <QMutex> + #include <QFuture> ++#include <QDBusInterface> ++#include <QDBusArgument> ++#include <QGSettings> ++#include <kslider.h> ++#include <KF5/KScreen/kscreen/output.h> ++#include <KF5/KScreen/kscreen/types.h> + #include "fixlabel.h" + #include "getBrightnessThread.h" + #include "ukccframe.h" + #include "lightlabel.h" + #include <kslider.h> ++#include "ukcccommon.h" ++ ++using namespace ukcc; + using namespace kdk; + + class BrightnessFrame : public UkccFrame + { + Q_OBJECT + public: +- BrightnessFrame(const QString &name, const bool &isBattery, const QString &edidHash = "", QWidget *parent = nullptr); ++ BrightnessFrame(const QString &name, const bool &isBattery, const QString &edidHash = "", const KScreen::OutputPtr &output = nullptr, QWidget *parent = nullptr); + ~BrightnessFrame(); + void setTextLabelName(QString text); + void setTextLabelValue(QString text); +@@ -33,9 +61,20 @@ public: + QString getEdidHash(); + QString getOutputName(); + void setI2cbus(QString busNum); ++ void setBrightnessByGamma(bool b); ++ void initBrightnessGamma(); + + Q_SIGNALS: + void sliderEnableChanged(); ++ void brightnessChanged(KScreen::OutputPtr output, int value); ++ ++public Q_SLOTS: ++ void usdBrightnessSlot(QString name, int brightness); ++ ++private: ++ int getMaxBrightnessAC(); ++ void updateBrightness(); ++ void sliderValueChangeSlot(QString outputName); + + private: + FixLabel *labelName = nullptr; +@@ -51,6 +90,13 @@ private: + LightLabel *labelMsg = nullptr; + QString i2cBus; + GetBrightnessThread *mGetBrightnessThread; ++ bool m_brightnessByGamma = false; ++ QDBusInterface *m_usdInterface = nullptr; ++ bool m_changedBySlider = false; ++ KScreen::OutputPtr m_output; ++ ++ QGSettings* m_powerGSettings = nullptr; ++ QGSettings* m_panelGsettings = nullptr; + }; + + #endif // BRIGHTNESSFRAME_H +diff --git a/plugins/system/display/usdbrightness.h b/plugins/system/display/usdbrightness.h +new file mode 100755 +index 0000000..29c4f13 +--- /dev/null ++++ b/plugins/system/display/usdbrightness.h +@@ -0,0 +1,50 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * Copyright (C) 2024 KylinSoft Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ */ ++ ++#ifndef USDBRIGHTNESS_H ++#define USDBRIGHTNESS_H ++ ++#include <QDBusArgument> ++ ++typedef struct usdBrightness { ++ QString screenName; ++ int gammaA; ++ int gammaB; ++ int gammaC; ++} UsdBrightness; ++ ++QDBusArgument &operator<<(QDBusArgument &argument, const UsdBrightness &mystruct) { ++ argument.beginStructure(); ++ argument << mystruct.screenName << mystruct.gammaA << mystruct.gammaB << mystruct.gammaC; ++ argument.endStructure(); ++ return argument; ++} ++ ++const QDBusArgument &operator>>(const QDBusArgument &argument, UsdBrightness &mystruct) { ++ argument.beginStructure(); ++ argument >> mystruct.screenName >> mystruct.gammaA >> mystruct.gammaB >> mystruct.gammaC; ++ argument.endStructure(); ++ return argument; ++} ++Q_DECLARE_METATYPE(UsdBrightness) ++ ++typedef QList<UsdBrightness> UsdBrightnessList; ++ ++#endif // USDBRIGHTNESS_H +diff --git a/plugins/system/display/widget.cpp b/plugins/system/display/widget.cpp +index e72b59f..d14c753 100644 +--- a/plugins/system/display/widget.cpp ++++ b/plugins/system/display/widget.cpp +@@ -1,4 +1,23 @@ +-#include "widget.h" ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * Copyright (C) 2019 KylinSoft Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ */ ++#include "widget.h" + #include "controlpanel.h" + #include "declarative/qmloutput.h" + #include "declarative/qmlscreen.h" +@@ -693,6 +712,13 @@ void Widget::writeScale(double scale) + + void Widget::initGSettings() + { ++ QByteArray id(UKUI_CONTORLCENTER_PANEL_SCHEMAS); ++ if (QGSettings::isSchemaInstalled(id)) { ++ m_gsettings = new QGSettings(id, QByteArray(), this); ++ } else { ++ qDebug() << Q_FUNC_INFO << "org.ukui.control-center.panel.plugins not install"; ++ } ++ + QByteArray nightId(SETTINGS_DAEMON_COLOR_SCHEMAS); + if(QGSettings::isSchemaInstalled(nightId)) { + m_colorSettings = new QGSettings(nightId); +@@ -902,6 +928,22 @@ bool Widget::isBacklight() + return reply.value().toBool(); + } + ++bool Widget::isPanguX() ++{ ++ QDBusInterface ukccIfc("com.control.center.qt.systemdbus", ++ "/", ++ "com.control.center.interface", ++ QDBusConnection::systemBus()); ++ ++ QDBusReply<QString> reply; ++ reply = ukccIfc.call("getDmiDecodeRes", "-t baseboard"); ++ qDebug() << Q_FUNC_INFO << reply.value(); ++ if (reply.value().contains("SP1PANGUXM")) { ++ return true; ++ } ++ return false; ++} ++ + QString Widget::getMonitorType() + { + QString monitor = monitorComboBox->currentText(); +@@ -1085,7 +1127,7 @@ void Widget::clearOutputIdentifiers() + mOutputIdentifiers.clear(); + } + +-void Widget::addBrightnessFrame(QString name, bool openFlag, QString edidHash) ++void Widget::addBrightnessFrame(QString name, bool openFlag, QString edidHash, const KScreen::OutputPtr &output) + { + #ifdef BUILD_FOR_NO_BRIGHTNESS + if (!mIsBattery) { +@@ -1093,8 +1135,18 @@ void Widget::addBrightnessFrame(QString name, bool openFlag, QString edidHash) + } + #endif + +- if ((mIsBattery && name != firstAddOutputName) || (UkccCommon::getProductName().startsWith("MT") && !mIsBattery)) //笔记本非内置 ++ if (m_isPanguX || (!m_isSupportGM && !mIsBattery)) { ++ qDebug() << Q_FUNC_INFO << m_isPanguX << !m_isSupportGM; + return; ++ } ++ ++ qDebug() << Q_FUNC_INFO << mIsBattery << name << firstAddOutputName << openFlag << edidHash << m_isSetGM; ++ // bug#189369 ++ QString productName = UkccCommon::getProductName(); ++ if ((mIsBattery && name != firstAddOutputName) || ++ (productName != "MT401" && productName.startsWith("MT") && !mIsBattery)) { //笔记本非内置 ++ return; ++ } + + if (mIsBattery) { //移除之前的亮度条,适用于kscreen返回当前为笔记本屏幕,但之前已经把第一个屏幕当做笔记本屏幕的情况 + for (int i = 0; i < BrightnessFrameV.size(); i = 0) { +@@ -1117,9 +1169,9 @@ void Widget::addBrightnessFrame(QString name, bool openFlag, QString edidHash) + } + BrightnessFrame *frame = nullptr; + if (mIsBattery && name == firstAddOutputName) { +- frame = new BrightnessFrame(name, true); ++ frame = new BrightnessFrame(name, true, "", output); + } else if(!mIsBattery) { +- frame = new BrightnessFrame(name, false, edidHash); ++ frame = new BrightnessFrame(name, false, edidHash, output); + if (edidI2CbusMap.isEmpty()) { + for (QMap<QString, QString>::const_iterator it = I2CbusMap.constBegin(); it != I2CbusMap.constEnd(); ++it) { + if (name.contains(it.key(), Qt::CaseInsensitive)) { +@@ -1136,6 +1188,7 @@ void Widget::addBrightnessFrame(QString name, bool openFlag, QString edidHash) + } + } + } ++ frame->setBrightnessByGamma(true); // openkylin默认使用gamma进行亮度调节,笔记本使用电源gsetting进行调节 + if (frame != nullptr) { + connect(frame, &BrightnessFrame::sliderEnableChanged, this, [=](){ + showBrightnessFrame(); +@@ -1187,7 +1240,7 @@ void Widget::outputAdded(const KScreen::OutputPtr &output, bool connectChanged) + QString edidHash = QString::fromLatin1(hash.result().toHex()); + QString name = Utils::outputName(output); + qInfo() << "output:" << name << "edidHash:" << edidHash; +- addBrightnessFrame(name, output->isEnabled(), edidHash); ++ addBrightnessFrame(name, output->isEnabled(), edidHash, output); + connectedOutputNum++; + checkSpliceFeasibility(); + } +@@ -2136,6 +2189,10 @@ void Widget::initUiComponent() + + mIsBattery = isBacklight(); + ++ m_isPanguX = isPanguX(); ++ m_isSetGM = isSetGammaBrightness(); ++ m_isSupportGM = isSupoortGammaBrighnes(); ++ + mUPowerInterface = QSharedPointer<QDBusInterface>( + new QDBusInterface("org.freedesktop.UPower", + "/org/freedesktop/UPower", +@@ -2619,7 +2676,45 @@ void Widget::getEdidI2Cbus() + } + } + } +- qInfo() << "edidI2CbusMap:"<<edidI2CbusMap; ++ qDebug() << "edidI2CbusMap:"<<edidI2CbusMap; ++} ++ ++bool Widget::isSetGammaBrightness() ++{ ++ QDBusInterface upower("org.ukui.powermanagement", ++ "/", ++ "org.ukui.powermanagement.interface", ++ QDBusConnection::systemBus()); ++ if (!upower.isValid()) { ++ qDebug() << "Create UPower Interface Failed : " << QDBusConnection::systemBus().lastError(); ++ return false; ++ } ++ QDBusReply<bool> reply = upower.call("CanSetBrightness"); ++ qDebug() << Q_FUNC_INFO << reply.value() << reply.isValid() << mMachineType; ++ if ((!reply.value() && (mMachineType == "all in one")) ++ || (m_gsettings->keys().contains("gammaforbrightness") && m_gsettings->get("gammaforbrightness").toBool()) ++ || (!UkccCommon::getProductName().compare("VAH510"))) { ++ return true; ++ } ++ return false; ++} ++ ++bool Widget::isSupoortGammaBrighnes() ++{ ++ QDBusInterface usdGlobalSignal("org.ukui.SettingsDaemon", ++ "/GlobalSignal", ++ "org.ukui.SettingsDaemon.GlobalSignal", ++ QDBusConnection::sessionBus()); ++ if (usdGlobalSignal.isValid()) { ++ QDBusReply<bool> gamma = usdGlobalSignal.call("isSupportGamma"); ++ qDebug() << Q_FUNC_INFO << gamma.isValid() << gamma.error().type(); ++ if (!gamma.isValid() || (gamma.error().type() == QDBusError::ErrorType::UnknownMethod)) { ++ return true; ++ } else { ++ return gamma.value(); ++ } ++ } ++ return true; + } + + bool Widget::checkSpliceFeasibility() +diff --git a/plugins/system/display/widget.h b/plugins/system/display/widget.h +index 283644c..d43e1a1 100644 +--- a/plugins/system/display/widget.h ++++ b/plugins/system/display/widget.h +@@ -1,3 +1,22 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * Copyright (C) 2019 KylinSoft Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ */ + #ifndef WIDGET_H + #define WIDGET_H + +@@ -109,7 +128,7 @@ public: + + void initUiComponent(); + void hideComponent(); +- void addBrightnessFrame(QString name, bool openFlag, QString edidHash); ++ void addBrightnessFrame(QString name, bool openFlag, QString edidHash, const KScreen::OutputPtr &output); + void showBrightnessFrame(const int flag = 0); + + QList<ScreenConfig> getPreScreenCfg(); +@@ -194,9 +213,12 @@ private: + bool isRestoreConfig(); + bool isCloneMode(); + bool isBacklight(); ++ bool isPanguX(); + bool isBacklightAllInOne(); + bool isLaptopScreen(); + bool isVisibleBrightness(); ++ bool isSetGammaBrightness(); ++ bool isSupoortGammaBrighnes(); + + QString getCpuInfo(); + QString getMonitorType(); +@@ -268,6 +290,7 @@ private: + QGSettings *m_colorSettings = nullptr; + QGSettings *mAutoBrightSettings = nullptr; + ++ QGSettings* m_gsettings = nullptr; + QSettings *mQsettings = nullptr; + + QButtonGroup *singleButton; +@@ -303,6 +326,9 @@ private: + bool exitFlag = false; + bool unifySetconfig = false; + bool mIscloneMode = false; ++ bool m_isPanguX = false; ++ bool m_isSetGM = false; ++ bool m_isSupportGM = false; + bool mIsEyeCareMode = false; + + QStringList mTimeModeStringList; Binary files /tmp/tmp1hmvpp67/duLIK7uEMQ/ukui-control-center-4.10.0.0/debian/patches/0103-118-291281.patch and /tmp/tmp1hmvpp67/lxnzdyeDcf/ukui-control-center-4.10.0.0/debian/patches/0103-118-291281.patch differ diff -Nru ukui-control-center-4.10.0.0/debian/patches/0104-120-380937-2024-OEM-v11-2501.patch ukui-control-center-4.10.0.0/debian/patches/0104-120-380937-2024-OEM-v11-2501.patch --- ukui-control-center-4.10.0.0/debian/patches/0104-120-380937-2024-OEM-v11-2501.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0104-120-380937-2024-OEM-v11-2501.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,793 @@ +From: nil <zhoubin@kylinos.cn> +Date: Tue, 24 Dec 2024 01:23:31 +0000 +Subject: =?utf-8?b?ITEyMCAzODA5Mzcg5a2QIOOAkDIwMjTjgJHln7rnoYDnu4Tku7bnu4Q=?= + =?utf-8?b?5ZGo5L6L5Lya5b6F5YqeJuW5s+aXtuS7u+WKoSZPRU3kuLTml7bku7vliqEgLyA=?= + =?utf-8?b?44CQdjExLTI1MDHjgJHljZXlhYPmtYvor5Ug5o6n5Yi26Z2i5p2/IOW8gOWPkSBN?= + =?utf-8?b?ZXJnZSBwdWxsIHJlcXVlc3QgITEyMCBmcm9tIOiLj+WXo+WFuC9vcGVua3lsaW4v?= + =?utf-8?b?bmlsZS0xMjEw?= + +--- + plugins/personalized/wallpaper/wallpaper.cpp | 57 +++++++++ + .../plugins/shortcut/shortcutinterface.cpp | 19 +-- + .../plugins/shortcut/shortcutinterface.h | 2 + + .../plugins/wallpaper/workerobject.cpp | 14 +-- + registeredSession/plugins/wallpaper/workerobject.h | 1 - + .../unit_test_screenlock/unit_test_screenlock.cpp | 53 ++++---- + .../unit_test_screensaver.cpp | 136 ++++++++------------- + tests/unit_test_shortcut/unit_test_shortcut.cpp | 62 +++++----- + tests/unit_test_wallpaper/main.cpp | 2 - + tests/unit_test_wallpaper/unit_test_wallpaper.cpp | 95 ++++++++------ + tests/unit_test_wallpaper/unit_test_wallpaper.pro | 1 + + 11 files changed, 228 insertions(+), 214 deletions(-) + +diff --git a/plugins/personalized/wallpaper/wallpaper.cpp b/plugins/personalized/wallpaper/wallpaper.cpp +index 25f6fb7..a07ddcf 100644 +--- a/plugins/personalized/wallpaper/wallpaper.cpp ++++ b/plugins/personalized/wallpaper/wallpaper.cpp +@@ -24,6 +24,23 @@ + #include <QProcess> + #include <QFileSystemWatcher> + #include <QtConcurrent/QtConcurrent> ++#include <QObject> ++#include <QPixmap> ++ ++#include "xmlhandle.h" ++#include <QStandardPaths> ++#include <QtXml> ++#include <QThread> ++#include <kysdk/applications/accessinfohelper.h> ++ ++ ++#define LOCAL_USR_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) ++#define LOCAL_APP_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ ++ %QStringLiteral("/ukui-control-center/") ++#define LOCAL_WALLPAPER_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ ++ %QStringLiteral("/ukui-control-center/wallpaperData/") ++#define LOCAL_WALLPAPER_HASH_PATH QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)\ ++ %QStringLiteral("/ukui-control-center/wallpaperData/HASH") + + Wallpaper::Wallpaper() + : mFirstLoad(true) +@@ -68,6 +85,46 @@ void Wallpaper::preInitialize() { + return; + } + picInfoList.clear(); ++ ++ QSize IMAGE_SIZE(166, 110); ++ int num = 0; ++ QDir dir(LOCAL_WALLPAPER_PATH); ++ QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Dirs); ++ ++ qDebug() << Q_FUNC_INFO << "wallpaper path" << LOCAL_WALLPAPER_PATH << (fileInfoList.size() - 1) << sourcePictures.size(); ++ if ((fileInfoList.size() - 1) == sourcePictures.size()) { ++ qDebug() << Q_FUNC_INFO << "equal file num, skip load"; ++ picInfoList.clear(); ++ for (int i = 0; i < previewPictures.size(); ++i) { ++ PictureInfo* pictureInfo = new PictureInfo(); ++ if (pictureInfo == nullptr) ++ continue; ++ pictureInfo->pixmap.load(previewPictures.at(i)); ++ pictureInfo->fileName = sourcePictures.at(i); ++ picInfoList.append(pictureInfo); ++ } ++ return; ++ } ++ for (QString filename : sourcePictures) { ++ QPixmap qPixmap = QPixmap(filename); ++ if (qPixmap.isNull()){ ++ QFile file(filename); ++ qint64 fileSize = file.size(); ++ if (fileSize <= 100000000 && file.open(QIODevice::ReadOnly)){ ++ qPixmap.loadFromData(file.readAll()); ++ file.close(); ++ } ++ } ++ QPixmap pixmap = qPixmap.scaled(IMAGE_SIZE); ++ ++ QFile wallpaperFile; ++ filename.replace("/", "-"); ++ wallpaperFile.setFileName(LOCAL_WALLPAPER_PATH + QString::number(num) + filename); ++ QFileInfo fileinfo = QFileInfo(filename); ++ pixmap.save(&wallpaperFile, fileinfo.suffix().toUtf8().data()); ++ num++; ++ } ++ picInfoList.clear(); + for (int i = 0; i < previewPictures.size(); ++i) { + PictureInfo* pictureInfo = new PictureInfo(); + if (pictureInfo == nullptr) +diff --git a/registeredSession/plugins/shortcut/shortcutinterface.cpp b/registeredSession/plugins/shortcut/shortcutinterface.cpp +index c3e0c8b..8febb69 100644 +--- a/registeredSession/plugins/shortcut/shortcutinterface.cpp ++++ b/registeredSession/plugins/shortcut/shortcutinterface.cpp +@@ -23,12 +23,12 @@ ShortcutInterface::~ShortcutInterface() + + void ShortcutInterface::getShortcutThread() + { +- GetShortcutWorker *toGetShortcutThread = new GetShortcutWorker(this); ++ m_toGetShortcutThread = new GetShortcutWorker(this); + systemEntries.clear(); + customEntries.clear(); + systemShortcutList.clear(); + customShortcutList.clear(); +- connect(toGetShortcutThread, &GetShortcutWorker::generalShortcutGenerate, this, ++ connect(m_toGetShortcutThread, &GetShortcutWorker::generalShortcutGenerate, this, + [=](QString schema, QString key, QString value){ + KeyEntry generalKeyEntry; + generalKeyEntry.gsSchema = schema; +@@ -37,7 +37,7 @@ void ShortcutInterface::getShortcutThread() + systemEntries.append(generalKeyEntry); + }); + +- connect(toGetShortcutThread, &GetShortcutWorker::customShortcutGenerate, this, ++ connect(m_toGetShortcutThread, &GetShortcutWorker::customShortcutGenerate, this, + [=](QString path, QString name, QString binding, QString action){ + KeyEntry customKeyEntry; + customKeyEntry.gsSchema = KEYBINDINGS_CUSTOM_SCHEMA; +@@ -48,7 +48,7 @@ void ShortcutInterface::getShortcutThread() + customEntries.append(customKeyEntry); + }); + +- connect(toGetShortcutThread, &GetShortcutWorker::workerComplete, this, [=]() { ++ connect(m_toGetShortcutThread, &GetShortcutWorker::workerComplete, this, [=]() { + QMap<QString, QString> systemMap; + QMap<QString, QString> desktopMap; + // 最新快捷键数据 +@@ -79,10 +79,15 @@ void ShortcutInterface::getShortcutThread() + } + }); + +- connect(toGetShortcutThread, &GetShortcutWorker::finished, this, [=](){ +- toGetShortcutThread->deleteLater(); ++ connect(m_toGetShortcutThread, &GetShortcutWorker::finished, this, [=](){ ++ m_toGetShortcutThread->deleteLater(); + }); +- toGetShortcutThread->start(); ++ m_toGetShortcutThread->start(); ++} ++ ++void ShortcutInterface::getThreadStart() ++{ ++ return m_toGetShortcutThread->run(); + } + + QList<KeyEntry> ShortcutInterface::getSystemShortcutEntry() +diff --git a/registeredSession/plugins/shortcut/shortcutinterface.h b/registeredSession/plugins/shortcut/shortcutinterface.h +index 5e16026..cb80cdc 100644 +--- a/registeredSession/plugins/shortcut/shortcutinterface.h ++++ b/registeredSession/plugins/shortcut/shortcutinterface.h +@@ -16,6 +16,7 @@ class ShortcutInterface : public QObject + public: + ShortcutInterface(); + ~ShortcutInterface(); ++ void getThreadStart(); + + public Q_SLOTS: + QList<QStringPair> getSystemShortcut(); +@@ -31,6 +32,7 @@ private: + QList<KeyEntry> customEntries; + QList<QStringPair> systemShortcutList; + QList<QStringPair> customShortcutList; ++ GetShortcutWorker *m_toGetShortcutThread = nullptr; + + private: + void getShortcutThread(); +diff --git a/registeredSession/plugins/wallpaper/workerobject.cpp b/registeredSession/plugins/wallpaper/workerobject.cpp +index 4471404..75cd939 100644 +--- a/registeredSession/plugins/wallpaper/workerobject.cpp ++++ b/registeredSession/plugins/wallpaper/workerobject.cpp +@@ -1,6 +1,7 @@ + /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * +- * Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd. ++ * Copyright (C) 2019 KylinSoft Co., Ltd. ++ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -110,17 +111,6 @@ void WorkerObject::run(){ + + if (dir.mkpath(LOCAL_WALLPAPER_PATH)) { + qDebug()<<"mkpath:"<<LOCAL_WALLPAPER_PATH<<" success."; +- int num = 0; //确保显示顺序与xml中的一致 +- //写图片 +- for (QString filename : filenameList) { +- QPixmap pixmap = QPixmap(filename).scaled(IMAGE_SIZE); +- QFile wallpaperFile; +- filename.replace("/","-"); +- wallpaperFile.setFileName(LOCAL_WALLPAPER_PATH + QString::number(num) + filename); +- QFileInfo fileinfo = QFileInfo(filename); +- pixmap.save(&wallpaperFile, fileinfo.suffix().toUtf8().data()); +- num++; +- } + //写hash + if (hashFile.open(QIODevice::WriteOnly)) { + hashFile.write(hashDataWrite); +diff --git a/registeredSession/plugins/wallpaper/workerobject.h b/registeredSession/plugins/wallpaper/workerobject.h +index 5fd9be5..0f1896c 100644 +--- a/registeredSession/plugins/wallpaper/workerobject.h ++++ b/registeredSession/plugins/wallpaper/workerobject.h +@@ -21,7 +21,6 @@ + #define WORKEROBJECT_H + + #include <QObject> +-#include <QPixmap> + + #include "xmlhandle.h" + #include <QStandardPaths> +diff --git a/tests/unit_test_screenlock/unit_test_screenlock.cpp b/tests/unit_test_screenlock/unit_test_screenlock.cpp +index 907e6c5..c2bcee4 100644 +--- a/tests/unit_test_screenlock/unit_test_screenlock.cpp ++++ b/tests/unit_test_screenlock/unit_test_screenlock.cpp +@@ -19,11 +19,8 @@ + */ + #include <gtest/gtest.h> + #include <gtest/gtest-death-test.h> +-#include <QDBusReply> + #include "../../registeredSession/plugins/screenlock/screenlockinterface.h" +-#include "stubext.h" + +-using namespace stub_ext; + + class ScreenlockInterfaceTest : public testing::Test + { +@@ -31,61 +28,55 @@ protected: + static void SetUpTestSuite() + { + m_pScreenlockInterface = new ScreenlockInterface(); +- m_pScreenlockDbus = new QDBusInterface("org.ukui.ukcc.session", +- "/Screenlock", +- "org.ukui.ukcc.session.Screenlock", +- QDBusConnection::sessionBus()); + } + + static void TearDownTestSuite() + { +- if (m_pScreenlockDbus) { +- delete m_pScreenlockDbus; +- m_pScreenlockDbus = nullptr; +- } + } + + static ScreenlockInterface *m_pScreenlockInterface; +- static QDBusInterface* m_pScreenlockDbus; + }; + + ScreenlockInterface *ScreenlockInterfaceTest::m_pScreenlockInterface = nullptr; +-QDBusInterface *ScreenlockInterfaceTest::m_pScreenlockDbus = nullptr; + + TEST_F(ScreenlockInterfaceTest, setShowOnLogin) + { +- if (!m_pScreenlockDbus || !m_pScreenlockDbus->isValid()) { +- return; +- } +- bool oldValue = m_pScreenlockDbus->property("showOnLogin").toBool(); +- m_pScreenlockDbus->call("setShowOnLogin", false); +- bool newValue = m_pScreenlockDbus->property("showOnLogin").toBool(); ++ bool oldValue = m_pScreenlockInterface->property("showOnLogin").toBool(); ++ m_pScreenlockInterface->setShowOnLogin(false); ++ bool newValue = m_pScreenlockInterface->property("showOnLogin").toBool(); + ASSERT_EQ(newValue, false); +- m_pScreenlockDbus->call("setShowOnLogin", oldValue); ++ m_pScreenlockInterface->setShowOnLogin(oldValue); + } + + TEST_F(ScreenlockInterfaceTest, setWallpaper) + { +- if (!m_pScreenlockDbus || !m_pScreenlockDbus->isValid()) { +- return; +- } + QGSettings gset("org.ukui.screensaver"); + std::string oldValue = gset.get("background").toString().toStdString(); +- m_pScreenlockDbus->call("setWallpaper", "/usr/share/backgrounds/city.jpg"); ++ m_pScreenlockInterface->setWallpaper("/usr/share/backgrounds/city.jpg"); + std::string newValue = gset.get("background").toString().toStdString(); + ASSERT_STREQ(newValue.c_str(), "/usr/share/backgrounds/city.jpg"); +- m_pScreenlockDbus->call("setWallpaper", oldValue.c_str()); ++ m_pScreenlockInterface->setWallpaper(oldValue.c_str()); + } + + TEST_F(ScreenlockInterfaceTest, resetDefault) + { +- if (!m_pScreenlockDbus || !m_pScreenlockDbus->isValid()) { +- return; +- } + QGSettings gset("org.ukui.screensaver"); + std::string oldValue = gset.get("background").toString().toStdString(); +- m_pScreenlockDbus->call("resetDefault"); ++ m_pScreenlockInterface->resetDefault(); + std::string newValue = gset.get("background").toString().toStdString(); +- ASSERT_STREQ(newValue.c_str(), "/usr/share/backgrounds/1-warty-final-ubuntukylin.jpg"); +- m_pScreenlockDbus->call("setWallpaper", oldValue.c_str()); ++ ASSERT_STREQ(newValue.c_str(), "/usr/share/backgrounds/1-openkylin.jpg"); ++ m_pScreenlockInterface->setWallpaper(oldValue.c_str()); ++} ++ ++ ++TEST_F(ScreenlockInterfaceTest, getPreviewWallpapers) ++{ ++ int size = m_pScreenlockInterface->getPreviewWallpapers().size(); ++ ASSERT_GE(size, 0); ++} ++ ++TEST_F(ScreenlockInterfaceTest, getSourceWallpapers) ++{ ++ int size = m_pScreenlockInterface->getSourceWallpapers().size(); ++ ASSERT_GE(size, 0); + } +diff --git a/tests/unit_test_screensaver/unit_test_screensaver.cpp b/tests/unit_test_screensaver/unit_test_screensaver.cpp +index 9fb71b7..9e9ed58 100644 +--- a/tests/unit_test_screensaver/unit_test_screensaver.cpp ++++ b/tests/unit_test_screensaver/unit_test_screensaver.cpp +@@ -19,155 +19,117 @@ + */ + #include <gtest/gtest.h> + #include <gtest/gtest-death-test.h> +-#include <QDBusReply> + #include "../../registeredSession/plugins/screensaver/screensaverinterface.h" +-#include "stubext.h" +- +-using namespace stub_ext; + + class ScreensaverInterfaceTest : public testing::Test + { + protected: + static void SetUpTestSuite() + { +- m_pScreensaverDbus = new QDBusInterface("org.ukui.ukcc.session", +- "/Screensaver", +- "org.ukui.ukcc.session.Screensaver", +- QDBusConnection::sessionBus()); ++ m_pScreenSaverInterface = new ScreensaverInterface(); + } + + static void TearDownTestSuite() + { +- if (m_pScreensaverDbus) { +- delete m_pScreensaverDbus; +- m_pScreensaverDbus = nullptr; +- } ++ if (m_pScreenSaverInterface) { ++ delete m_pScreenSaverInterface; ++ m_pScreenSaverInterface = nullptr; ++ } + } + +- static QDBusInterface* m_pScreensaverDbus; ++ static ScreensaverInterface* m_pScreenSaverInterface; + }; + +-QDBusInterface *ScreensaverInterfaceTest::m_pScreensaverDbus = nullptr; ++ScreensaverInterface *ScreensaverInterfaceTest::m_pScreenSaverInterface = nullptr; + + TEST_F(ScreensaverInterfaceTest, setPreentryTime) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- int oldValue = m_pScreensaverDbus->property("preentryTime").toInt(); +- m_pScreensaverDbus->call("setPreentryTime", 10); +- int newValue = m_pScreensaverDbus->property("preentryTime").toInt(); ++ int oldValue = m_pScreenSaverInterface->property("preentryTime").toInt(); ++ m_pScreenSaverInterface->setPreentryTime(10); ++ int newValue = m_pScreenSaverInterface->property("preentryTime").toInt(); + ASSERT_EQ(newValue, 10); +- m_pScreensaverDbus->call("setPreentryTime", oldValue); ++ m_pScreenSaverInterface->setPreentryTime(oldValue); + } + + TEST_F(ScreensaverInterfaceTest, setScreensaverType) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- QGSettings gset("org.ukui.screensaver"); +- std::string oldValue = m_pScreensaverDbus->property("screensaverType").toString().toStdString(); +- m_pScreensaverDbus->call("setScreensaverType", "ukui"); +- std::string newValue = m_pScreensaverDbus->property("screensaverType").toString().toStdString(); ++ QGSettings gsetting("org.ukui.screensaver"); ++ std::string oldValue = m_pScreenSaverInterface->property("screensaverType").toString().toStdString(); ++ m_pScreenSaverInterface->setScreensaverType("ukui"); ++ std::string newValue = gsetting.get("mode").toString().toStdString(); + +- ASSERT_STREQ(newValue.c_str(), "ukui"); +- m_pScreensaverDbus->call("setScreensaverType", oldValue.c_str()); ++ ASSERT_STREQ(newValue.c_str(), "default-ukui"); ++ m_pScreenSaverInterface->setScreensaverType(oldValue.c_str()); + } + + TEST_F(ScreensaverInterfaceTest, setShowBreakTimeUkuiCustom) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- bool oldValue = m_pScreensaverDbus->property("showBreakTimeCustom").toBool(); +- m_pScreensaverDbus->call("getShowBreakTimeCustom", true); +- bool newValue = m_pScreensaverDbus->property("showBreakTimeCustom").toBool(); ++ bool oldValue = m_pScreenSaverInterface->property("showBreakTimeCustom").toBool(); ++ m_pScreenSaverInterface->setShowBreakTimeCustom(true); ++ bool newValue = m_pScreenSaverInterface->property("showBreakTimeCustom").toBool(); + ASSERT_EQ(newValue, true); +- m_pScreensaverDbus->call("getShowBreakTimeCustom", oldValue); ++ m_pScreenSaverInterface->setShowBreakTimeCustom(oldValue); + } + + TEST_F(ScreensaverInterfaceTest, setShowBreakTimeUkui) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- bool oldValue = m_pScreensaverDbus->property("showBreakTimeUkui").toBool(); +- m_pScreensaverDbus->call("setShowBreakTimeUkui", false); +- bool newValue = m_pScreensaverDbus->property("showBreakTimeUkui").toBool(); ++ bool oldValue = m_pScreenSaverInterface->property("showBreakTimeUkui").toBool(); ++ m_pScreenSaverInterface->setShowBreakTimeUkui(false); ++ bool newValue = m_pScreenSaverInterface->property("showBreakTimeUkui").toBool(); + ASSERT_EQ(newValue, false); +- m_pScreensaverDbus->call("setShowBreakTimeUkui", oldValue); ++ m_pScreenSaverInterface->setShowBreakTimeUkui(oldValue); + } + + TEST_F(ScreensaverInterfaceTest, setScreenLockEnabled) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- bool oldValue = m_pScreensaverDbus->property("screenLockEnabled").toBool(); +- m_pScreensaverDbus->call("setScreenLockEnabled", false); +- bool newValue = m_pScreensaverDbus->property("screenLockEnabled").toBool(); ++ bool oldValue = m_pScreenSaverInterface->property("screenLockEnabled").toBool(); ++ m_pScreenSaverInterface->setScreenLockEnabled(false); ++ bool newValue = m_pScreenSaverInterface->property("screenLockEnabled").toBool(); + ASSERT_EQ(newValue, false); +- m_pScreensaverDbus->call("setScreenLockEnabled", oldValue); ++ m_pScreenSaverInterface->setScreenLockEnabled(oldValue); + } + + TEST_F(ScreensaverInterfaceTest, setCustomPath) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- std::string oldValue = m_pScreensaverDbus->property("customPath").toString().toStdString(); +- m_pScreensaverDbus->call("setCustomPath", "/test/path"); +- std::string newValue = m_pScreensaverDbus->property("customPath").toString().toStdString(); ++ std::string oldValue = m_pScreenSaverInterface->property("customPath").toString().toStdString(); ++ m_pScreenSaverInterface->setCustomPath("/test/path"); ++ std::string newValue = m_pScreenSaverInterface->property("customPath").toString().toStdString(); + ASSERT_STREQ(newValue.c_str(), "/test/path"); +- m_pScreensaverDbus->call("setCustomPath", oldValue.c_str()); ++ m_pScreenSaverInterface->setCustomPath(oldValue.c_str()); + } + + TEST_F(ScreensaverInterfaceTest, setSwitchRandom) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- bool oldValue = m_pScreensaverDbus->property("switchRandom").toBool(); +- m_pScreensaverDbus->call("setSwitchRandom", false); +- bool newValue = m_pScreensaverDbus->property("switchRandom").toBool(); ++ bool oldValue = m_pScreenSaverInterface->property("switchRandom").toBool(); ++ m_pScreenSaverInterface->setSwitchRandom(false); ++ bool newValue = m_pScreenSaverInterface->property("switchRandom").toBool(); + ASSERT_EQ(newValue, false); +- m_pScreensaverDbus->call("setSwitchRandom", oldValue); ++ m_pScreenSaverInterface->setSwitchRandom(oldValue); + } + + TEST_F(ScreensaverInterfaceTest, setCycleTime) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- int oldValue = m_pScreensaverDbus->property("cycleTime").toInt(); +- m_pScreensaverDbus->call("setCycleTime", 60); +- int newValue = m_pScreensaverDbus->property("cycleTime").toInt(); ++ int oldValue = m_pScreenSaverInterface->property("cycleTime").toInt(); ++ m_pScreenSaverInterface->setCycleTime(60); ++ int newValue = m_pScreenSaverInterface->property("cycleTime").toInt(); + ASSERT_EQ(newValue, 60); +- m_pScreensaverDbus->call("setCycleTime", oldValue); ++ m_pScreenSaverInterface->setCycleTime(oldValue); + } + +- + TEST_F(ScreensaverInterfaceTest, setCustomText) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- std::string oldValue = m_pScreensaverDbus->property("customText").toString().toStdString(); +- m_pScreensaverDbus->call("setCustomText", "test custom text"); +- std::string newValue = m_pScreensaverDbus->property("customText").toString().toStdString(); ++ std::string oldValue = m_pScreenSaverInterface->property("customText").toString().toStdString(); ++ m_pScreenSaverInterface->setCustomText("test custom text"); ++ std::string newValue = m_pScreenSaverInterface->property("customText").toString().toStdString(); + ASSERT_STREQ(newValue.c_str(), "test custom text"); +- m_pScreensaverDbus->call("setCustomText", oldValue.c_str()); ++ m_pScreenSaverInterface->setCustomText(oldValue.c_str()); + } + + TEST_F(ScreensaverInterfaceTest, setCustomTextCentered) + { +- if (!m_pScreensaverDbus || !m_pScreensaverDbus->isValid()) { +- return; +- } +- bool oldValue = m_pScreensaverDbus->property("customTextCentered").toBool(); +- m_pScreensaverDbus->call("setCustomTextCentered", false); +- bool newValue = m_pScreensaverDbus->property("customTextCentered").toBool(); ++ bool oldValue = m_pScreenSaverInterface->property("customTextCentered").toBool(); ++ m_pScreenSaverInterface->setCustomTextCentered(false); ++ bool newValue = m_pScreenSaverInterface->property("customTextCentered").toBool(); + ASSERT_EQ(newValue, false); +- m_pScreensaverDbus->call("setCustomTextCentered", oldValue); ++ m_pScreenSaverInterface->setCustomTextCentered(oldValue); + } +diff --git a/tests/unit_test_shortcut/unit_test_shortcut.cpp b/tests/unit_test_shortcut/unit_test_shortcut.cpp +index d0630a6..4c38573 100644 +--- a/tests/unit_test_shortcut/unit_test_shortcut.cpp ++++ b/tests/unit_test_shortcut/unit_test_shortcut.cpp +@@ -19,12 +19,8 @@ + */ + #include <gtest/gtest.h> + #include <gtest/gtest-death-test.h> +-#include <QDBusReply> + #include "../../registeredSession/plugins/shortcut/shortcutinterface.h" + #include "../../registeredSession/plugins/shortcut/type.h" +-#include "stubext.h" +- +-using namespace stub_ext; + + class ShortcutInterfaceTest : public testing::Test + { +@@ -32,62 +28,60 @@ protected: + static void SetUpTestSuite() + { + m_pShortcutInterface = new ShortcutInterface(); +- m_pShortcutDbus = new QDBusInterface("org.ukui.ukcc.session", +- "/Shortcut", +- "org.ukui.ukcc.session.Shortcut", +- QDBusConnection::sessionBus()); ++ m_pShortcutInterface->getThreadStart(); + } + + static void TearDownTestSuite() + { +- if (m_pShortcutInterface) { ++ if (m_pShortcutInterface) { + delete m_pShortcutInterface; + m_pShortcutInterface = nullptr; +- } +- if (m_pShortcutInterface) { +- delete m_pShortcutInterface; +- m_pShortcutInterface = nullptr; +- } ++ } + } + + static ShortcutInterface *m_pShortcutInterface; +- static QDBusInterface* m_pShortcutDbus; + }; + + ShortcutInterface *ShortcutInterfaceTest::m_pShortcutInterface = nullptr; +-QDBusInterface *ShortcutInterfaceTest::m_pShortcutDbus = nullptr; + +-TEST_F(ShortcutInterfaceTest, getSystemShortcutSize) ++TEST_F(ShortcutInterfaceTest, getSystemShortcut) + { +- if (!m_pShortcutDbus || !m_pShortcutDbus->isValid()) { +- return; +- } +- QDBusReply<QStringPairList> ret = m_pShortcutDbus->call("getSystemShortcut"); +- ASSERT_TRUE(ret.isValid()); +- QStringPairList pairList = ret.value(); ++ QStringPairList pairList = m_pShortcutInterface->getSystemShortcut(); + ASSERT_GE(pairList.size(), 15); + } + +-TEST_F(ShortcutInterfaceTest, getCustomShortcutSize) ++TEST_F(ShortcutInterfaceTest, getCustomShortcut) + { +- if (!m_pShortcutDbus || !m_pShortcutDbus->isValid()) { +- return; +- } +- QDBusReply<QStringPairList> ret = m_pShortcutDbus->call("getSystemShortcut"); +- ASSERT_TRUE(ret.isValid()); +- QStringPairList pairList = ret.value(); ++ QStringPairList pairList = m_pShortcutInterface->getCustomShortcut(); + ASSERT_GE(pairList.size(), 0); + } + ++TEST_F(ShortcutInterfaceTest, getSystemShortcutEntry) ++{ ++ QList<KeyEntry> pairList = m_pShortcutInterface->getSystemShortcutEntry(); ++ ASSERT_GE(pairList.size(), 15); ++} ++ ++TEST_F(ShortcutInterfaceTest, getCustomShortcutEntry) ++{ ++ QList<KeyEntry> pairList = m_pShortcutInterface->getCustomShortcutEntry(); ++ ASSERT_GE(pairList.size(), 0); ++} ++ ++TEST_F(ShortcutInterfaceTest, getShowShortcutString) ++{ ++ QString shortKey = "Meta+A"; ++ m_pShortcutInterface->updateShortcut(); ++ QString newShortKey = m_pShortcutInterface->getShowShortcutString(shortKey); ++ ASSERT_GE(newShortKey.toStdString().c_str(), "Win+A"); ++} ++ + TEST_F(ShortcutInterfaceTest, setSystemShortcut) + { +- if (!m_pShortcutDbus || !m_pShortcutDbus->isValid()) { +- return; +- } + QGSettings generalShort("org.ukui.SettingsDaemon.plugins.media-keys"); + std::string oldValue = generalShort.get("kylin-display-switch").toString().toStdString(); + +- m_pShortcutDbus->call("setSystemShortcut","kylin-display-switch","<Win>V"); ++ m_pShortcutInterface->setSystemShortcut("kylin-display-switch", "<Win>V"); + std::string newValue = generalShort.get("kylin-display-switch").toString().toStdString(); + + ASSERT_STREQ(newValue.c_str(), "<Win>V"); +diff --git a/tests/unit_test_wallpaper/main.cpp b/tests/unit_test_wallpaper/main.cpp +index 6227cbc..9250f9b 100644 +--- a/tests/unit_test_wallpaper/main.cpp ++++ b/tests/unit_test_wallpaper/main.cpp +@@ -1,9 +1,7 @@ + #include <gtest/gtest.h> +-#include <QGuiApplication> + + int main(int argc, char **argv) + { +- QGuiApplication a(argc, argv); + testing::InitGoogleTest(&argc, argv); + + return RUN_ALL_TESTS(); +diff --git a/tests/unit_test_wallpaper/unit_test_wallpaper.cpp b/tests/unit_test_wallpaper/unit_test_wallpaper.cpp +index ebfca40..b450cd6 100644 +--- a/tests/unit_test_wallpaper/unit_test_wallpaper.cpp ++++ b/tests/unit_test_wallpaper/unit_test_wallpaper.cpp +@@ -19,74 +19,89 @@ + */ + #include <gtest/gtest.h> + #include <gtest/gtest-death-test.h> +-#include <QDBusReply> +-#include <QDBusInterface> + #include <QGSettings> +-#include "../../registeredSession/plugins/wallpaper/workerobject.h" +-#include "../../registeredSession/plugins/wallpaper/xmlhandle.h" +-#include "stubext.h" +- +-using namespace stub_ext; ++#include "../../registeredSession/plugins/wallpaper/wallpaperinterface.h" + + class WallpaperInterfaceTest : public testing::Test + { + protected: + static void SetUpTestSuite() + { +- m_pWallpaperDbus = new QDBusInterface("org.ukui.ukcc.session", +- "/Wallpaper", +- "org.ukui.ukcc.session.Wallpaper", +- QDBusConnection::sessionBus()); ++ m_pWallpaperInterface = new WallpaperInterface(); + } + + static void TearDownTestSuite() + { +- if (m_pWallpaperDbus) { +- delete m_pWallpaperDbus; +- m_pWallpaperDbus = nullptr; +- } + } + +- static QDBusInterface* m_pWallpaperDbus; ++ static WallpaperInterface* m_pWallpaperInterface; + }; + +-QDBusInterface *WallpaperInterfaceTest::m_pWallpaperDbus = nullptr; ++WallpaperInterface *WallpaperInterfaceTest::m_pWallpaperInterface = nullptr; + +-TEST_F(WallpaperInterfaceTest, setWallpaper) ++TEST_F(WallpaperInterfaceTest, getWallpaperMode) + { +- if (!m_pWallpaperDbus || !m_pWallpaperDbus->isValid()) { +- return; +- } + QGSettings gset("org.mate.background"); +- std::string oldValue = gset.get("picture-filename").toString().toStdString(); +- m_pWallpaperDbus->call("setWallpaper", "picture", "/usr/share/backgrounds/city.jpg"); +- std::string newValue = gset.get("picture-filename").toString().toStdString(); +- ASSERT_STREQ(newValue.c_str(), "/usr/share/backgrounds/city.jpg"); +- m_pWallpaperDbus->call("setWallpaper", "picture", oldValue.c_str()); ++ QString oldValue = gset.get("picture-filename").toString(); ++ std::string curValue = m_pWallpaperInterface->getWallpaperMode().toStdString(); ++ if (oldValue.isEmpty()) { ++ ASSERT_STREQ(curValue.c_str(), "color"); ++ } else { ++ ASSERT_STREQ(curValue.c_str(), "picture"); ++ } + } + +-TEST_F(WallpaperInterfaceTest, setDisplayType) ++TEST_F(WallpaperInterfaceTest, setWallpaper) + { +- if (!m_pWallpaperDbus || !m_pWallpaperDbus->isValid()) { +- return; ++ QGSettings gset("org.mate.background"); ++ QString oldValue = gset.get("picture-filename").toString(); ++ std::string wallpaperMode = m_pWallpaperInterface->getWallpaperMode().toStdString(); ++ if (!oldValue.isEmpty()) { ++ m_pWallpaperInterface->setWallpaper("picture", "/usr/share/backgrounds/city.jpg"); ++ std::string newValue = gset.get("picture-filename").toString().toStdString(); ++ ASSERT_STREQ(newValue.c_str(), "/usr/share/backgrounds/city.jpg"); ++ m_pWallpaperInterface->setWallpaper("picture", oldValue.toStdString().c_str()); ++ } else { ++ ASSERT_STREQ(wallpaperMode.c_str(), "color"); + } +- std::string oldType = m_pWallpaperDbus->property("displayType").toString().toStdString(); +- m_pWallpaperDbus->call("setDisplayType", "centered"); +- std::string newType = m_pWallpaperDbus->property("displayType").toString().toStdString(); ++} + ++TEST_F(WallpaperInterfaceTest, setDisplayType) ++{ ++ std::string oldType = m_pWallpaperInterface->getDisplayType().toStdString(); ++ m_pWallpaperInterface->setDisplayType("centered"); ++ QGSettings gset("org.mate.background"); ++ std::string newType = gset.get("picture-options").toString().toStdString(); + ASSERT_STREQ(newType.c_str(), "centered"); +- m_pWallpaperDbus->call("setDisplayType", oldType.c_str()); ++ m_pWallpaperInterface->setDisplayType(oldType.c_str()); + } + + TEST_F(WallpaperInterfaceTest, resetDefault) + { +- if (!m_pWallpaperDbus || !m_pWallpaperDbus->isValid()) { +- return; +- } ++ QString oldType = m_pWallpaperInterface->getDisplayType(); + QGSettings gset("org.mate.background"); +- std::string oldType = m_pWallpaperDbus->property("displayType").toString().toStdString(); +- m_pWallpaperDbus->call("resetDefault"); +- std::string newType = m_pWallpaperDbus->property("displayType").toString().toStdString(); ++ std::string oldPicName = gset.get("picture-filename").toString().toStdString(); ++ ++ m_pWallpaperInterface->resetDefault(); ++ ++ std::string newType = m_pWallpaperInterface->getDisplayType().toStdString(); + ASSERT_STREQ(newType.c_str(), "scaled"); +- m_pWallpaperDbus->call("setDisplayType", oldType.c_str()); ++ ++ std::string newPicName = gset.get("picture-filename").toString().toStdString(); ++ ASSERT_STREQ(newPicName.c_str(), "/usr/share/backgrounds/1-openkylin.jpg"); ++ ++ m_pWallpaperInterface->setDisplayType(oldType); ++ gset.set("picture-filename", oldPicName.c_str()); ++} ++ ++TEST_F(WallpaperInterfaceTest, getPreviewWallpapers) ++{ ++ int size = m_pWallpaperInterface->property("previewWallpapers").toStringList().size(); ++ ASSERT_GE(size, 0); ++} ++ ++TEST_F(WallpaperInterfaceTest, getSourceWallpapers) ++{ ++ int size = m_pWallpaperInterface->property("sourceWallpapers").toStringList().size(); ++ ASSERT_GE(size, 0); + } +diff --git a/tests/unit_test_wallpaper/unit_test_wallpaper.pro b/tests/unit_test_wallpaper/unit_test_wallpaper.pro +index e7f58a4..ec9e029 100644 +--- a/tests/unit_test_wallpaper/unit_test_wallpaper.pro ++++ b/tests/unit_test_wallpaper/unit_test_wallpaper.pro +@@ -4,6 +4,7 @@ + # + #------------------------------------------------- + QT += dbus xml ++QT -= gui + #greaterThan(QT_MAJOR_VERSION, 4): QT += widgets concurrent sql xml + TEMPLATE = app + diff -Nru ukui-control-center-4.10.0.0/debian/patches/0105-121-310473.patch ukui-control-center-4.10.0.0/debian/patches/0105-121-310473.patch --- ukui-control-center-4.10.0.0/debian/patches/0105-121-310473.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0105-121-310473.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,82 @@ +From: nil <zhoubin@kylinos.cn> +Date: Thu, 26 Dec 2024 12:05:08 +0000 +Subject: =?utf-8?b?ITEyMSAzMTA0NzMg44CQ5pi+56S65Zmo44CR5LiN6IO95YiH5o2i5YiG?= + =?utf-8?b?6L6o546H44CB5pa55ZCR44CB5Yi35paw546H77yM5YiH5o2i5peg5L+d5a2Y5o+Q?= + =?utf-8?b?56S6IE1lcmdlIHB1bGwgcmVxdWVzdCAhMTIxIGZyb20g6IuP5Zej5YW4L29wZW5r?= + =?utf-8?b?eWxpbi9uaWxlLTExMjY=?= + +--- + plugins/system/display/qml/Output.qml | 5 ++--- + plugins/system/display/qml/OutputIdentifier.qml | 14 +++++++------- + 2 files changed, 9 insertions(+), 10 deletions(-) + +diff --git a/plugins/system/display/qml/Output.qml b/plugins/system/display/qml/Output.qml +index b52143e..dded426 100644 +--- a/plugins/system/display/qml/Output.qml ++++ b/plugins/system/display/qml/Output.qml +@@ -17,9 +17,9 @@ + */ + + import QtQuick 2.1 ++import QtQuick.Controls 2.5 + import QtGraphicalEffects 1.0 + import org.kde.kscreen 1.0 +-import org.kde.plasma.components 2.0 as PlasmaComponents + + QMLOutput { + +@@ -51,7 +51,6 @@ QMLOutput { + Component.onCompleted: { + root.updateRootProperties(); + } +- + SystemPalette { + id: palette; + } +@@ -205,7 +204,7 @@ QMLOutput { + } + } + +- PlasmaComponents.Label { ++ Label { + id: labelVendor; + y: ((parent.height - orientationPanel.height) / 2) - (implicitHeight / 2) + +diff --git a/plugins/system/display/qml/OutputIdentifier.qml b/plugins/system/display/qml/OutputIdentifier.qml +index 313c02a..456b65f 100644 +--- a/plugins/system/display/qml/OutputIdentifier.qml ++++ b/plugins/system/display/qml/OutputIdentifier.qml +@@ -1,7 +1,6 @@ + + import QtQuick 2.1 +-import org.kde.plasma.core 2.0 as PlasmaCore +-import org.kde.plasma.components 2.0 as PlasmaComponents ++import QtQuick.Controls 2.5 + + Rectangle { + id: root; +@@ -15,18 +14,19 @@ Rectangle { + width: childrenRect.width + 2 * childrenRect.x + height: childrenRect.height + 2 * childrenRect.y + +- PlasmaComponents.Label { ++ Label { + id: displayName +- x: units.largeSpacing * 2 +- y: units.largeSpacing +- font.pointSize: theme.defaultFont.pointSize * 2 ++ x: 20 * 2 ++ y: 20 ++ font.pointSize: 10 * 2 + text: root.outputName; + color: "white"; + wrapMode: Text.WordWrap; + horizontalAlignment: Text.AlignHCenter; ++ + } + +- PlasmaComponents.Label { ++ Label { + id: modeLabel; + anchors { + horizontalCenter: displayName.horizontalCenter Binary files /tmp/tmp1hmvpp67/duLIK7uEMQ/ukui-control-center-4.10.0.0/debian/patches/0106-122-md.patch and /tmp/tmp1hmvpp67/lxnzdyeDcf/ukui-control-center-4.10.0.0/debian/patches/0106-122-md.patch differ diff -Nru ukui-control-center-4.10.0.0/debian/patches/0107-123-291357-100.patch ukui-control-center-4.10.0.0/debian/patches/0107-123-291357-100.patch --- ukui-control-center-4.10.0.0/debian/patches/0107-123-291357-100.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0107-123-291357-100.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,26 @@ +From: nil <zhoubin@kylinos.cn> +Date: Wed, 1 Jan 2025 07:35:43 +0000 +Subject: =?utf-8?b?ITEyMyAyOTEzNTcg44CQ5Li76aKY6K6+572u44CR5YWz6Zet54m55pWI?= + =?utf-8?b?5qih5byP77yM6YeN5ZCvL+azqOmUgOeZu+W9leWQjueJueaViOaooeW8j+iHqg==?= + =?utf-8?b?5Yqo5omT5byA77yM6YCP5piO5bqm5Li6MTAwJSBNZXJnZSBwdWxsIHJlcXVlc3Qg?= + =?utf-8?b?ITEyMyBmcm9tIOiLj+WXo+WFuC9vcGVua3lsaW4vbmlsZS0xMDE4?= + +--- + plugins/personalized/theme/theme.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/plugins/personalized/theme/theme.cpp b/plugins/personalized/theme/theme.cpp +index 7d8d711..7c2ecfe 100644 +--- a/plugins/personalized/theme/theme.cpp ++++ b/plugins/personalized/theme/theme.cpp +@@ -275,7 +275,9 @@ void Theme::setupSettings() { + + kwinSettings->endGroup(); + +- mEffectWidget->setChecked(kwin); ++ bool effectEnabled = personliseGsettings->get(PERSONALSIE_EFFECT_KEY).toBool(); ++ mEffectWidget->setChecked(effectEnabled); ++ mCornerWidget->setVisible(effectEnabled); + + if (mEffectWidget->isChecked()) { + mTranWidget->setVisible(true); diff -Nru ukui-control-center-4.10.0.0/debian/patches/0108-124-bug.patch ukui-control-center-4.10.0.0/debian/patches/0108-124-bug.patch --- ukui-control-center-4.10.0.0/debian/patches/0108-124-bug.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0108-124-bug.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,100 @@ +From: nil <zhoubin@kylinos.cn> +Date: Wed, 1 Jan 2025 07:37:29 +0000 +Subject: =?utf-8?b?ITEyNCDkv67lpI1idWcgTWVyZ2UgcHVsbCByZXF1ZXN0ICExMjQgZnJv?= + =?utf-8?b?bSDkvZXmgJ3og5wvbmlsZQ==?= + +--- + plugins/account/userinfo/userinfo.cpp | 5 +++-- + plugins/devices/keyboard/keyboardmain.cpp | 26 +++++++++++++++++++++++++- + plugins/devices/keyboard/keyboardmain.h | 3 +++ + 3 files changed, 31 insertions(+), 3 deletions(-) + +diff --git a/plugins/account/userinfo/userinfo.cpp b/plugins/account/userinfo/userinfo.cpp +index 9515973..c27960d 100644 +--- a/plugins/account/userinfo/userinfo.cpp ++++ b/plugins/account/userinfo/userinfo.cpp +@@ -489,9 +489,10 @@ void UserInfo::buildItemForUsersAndSetConnect(UserInfomation user) + + //用户类型发生变化,重置状态 + connect(this, &UserInfo::userTypeChanged, utils, [=](QString n){ +- qDebug() << "update userType"<< user.username << user.logined; ++ QString loginedUsers = getLoginedUsers(); ++ qDebug() << "update userType"<< user.username << loginedUsers.contains(user.username); + utils->refreshDelStatus(!isLastAdmin(user.username)); +- utils->refreshTypeStatus(!isLastAdmin(user.username) && !user.logined); ++ utils->refreshTypeStatus(!isLastAdmin(user.username) && !loginedUsers.contains(user.username)); + #ifdef WITHKYSEC + if (!kysec_is_disabled() && kysec_get_3adm_status()){ + if (user.username == "secadm" || user.username == "auditadm"){ +diff --git a/plugins/devices/keyboard/keyboardmain.cpp b/plugins/devices/keyboard/keyboardmain.cpp +index 5dfcc95..08888f0 100644 +--- a/plugins/devices/keyboard/keyboardmain.cpp ++++ b/plugins/devices/keyboard/keyboardmain.cpp +@@ -181,6 +181,14 @@ void KeyboardMain::initKeyTips() + keyBoardWidget->keyTipsFrame()->blockSignals(false); + } + ++void KeyboardMain::initInputMethodSet() ++{ ++ qDebug() << "input method seting cmd = " << getInputMethodSetCmd(); ++ if (getInputMethodSetCmd().isEmpty()) { ++ keyBoardWidget->inputMethodPushButton()->setVisible(false); ++ } ++} ++ + void KeyboardMain::initShowIconOnTray() + { + // 在托盘显示虚拟键盘图标 +@@ -249,6 +257,21 @@ void KeyboardMain::setKeyboardVisible(bool checked) + keyBoardWidget->inputTestFrame()->setVisible(checked); + } + ++QString KeyboardMain::getInputMethodSetCmd() ++{ ++ QFile inputSetCmd("/usr/bin/fcitx5-config-qt"); ++ if (inputSetCmd.exists()) { ++ return "/usr/bin/fcitx5-config-qt"; ++ } ++ ++ QFile inputSetCmd1("/usr/bin/fcitx-config-gtk3"); ++ if (inputSetCmd1.exists()) { ++ return "/usr/bin/fcitx-config-gtk3"; ++ } ++ ++ return ""; ++} ++ + void KeyboardMain::dataChanged(QString key) + { + if (key == QString("repeat")) { +@@ -306,7 +329,8 @@ void KeyboardMain::inputMethodSetSlot() + UkccCommon::buriedSettings(name(), keyBoardWidget->inputMethodFrame()->objectName(), QString("settings")); + #endif + QProcess process; +- process.startDetached("fcitx5-config-qt"); ++ QString cmd = getInputMethodSetCmd(); ++ process.startDetached(cmd); + } + + void KeyboardMain::showIconOnTraySlot(bool checked) +diff --git a/plugins/devices/keyboard/keyboardmain.h b/plugins/devices/keyboard/keyboardmain.h +index b9b1b7f..61002dd 100644 +--- a/plugins/devices/keyboard/keyboardmain.h ++++ b/plugins/devices/keyboard/keyboardmain.h +@@ -49,6 +49,7 @@ private: + void initDelay(); + void initSpeed(); + void initKeyTips(); ++ void initInputMethodSet(); + void initShowIconOnTray(); + void initShowIconOnDesktop(); + void initKeyboardSize(); +@@ -58,6 +59,8 @@ private: + + void setKeyboardVisible(bool checked); + ++ QString getInputMethodSetCmd(); ++ + protected: + bool eventFilter(QObject *watched, QEvent *event); + diff -Nru ukui-control-center-4.10.0.0/debian/patches/0109-125-277741.patch ukui-control-center-4.10.0.0/debian/patches/0109-125-277741.patch --- ukui-control-center-4.10.0.0/debian/patches/0109-125-277741.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0109-125-277741.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,70 @@ +From: nil <zhoubin@kylinos.cn> +Date: Wed, 1 Jan 2025 07:42:37 +0000 +Subject: =?utf-8?b?ITEyNSAyNzc3NDEg44CQ5pi+56S65Zmo44CR57yp5pS+546H5L+u5pS5?= + =?utf-8?b?5rOo6ZSA5ZCO5pyq55Sf5pWIIE1lcmdlIHB1bGwgcmVxdWVzdCAhMTI1IGZyb20g?= + =?utf-8?b?bmlsL25pbGUtMDEwMQ==?= + +--- + plugins/system/display/outputconfig.cpp | 4 ++-- + plugins/system/display/unifiedoutputconfig.cpp | 2 +- + plugins/system/display/widget.cpp | 5 ++--- + 3 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/plugins/system/display/outputconfig.cpp b/plugins/system/display/outputconfig.cpp +index afcaa29..619d7a5 100644 +--- a/plugins/system/display/outputconfig.cpp ++++ b/plugins/system/display/outputconfig.cpp +@@ -204,7 +204,7 @@ void OutputConfig::initUi() + + initConnection(); + +- if (!(UkccCommon::isOpenkylin() && UkccCommon::isWayland())) ++ if (!((UkccCommon::isOpenkylin() || UkccCommon::isV11()) && UkccCommon::isWayland())) + return; + // 缩放率下拉框 + +@@ -531,7 +531,7 @@ void OutputConfig::initConfig(const KScreen::ConfigPtr &config) + + void OutputConfig::initScaleItem() + { +- if (!UkccCommon::isOpenkylin() && !UkccCommon::isWayland()) ++ if (!((UkccCommon::isOpenkylin() || UkccCommon::isV11()) && UkccCommon::isWayland())) + return; + mScaleCombox->blockSignals(true); + if (!mOutput->currentMode()) +diff --git a/plugins/system/display/unifiedoutputconfig.cpp b/plugins/system/display/unifiedoutputconfig.cpp +index dcf7976..b49644f 100644 +--- a/plugins/system/display/unifiedoutputconfig.cpp ++++ b/plugins/system/display/unifiedoutputconfig.cpp +@@ -227,7 +227,7 @@ void UnifiedOutputConfig::initUi() + } + }); + +- if (!(UkccCommon::isOpenkylin() && UkccCommon::isWayland())) ++ if (!((UkccCommon::isOpenkylin() || UkccCommon::isV11()) && UkccCommon::isWayland())) + return; + + UkccFrame *scaleFrame = new UkccFrame(this, UkccFrame::BorderRadiusStyle::None, true); +diff --git a/plugins/system/display/widget.cpp b/plugins/system/display/widget.cpp +index d14c753..8b331ed 100644 +--- a/plugins/system/display/widget.cpp ++++ b/plugins/system/display/widget.cpp +@@ -2227,7 +2227,7 @@ void Widget::initUiComponent() + + void Widget::hideComponent() + { +- if (UkccCommon::isOpenkylin() && UkccCommon::isWayland()) { ++ if ((UkccCommon::isOpenkylin() || UkccCommon::isV11()) && UkccCommon::isWayland()) { + scaleFrame->hide(); + } + mNightModeFrame->setVisible(QString(QLatin1String(kdk_system_get_hostVirtType())) == "none"); +@@ -2430,8 +2430,7 @@ void Widget::setPreScreenCfg(KScreen::OutputList screens) + + void Widget::changescale(QSize size) + { +- if (UkccCommon::isTablet() || (UkccCommon::isOpenkylin() && UkccCommon::isWayland())) +- return; ++ if (UkccCommon::isTablet() || ((UkccCommon::isOpenkylin() || UkccCommon::isV11()) && UkccCommon::isWayland())) return; + + mScaleSizeRes = QSize(); + if (mIscloneMode && size != QSize()) { diff -Nru ukui-control-center-4.10.0.0/debian/patches/0110-chore-changelog.patch ukui-control-center-4.10.0.0/debian/patches/0110-chore-changelog.patch --- ukui-control-center-4.10.0.0/debian/patches/0110-chore-changelog.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0110-chore-changelog.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,24 @@ +From: zhoubin <zhoubin@kylinos.cn> +Date: Wed, 1 Jan 2025 16:25:20 +0800 +Subject: chore: changelog + +Description: update changelog + +Log: update changelog +--- + plugins/account/userinfo/userinfo.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/account/userinfo/userinfo.cpp b/plugins/account/userinfo/userinfo.cpp +index c27960d..b568abc 100644 +--- a/plugins/account/userinfo/userinfo.cpp ++++ b/plugins/account/userinfo/userinfo.cpp +@@ -489,7 +489,7 @@ void UserInfo::buildItemForUsersAndSetConnect(UserInfomation user) + + //用户类型发生变化,重置状态 + connect(this, &UserInfo::userTypeChanged, utils, [=](QString n){ +- QString loginedUsers = getLoginedUsers(); ++ QStringList loginedUsers = getLoginedUsers(); + qDebug() << "update userType"<< user.username << loginedUsers.contains(user.username); + utils->refreshDelStatus(!isLastAdmin(user.username)); + utils->refreshTypeStatus(!isLastAdmin(user.username) && !loginedUsers.contains(user.username)); diff -Nru ukui-control-center-4.10.0.0/debian/patches/0111-128-316417.patch ukui-control-center-4.10.0.0/debian/patches/0111-128-316417.patch --- ukui-control-center-4.10.0.0/debian/patches/0111-128-316417.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0111-128-316417.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,217 @@ +From: nil <zhoubin@kylinos.cn> +Date: Fri, 3 Jan 2025 09:43:54 +0000 +Subject: =?utf-8?b?ITEyOCAzMTY0MTcg44CQ5Yy65Z+f6K+t6KiA44CR6L6T5YWl5rOV6K6+?= + =?utf-8?b?572u5omT5LiN5byAIE1lcmdlIHB1bGwgcmVxdWVzdCAhMTI4IGZyb20g6IuP5Zej?= + =?utf-8?b?5YW4L29wZW5reWxpbi9uaWxlLTExMDc=?= + +--- + plugins/system/about/about.cpp | 4 ++ + plugins/system/display/widget.cpp | 1 + + plugins/time-language/area/languageframe.cpp | 50 ++++++++++++++++++++-- + plugins/time-language/area/languageframe.h | 21 +++++++++ + registeredSession/plugins/about/aboutinterface.cpp | 12 ++++-- + shell/mainwindow.cpp | 1 - + 6 files changed, 82 insertions(+), 7 deletions(-) + +diff --git a/plugins/system/about/about.cpp b/plugins/system/about/about.cpp +index 6b8afd1..64cfa1f 100644 +--- a/plugins/system/about/about.cpp ++++ b/plugins/system/about/about.cpp +@@ -45,6 +45,7 @@ + #include <QSvgRenderer> + #include <QSqlQuery> + #include <QSqlRecord> ++#include <QElapsedTimer> + + const QString kAboutFile = "/usr/share/applications/kylin-user-guide.desktop"; + const QString kHPFile = "/usr/share/applications/hp-document.desktop"; +@@ -657,7 +658,10 @@ void About::securityControl() + + void About::compareTime(QString date) + { ++ QElapsedTimer timer; ++ timer.start(); + QString s1 = mAboutDBus->property("netDate").toString(); ++ qDebug() << Q_FUNC_INFO << " ntpTime:" << s1 << timer.elapsed(); + QStringList list_1; + QStringList list_2 = date.split("-"); + int year; +diff --git a/plugins/system/display/widget.cpp b/plugins/system/display/widget.cpp +index 8b331ed..43275c3 100644 +--- a/plugins/system/display/widget.cpp ++++ b/plugins/system/display/widget.cpp +@@ -1972,6 +1972,7 @@ void Widget::initConnection() + }); + + connect(mTemptWidget, &SliderWidget::valueChanged, this, [=]{ ++ qDebug() << Q_FUNC_INFO << "susidian valueChanged" << mTemptWidget->value(); + if (m_colorSettings) { + m_colorSettings->set(NIGHT_TEMPERATURE_KEY, mTemptWidget->value()); + } else { +diff --git a/plugins/time-language/area/languageframe.cpp b/plugins/time-language/area/languageframe.cpp +index 8634356..843cd89 100644 +--- a/plugins/time-language/area/languageframe.cpp ++++ b/plugins/time-language/area/languageframe.cpp +@@ -1,9 +1,29 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * Copyright (C) 2019 KylinSoft Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ */ + #include "languageframe.h" + #include <QHBoxLayout> + #include <QMenu> + #include <QProcess> + #include <QDebug> + #include <QTextCodec> ++#include <QFile> + #include "ukcccommon.h" + using namespace ukcc; + +@@ -72,6 +92,12 @@ QToolButton* LanguageFrame::createToolBtn() + menu->addAction(edit); + menu->addAction(del); + ++ QString inputMethodSetCmd = getInputMethodSetCmd(); ++ qDebug() << "input method seting cmd = " << inputMethodSetCmd; ++ if (inputMethodSetCmd.isEmpty()) { ++ edit->setVisible(false); ++ } ++ + connect(menu, &QMenu::aboutToShow, [=](){ + if (selectedIconLabel->isVisible()) { + del->setEnabled(false); +@@ -86,9 +112,7 @@ QToolButton* LanguageFrame::createToolBtn() + }); + + connect(edit, &QAction::triggered, this, [=](){ +- QProcess process; +- process.startDetached("fcitx5-config-qt"); +- ++ editInputMethodSlot(); + }); + + btn->setIcon(QIcon::fromTheme("view-more-horizontal-symbolic")); +@@ -96,6 +120,26 @@ QToolButton* LanguageFrame::createToolBtn() + return btn; + } + ++void LanguageFrame::editInputMethodSlot() { ++ QString cmd = getInputMethodSetCmd(); ++ QProcess process; ++ process.startDetached(cmd); ++} ++ ++QString LanguageFrame::getInputMethodSetCmd() { ++ QFile inputSetCmd("/usr/bin/fcitx5-config-qt"); ++ if (inputSetCmd.exists()) { ++ return "/usr/bin/fcitx5-config-qt"; ++ } ++ ++ QFile inputSetCmd1("/usr/bin/fcitx-config-gtk3"); ++ if (inputSetCmd1.exists()) { ++ return "/usr/bin/fcitx-config-gtk3"; ++ } ++ ++ return ""; ++} ++ + QString LanguageFrame::getShowName() + { + return this->nameLabel->text(); +diff --git a/plugins/time-language/area/languageframe.h b/plugins/time-language/area/languageframe.h +index ea7551d..a0a84b8 100644 +--- a/plugins/time-language/area/languageframe.h ++++ b/plugins/time-language/area/languageframe.h +@@ -1,3 +1,22 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ++ * ++ * Copyright (C) 2019 KylinSoft Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. ++ * ++ */ + #ifndef LANGUAGEFRAME_H + #define LANGUAGEFRAME_H + +@@ -21,6 +40,8 @@ public: + + private: + void mousePressEvent(QMouseEvent *e); ++ void editInputMethodSlot(); ++ QString getInputMethodSetCmd(); + + private: + QLabel *nameLabel = nullptr; +diff --git a/registeredSession/plugins/about/aboutinterface.cpp b/registeredSession/plugins/about/aboutinterface.cpp +index a7d9f52..9a24c5e 100644 +--- a/registeredSession/plugins/about/aboutinterface.cpp ++++ b/registeredSession/plugins/about/aboutinterface.cpp +@@ -294,12 +294,18 @@ QString AboutInterface::getUpgradeDate() + + QString AboutInterface::getNtpTime() + { ++ int count = 0; + for (QString host : mNtphostNameList) { + ipList.clear(); + ntpGethostbyname(host.toLatin1().data()); + for (QString ip : ipList) { +- char *host = ip.toLatin1().data(); +- char *result = ntpdate(host); ++ ++count; ++ qDebug() << Q_FUNC_INFO << host << "---->" << ip << ":" << count; ++ if (count >= 5) { ++ return ""; ++ } ++ char *mIp = ip.toLatin1().data(); ++ char *result = ntpdate(mIp); + if (result != NULL) { + return QString(result); + } +@@ -401,7 +407,7 @@ char *AboutInterface::ntpdate(char *hostname) + // 设置超时 + struct timeval timeout; + timeout.tv_sec = 0; +- timeout.tv_usec = 300000;//微秒 ++ timeout.tv_usec = 280000;//微秒 + if (setsockopt(s, SOL_SOCKET, SO_RCVTIMEO_NEW, &timeout, sizeof(timeout)) == -1) { + perror("setsockopt failed:"); + return NULL; +diff --git a/shell/mainwindow.cpp b/shell/mainwindow.cpp +index 8579bc5..aeebab3 100644 +--- a/shell/mainwindow.cpp ++++ b/shell/mainwindow.cpp +@@ -587,7 +587,6 @@ void MainWindow::initUkccAbout() { + connect(ukccExit, SIGNAL(triggered()), this, SLOT(close())); + + connect(ukccAbout, &QAction::triggered, this, [=] { +- kdk::WindowManager::setSkipTaskBar(windowHandle(), true); + KAboutDialog *ukcc = new KAboutDialog(this); + ukcc->setAppIcon(QIcon::fromTheme("ukui-control-center")); + ukcc->setAppName(tr("Settings")); diff -Nru ukui-control-center-4.10.0.0/debian/patches/0112-fix-theme.patch ukui-control-center-4.10.0.0/debian/patches/0112-fix-theme.patch --- ukui-control-center-4.10.0.0/debian/patches/0112-fix-theme.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0112-fix-theme.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,34 @@ +From: hesisheng <hesisheng@kylin.com> +Date: Sat, 4 Jan 2025 12:25:35 +0800 +Subject: fix: theme +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Description: 289673 拖动透明度滑动条不流畅,存在延迟 + +Log: 289673 拖动透明度滑动条不流畅,存在延迟 +Signed-off-by: zhoubin <zhoubin@kylinos.cn> +--- + plugins/personalized/theme/theme.cpp | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/plugins/personalized/theme/theme.cpp b/plugins/personalized/theme/theme.cpp +index 7c2ecfe..6fa7023 100644 +--- a/plugins/personalized/theme/theme.cpp ++++ b/plugins/personalized/theme/theme.cpp +@@ -748,9 +748,12 @@ void Theme::initConnection() + + connect(mTranWidget->slider(), &KSlider::valueChanged, this, [=](int value) { + changeTranpancySlot(value); +- revokeGlobalThemeSlot("getTransparencyBlur", QString::number(value, 10)); ++ }); ++ ++ connect(mTranWidget->slider(), &KSlider::sliderReleased, this, [=]() { ++ revokeGlobalThemeSlot("getTransparencyBlur", QString::number(mTranWidget->slider()->value(), 10)); + revokeGlobalThemeSlot("getSupportTransparency", "true"); +- UkccCommon::buriedSettings(name(), "set transparency", QString("select"), QString::number(value)); ++ UkccCommon::buriedSettings(name(), "set transparency", QString("select"), QString::number(mTranWidget->slider()->value())); + }); + + connect(mCornerWidget, &ComboxWidget::currentIndexChanged, this, [=](int index) { diff -Nru ukui-control-center-4.10.0.0/debian/patches/0113-fix-theme.patch ukui-control-center-4.10.0.0/debian/patches/0113-fix-theme.patch --- ukui-control-center-4.10.0.0/debian/patches/0113-fix-theme.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0113-fix-theme.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,33 @@ +From: zhoubin <zhoubin@kylinos.cn> +Date: Sat, 4 Jan 2025 16:57:28 +0800 +Subject: fix: theme +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + + Description: 289673 拖动透明度滑动条不流畅,存在延迟 + + Log: 289673 拖动透明度滑动条不流畅,存在延迟 +--- + plugins/personalized/theme/theme.cpp | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/plugins/personalized/theme/theme.cpp b/plugins/personalized/theme/theme.cpp +index 6fa7023..31dcc63 100644 +--- a/plugins/personalized/theme/theme.cpp ++++ b/plugins/personalized/theme/theme.cpp +@@ -1363,9 +1363,11 @@ void Theme::changeEffectBtnSlot(bool checked) + + void Theme::changeTranpancySlot(int value) + { +- personliseGsettings->set(PERSONALSIE_TRAN_KEY,(static_cast<int>(value) / 100.0)); +- qtSettings->set(THEME_TRAN_KEY, value); +- qtSettings->set(PEONY_TRAN_KEY, value); ++ if (value % 5 == 0) { ++ personliseGsettings->set(PERSONALSIE_TRAN_KEY,(static_cast<int>(value) / 100.0)); ++ qtSettings->set(THEME_TRAN_KEY, value); ++ qtSettings->set(PEONY_TRAN_KEY, value); ++ } + } + + void Theme::changeTranpancySliderSlot(int value) diff -Nru ukui-control-center-4.10.0.0/debian/patches/0114-127-bug.patch ukui-control-center-4.10.0.0/debian/patches/0114-127-bug.patch --- ukui-control-center-4.10.0.0/debian/patches/0114-127-bug.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0114-127-bug.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,161 @@ +From: nil <zhoubin@kylinos.cn> +Date: Tue, 7 Jan 2025 03:05:40 +0000 +Subject: =?utf-8?b?ITEyNyDkv67lpI1idWcgTWVyZ2UgcHVsbCByZXF1ZXN0ICExMjcgZnJv?= + =?utf-8?b?bSDkvZXmgJ3og5wvbmlsZQ==?= + +--- + plugins/account/userinfo/changeuserlogo.cpp | 2 ++ + plugins/account/userinfo/changeusernickname.cpp | 2 ++ + plugins/account/userinfo/changeuserpwd.cpp | 2 ++ + plugins/account/userinfo/creategroupdialog.cpp | 2 ++ + plugins/account/userinfo/createusernew.cpp | 2 ++ + plugins/account/userinfo/userinfo.cpp | 2 -- + plugins/devices/keyboard/keyboardmain.cpp | 2 +- + plugins/devices/keyboard/keyboardui.cpp | 6 ++++++ + plugins/devices/keyboard/keyboardui.h | 3 ++- + 9 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/plugins/account/userinfo/changeuserlogo.cpp b/plugins/account/userinfo/changeuserlogo.cpp +index 1982be1..85d09b5 100644 +--- a/plugins/account/userinfo/changeuserlogo.cpp ++++ b/plugins/account/userinfo/changeuserlogo.cpp +@@ -157,9 +157,11 @@ void ChangeUserLogo::initUI() + culCancelBtn = new QPushButton; + culCancelBtn->setText(tr("Cancel")); + culCancelBtn->setFocusPolicy(Qt::NoFocus); ++ culCancelBtn->setProperty("useButtonPalette", true); + culConfirmBtn = new QPushButton; + culConfirmBtn->setText(tr("Confirm")); + culConfirmBtn->setFocusPolicy(Qt::NoFocus); ++ culConfirmBtn->setProperty("isImportant", true); + + culBottomBtnsHorLayout = new QHBoxLayout; + culBottomBtnsHorLayout->setSpacing(16); +diff --git a/plugins/account/userinfo/changeusernickname.cpp b/plugins/account/userinfo/changeusernickname.cpp +index d7d401a..6e8a97d 100644 +--- a/plugins/account/userinfo/changeusernickname.cpp ++++ b/plugins/account/userinfo/changeusernickname.cpp +@@ -111,9 +111,11 @@ void ChangeUserNickname::initUI(){ + cancelBtn = new QPushButton(); + cancelBtn->setMinimumWidth(96); + cancelBtn->setText(tr("Cancel")); ++ cancelBtn->setProperty("useButtonPalette", true); + confirmBtn = new QPushButton(); + confirmBtn->setMinimumWidth(96); + confirmBtn->setText(tr("Confirm")); ++ confirmBtn->setProperty("isImportant", true); + + bottomBtnsHorLayout = new QHBoxLayout; + bottomBtnsHorLayout->setSpacing(16); +diff --git a/plugins/account/userinfo/changeuserpwd.cpp b/plugins/account/userinfo/changeuserpwd.cpp +index 2c4b97b..f56662e 100644 +--- a/plugins/account/userinfo/changeuserpwd.cpp ++++ b/plugins/account/userinfo/changeuserpwd.cpp +@@ -215,10 +215,12 @@ void ChangeUserPwd::initUI(){ + cancelBtn->setMinimumWidth(96); + cancelBtn->setText(tr("Cancel")); + cancelBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); ++ cancelBtn->setProperty("useButtonPalette", true); + confirmBtn = new QPushButton(); + confirmBtn->setMinimumWidth(96); + confirmBtn->setText(tr("Confirm")); + confirmBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); ++ confirmBtn->setProperty("isImportant", true); + + bottomBtnsHorLayout = new QHBoxLayout; + bottomBtnsHorLayout->setSpacing(16); +diff --git a/plugins/account/userinfo/creategroupdialog.cpp b/plugins/account/userinfo/creategroupdialog.cpp +index bf896fd..6586c57 100644 +--- a/plugins/account/userinfo/creategroupdialog.cpp ++++ b/plugins/account/userinfo/creategroupdialog.cpp +@@ -89,8 +89,10 @@ void CreateGroupDialog::initUI() + mCancelBtn = new QPushButton(tr("Cancel"), this); + mCancelBtn->setFixedSize(96, 36); + mCancelBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); ++ mCancelBtn->setProperty("useButtonPalette", true); + mConfirmBtn = new QPushButton(tr("Confirm"), this); + mConfirmBtn->setMinimumSize(96, 36); ++ mConfirmBtn->setProperty("isImportant", true); + + mConfirmHLaout = new QHBoxLayout(this); + mConfirmHLaout->setContentsMargins(0,0,0,0); +diff --git a/plugins/account/userinfo/createusernew.cpp b/plugins/account/userinfo/createusernew.cpp +index 4df7fdd..dff09ca 100644 +--- a/plugins/account/userinfo/createusernew.cpp ++++ b/plugins/account/userinfo/createusernew.cpp +@@ -274,9 +274,11 @@ void CreateUserNew::initUI(){ + cancelBtn = new QPushButton; + cancelBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); + cancelBtn->setText(tr("Cancel")); ++ cancelBtn->setProperty("useButtonPalette", true); + confirmBtn = new QPushButton; + confirmBtn->setFocusPolicy(Qt::FocusPolicy::NoFocus); + confirmBtn->setText(tr("Confirm")); ++ confirmBtn->setProperty("isImportant", true); + + bottomHorLayout = new QHBoxLayout; + bottomHorLayout->setSpacing(16); +diff --git a/plugins/account/userinfo/userinfo.cpp b/plugins/account/userinfo/userinfo.cpp +index b568abc..10ff4c3 100644 +--- a/plugins/account/userinfo/userinfo.cpp ++++ b/plugins/account/userinfo/userinfo.cpp +@@ -524,8 +524,6 @@ void UserInfo::showCreateUserNewDialog(){ + QMap<QString, UserInfomation>::iterator it = allUserInfoMap.begin(); + for (; it != allUserInfoMap.end(); it++){ + UserInfomation user = it.value(); +- +- usersStringList.append(user.username); + usersStringList.append(user.realname); + } + +diff --git a/plugins/devices/keyboard/keyboardmain.cpp b/plugins/devices/keyboard/keyboardmain.cpp +index 08888f0..a3db782 100644 +--- a/plugins/devices/keyboard/keyboardmain.cpp ++++ b/plugins/devices/keyboard/keyboardmain.cpp +@@ -185,7 +185,7 @@ void KeyboardMain::initInputMethodSet() + { + qDebug() << "input method seting cmd = " << getInputMethodSetCmd(); + if (getInputMethodSetCmd().isEmpty()) { +- keyBoardWidget->inputMethodPushButton()->setVisible(false); ++ keyBoardWidget->setInputMethodVisible(false); + } + } + +diff --git a/plugins/devices/keyboard/keyboardui.cpp b/plugins/devices/keyboard/keyboardui.cpp +index 81d80f2..b40def6 100644 +--- a/plugins/devices/keyboard/keyboardui.cpp ++++ b/plugins/devices/keyboard/keyboardui.cpp +@@ -16,6 +16,12 @@ KeyboardUi::~KeyboardUi() + + } + ++void KeyboardUi::setInputMethodVisible(bool isVisible) ++{ ++ mInputTitleLabel->setVisible(isVisible); ++ mInputMethodSetFrame->setVisible(isVisible); ++} ++ + void KeyboardUi::initUI() + { + mKeyboardFrame = new SettingGroup(this); +diff --git a/plugins/devices/keyboard/keyboardui.h b/plugins/devices/keyboard/keyboardui.h +index fec0d13..a560105 100644 +--- a/plugins/devices/keyboard/keyboardui.h ++++ b/plugins/devices/keyboard/keyboardui.h +@@ -90,6 +90,8 @@ public: + return mSoundEfectsFrame; + } + ++ void setInputMethodVisible(bool isVisible); ++ + private: + QVBoxLayout *mVlayout = nullptr; + +@@ -128,7 +130,6 @@ private: + void setTextSizeFrame(); + void setAnimationFrame(); + void setSoundEfectsFrame(); +- + }; + + #endif // KEYBOARDUI_H diff -Nru ukui-control-center-4.10.0.0/debian/patches/0115-131-290807.patch ukui-control-center-4.10.0.0/debian/patches/0115-131-290807.patch --- ukui-control-center-4.10.0.0/debian/patches/0115-131-290807.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0115-131-290807.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,869 @@ +From: nil <zhoubin@kylinos.cn> +Date: Tue, 7 Jan 2025 04:21:52 +0000 +Subject: =?utf-8?b?ITEzMSAyOTA4MDcg44CQ5pi+56S65Zmo44CR5o6l5YWl56ys5LqM5Liq?= + =?utf-8?b?5bGP5bmV77yM5o6n5Yi26Z2i5p2/6Zeq6YCAIE1lcmdlIHB1bGwgcmVxdWVzdCAh?= + =?utf-8?b?MTMxIGZyb20g6IuP5Zej5YW4L29wZW5reWxpbi9uaWxlLTExMDc=?= + +--- + plugins/system/display/controlpanel.cpp | 9 +- + plugins/system/display/controlpanel.h | 1 + + registeredSession/area/areainterface.cpp | 268 ------------------- + registeredSession/area/areainterface.h | 111 -------- + registeredSession/main.cpp | 2 - + .../plugins/notice/noticeinterface.cpp | 288 --------------------- + registeredSession/plugins/notice/noticeinterface.h | 78 ------ + registeredSession/registeredSession.pro | 2 - + 8 files changed, 9 insertions(+), 750 deletions(-) + delete mode 100644 registeredSession/area/areainterface.cpp + delete mode 100644 registeredSession/area/areainterface.h + delete mode 100644 registeredSession/plugins/notice/noticeinterface.cpp + delete mode 100644 registeredSession/plugins/notice/noticeinterface.h + +diff --git a/plugins/system/display/controlpanel.cpp b/plugins/system/display/controlpanel.cpp +index f05af12..4b78408 100644 +--- a/plugins/system/display/controlpanel.cpp ++++ b/plugins/system/display/controlpanel.cpp +@@ -41,7 +41,7 @@ void ControlPanel::setConfig(const KScreen::ConfigPtr &config) + mConfig = config; + connect(mConfig.data(), &KScreen::Config::outputAdded, + this, [=](const KScreen::OutputPtr &output) { +- addOutput(output, false); ++ addOutputSlot(output); + }); + connect(mConfig.data(), &KScreen::Config::outputRemoved, + this, &ControlPanel::removeOutput); +@@ -51,6 +51,13 @@ void ControlPanel::setConfig(const KScreen::ConfigPtr &config) + } + } + ++void ControlPanel::addOutputSlot(const KScreen::OutputPtr &output) { ++ qDebug() << Q_FUNC_INFO << "wait 100ms for addOutput"; ++ QTimer::singleShot(100, this, [=]() { ++ addOutput(output, false); ++ }); ++} ++ + void ControlPanel::addOutput(const KScreen::OutputPtr &output, bool connectChanged) + { + if (!connectChanged) { +diff --git a/plugins/system/display/controlpanel.h b/plugins/system/display/controlpanel.h +index 345c131..6386531 100644 +--- a/plugins/system/display/controlpanel.h ++++ b/plugins/system/display/controlpanel.h +@@ -33,6 +33,7 @@ public: + + private: + void isWayland(); ++ void addOutputSlot(const KScreen::OutputPtr &output); + + public Q_SLOTS: + void activateOutput(const KScreen::OutputPtr &output); +diff --git a/registeredSession/area/areainterface.cpp b/registeredSession/area/areainterface.cpp +deleted file mode 100644 +index 20518d2..0000000 +--- a/registeredSession/area/areainterface.cpp ++++ /dev/null +@@ -1,268 +0,0 @@ +-#include "areainterface.h" +-#include <unistd.h> +-#include <QDBusConnection> +- +-AreaInterface::AreaInterface() +-{ +- ukccPanelGsettings = UniversalInterface::self()->ukccPanelGsettings(); +- accountInterface = UniversalInterface::self()->accountUserDbus(); +- fcitxInterface = UniversalInterface::self()->fcitxInputMethodDbus(); +- styleGsettings = UniversalInterface::self()->ukuiStyleGsettings(); +- connect(ukccPanelGsettings, &QGSettings::changed, this, [=](QString key) { +- if (key == CALENDAR_KEY) { +- mCalendar.clear(); +- getCalendar(); +- Q_EMIT changed("calendar"); +- } else if (key == FIRST_DAY_KEY) { +- mFirstDay.clear(); +- getFirstDay(); +- Q_EMIT changed("firstDay"); +- } else if (key == DATE_FORMATE_KEY) { +- mDateFormat.clear(); +- getDateFormat(); +- Q_EMIT changed("dateFormat"); +- } else if (key == TIME_FORMAT_KEY) { +- mTimeFormat.clear(); +- getTimeFormat(); +- Q_EMIT changed("timeFormat"); +- } else if (key == SHOW_LANGUAGE_KEY) { +- mShowLanguageList.clear(); +- getShowLanguageList(); +- Q_EMIT changed("showLanguageList"); +- } +- }); +- +- connect(styleGsettings, &QGSettings::changed, this, [=](QString key) { +- if (key == "iconThemeName") { +- Q_EMIT changed("iconThemeName"); +- } +- }); +-} +- +-AreaInterface::~AreaInterface() +-{ +- +-} +- +-const QString AreaInterface::gsettingGet(const QString &key) const +-{ +- if (ukccPanelGsettings->keys().contains(key)) { +- return ukccPanelGsettings->get(key).toString(); +- } else { +- return ""; +- } +-} +- +-void AreaInterface::gsettingSet(const QString &key, const QString &value) +-{ +- if (ukccPanelGsettings->keys().contains(key)) { +- ukccPanelGsettings->set(key, value); +- } +-} +- +-const QStringList AreaInterface::getFormatCountryList() +-{ +- if (mFormatCountryList.isEmpty()) { +- mFormatCountryList.append(QString("en_US.UTF-8")); +- mFormatCountryList.append(QString("zh_CN.UTF-8")); +- mFormatCountryList.append(QString("bo_CN.UTF-8")); +- } +- return mFormatCountryList; +-} +- +-const QStringList AreaInterface::getCalendarList() +-{ +- if (mCalendarList.isEmpty()) { +- mCalendarList.append(QString("solarlunar")); +- QString locale = QLocale::system().name(); +- if ("zh_CN" == locale) { +- mCalendarList.append(QString("lunar")); +- } +- } +- return mCalendarList; +-} +- +-const QStringList AreaInterface::getFirstDayList() +-{ +- if (mFirstDayList.isEmpty()) { +- mFirstDayList.append("monday"); +- mFirstDayList.append("sunday"); +- } +- return mFirstDayList; +-} +- +-const QStringList AreaInterface::getDateFormatList() +-{ +- if (mDateFormatList.isEmpty()) { +- mDateFormatList.append("cn"); +- mDateFormatList.append("en"); +- } +- return mDateFormatList; +-} +- +-const QStringList AreaInterface::getTimeFormatList() +-{ +- if (mtimeFormatList.isEmpty()) { +- mtimeFormatList.append("12"); +- mtimeFormatList.append("24"); +- } +- return mtimeFormatList; +-} +- +-const QStringList AreaInterface::getShowLanguageList() +-{ +- if (mShowLanguageList.isEmpty()) { +- if (ukccPanelGsettings->keys().contains(SHOW_LANGUAGE_KEY)) { +- mShowLanguageList = ukccPanelGsettings->get(SHOW_LANGUAGE_KEY).toStringList(); +- } else { +- qCritical() << "get SHOW_LANGUAGE_KEY error."; +- } +- } +- return mShowLanguageList; +-} +- +-const QStringList AreaInterface::getLanguageList() +-{ +- if (mLanguageList.isEmpty()) { +- mLanguageList.append("zh_CN"); +- mLanguageList.append("en"); +- mLanguageList.append("bo_CN"); +- } +- return mLanguageList; +-} +- +-const QString AreaInterface::getFormatCountry() +-{ +- if (mFormatCountry.isEmpty()) { +- mFormatCountry = accountInterface->property("FormatsLocale").toString(); +- } +- return mFormatCountry; +-} +- +-const QString AreaInterface::getCalendar() +-{ +- if (mCalendar.isEmpty()) { +- mCalendar = gsettingGet(CALENDAR_KEY); +- } +- return mCalendar; +-} +- +-const QString AreaInterface::getFirstDay() +-{ +- if (mFirstDay.isEmpty()) { +- mFirstDay = gsettingGet(FIRST_DAY_KEY); +- } +- return mFirstDay; +-} +- +-const QString AreaInterface::getDateFormat() +-{ +- if (mDateFormat.isEmpty()) { +- mDateFormat = gsettingGet(DATE_FORMATE_KEY); +- } +- return mDateFormat; +-} +- +-const QString AreaInterface::getTimeFormat() +-{ +- if (mTimeFormat.isEmpty()) { +- mTimeFormat = gsettingGet(TIME_FORMAT_KEY); +- } +- return mTimeFormat; +-} +- +-const QString AreaInterface::getLanguage() +-{ +- mLanguage = accountInterface->property("Language").toString(); +- return mLanguage; +-} +- +-void AreaInterface::setFormatCountry(const QString &formatCountry) +-{ +- mFormatCountry = formatCountry; +- accountInterface->call("SetFormatsLocale", formatCountry); +- Q_EMIT changed("formatCountry"); +-} +- +-void AreaInterface::setCalendar(const QString &calendar) +-{ +- gsettingSet(CALENDAR_KEY, calendar); +-} +- +-void AreaInterface::setFirstDay(const QString &firstDay) +-{ +- gsettingSet(FIRST_DAY_KEY, firstDay); +-} +- +-void AreaInterface::setDateFormat(const QString &dateFormat) +-{ +- gsettingSet(DATE_FORMATE_KEY, dateFormat); +-} +- +-void AreaInterface::setTimeFormat(const QString &timeFormat) +-{ +- gsettingSet(TIME_FORMAT_KEY, timeFormat); +-} +- +-void AreaInterface::setShowLanguageList(const QStringList &languageList) +-{ +- if (ukccPanelGsettings->keys().contains(SHOW_LANGUAGE_KEY)) { +- ukccPanelGsettings->set(SHOW_LANGUAGE_KEY, languageList); +- } else { +- qCritical() << "set SHOW_LANGUAGE_KEY error:" << languageList; +- } +-} +- +-void AreaInterface::setLanguage(const QString &languageCode) +-{ +- accountInterface->call("SetLanguage", languageCode); +- Q_EMIT changed("language"); +-} +- +-void AreaInterface::reloadInputMethodConfig() +-{ +- fcitxInterface->call("ReloadConfig"); +-} +- +-void AreaInterface::changeInputMethod(const QString &inputMethod, const bool &add) +-{ +- QString fileTextString; +- QFile configFile(FCITX_CONFIG_FILE); +- if (configFile.open(QIODevice::ReadWrite | QIODevice::Text)) { +- //把文件所有信息读出来 +- QTextStream stream(&configFile); +- fileTextString = stream.readAll(); +- +- if (!fileTextString.contains(inputMethod)) { +- return ; +- } +- QString addString = inputMethod + ":True"; +- QString removeString = inputMethod + ":False"; +- if (add) { +- fileTextString.replace(removeString, addString); +- } else { +- fileTextString.replace(addString, removeString); +- } +- stream << fileTextString; +- configFile.close(); +- reloadInputMethodConfig(); +- } +-} +- +-bool AreaInterface::isAddedInputMethod(const QString &inputMethod) +-{ +- QString fileTextString; +- QFile mFile(FCITX_CONFIG_FILE); +- if (mFile.open(QIODevice::ReadOnly | QIODevice::Text)) { +- QTextStream stream(&mFile); +- fileTextString = stream.readAll(); +- QString string = inputMethod + ":True"; +- if (fileTextString.contains(string)) { +- return true; +- } else { +- return false; +- } +- } +- qCritical()<<"open "<<FCITX_CONFIG_FILE<<" error."; +- return false; +-} +diff --git a/registeredSession/area/areainterface.h b/registeredSession/area/areainterface.h +deleted file mode 100644 +index e586bea..0000000 +--- a/registeredSession/area/areainterface.h ++++ /dev/null +@@ -1,111 +0,0 @@ +-#ifndef AREAINTERFACE_H +-#define AREAINTERFACE_H +- +-#include <QObject> +-#include <QtDBus> +-#include "../universalinterface.h" +- +-class AreaInterface : public QObject +-{ +- Q_OBJECT +- Q_CLASSINFO("D-Bus Interface", "org.ukui.ukcc.session.Area") +- Q_PROPERTY(QStringList formatCountryList READ getFormatCountryList) +- Q_PROPERTY(QStringList calendarList READ getCalendarList) +- Q_PROPERTY(QStringList firstDayList READ getFirstDayList) +- Q_PROPERTY(QStringList dateFormatList READ getDateFormatList) +- Q_PROPERTY(QStringList timeFormatList READ getTimeFormatList) +- Q_PROPERTY(QStringList languageList READ getLanguageList) +- Q_PROPERTY(QStringList showLanguageList READ getShowLanguageList) +- Q_PROPERTY(QString formatCountry READ getFormatCountry) +- Q_PROPERTY(QString calendar READ getCalendar) +- Q_PROPERTY(QString firstDay READ getFirstDay) +- Q_PROPERTY(QString dateFormat READ getDateFormat) +- Q_PROPERTY(QString timeFormat READ getTimeFormat) +- Q_PROPERTY(QString language READ getLanguage) +- +-public: +- AreaInterface(); +- ~AreaInterface(); +- +-protected: +- // 对属性的访问函数 +- const QStringList getFormatCountryList(); +- const QStringList getCalendarList(); +- const QStringList getFirstDayList(); +- const QStringList getDateFormatList(); +- const QStringList getTimeFormatList(); +- const QStringList getLanguageList(); +- const QStringList getShowLanguageList(); +- const QString getFormatCountry(); +- const QString getCalendar(); +- const QString getFirstDay(); +- const QString getDateFormat(); +- const QString getTimeFormat(); +- const QString getLanguage(); +- +-public Q_SLOTS: +- /** +- * @brief 修改输入法 +- * +- * @param inputMethodName 输入法名称 +- * @param add 添加/移除 +- */ +- void changeInputMethod(const QString &inputMethod, const bool &add); +- +- /** +- * @brief 查询输入法是否已经添加 +- * +- * @param inputMethodName 输入法名称 +- * @return bool 返回输入法是否已经添加 +- */ +- bool isAddedInputMethod(const QString &inputMethod); +- +- // 对属性的设置函数 +- void setFormatCountry(const QString &formatCountry); +- void setCalendar(const QString &calendar); +- void setFirstDay(const QString &firstDay); +- void setDateFormat(const QString &dateFormat); +- void setTimeFormat(const QString &timeFormat); +- void setShowLanguageList(const QStringList &languageList); +- void setLanguage(const QString &languageCode); +- +-Q_SIGNALS: +- void changed(QString keyName); +- +-private: +- void reloadInputMethodConfig(); +- +- // 设置和获取gsetting的string类型的键值 +- const QString gsettingGet(const QString &key) const; +- void gsettingSet(const QString &key, const QString &value); +- +-private: +- const QString SHOW_LANGUAGE_KEY = QString("showlanguage"); +- const QString FCITX_CONFIG_FILE = QDir::homePath() + "/.config/fcitx/profile"; +- const QString CALENDAR_KEY = QString("calendar"); +- const QString FIRST_DAY_KEY = QString("firstday"); +- const QString DATE_FORMATE_KEY = QString("date"); +- const QString TIME_FORMAT_KEY = QString("hoursystem"); +- +-private: +- QGSettings *ukccPanelGsettings = nullptr; +- QDBusInterface *accountInterface = nullptr; +- QDBusInterface *fcitxInterface = nullptr; +- QGSettings *styleGsettings = nullptr; +-private: +- QStringList mFormatCountryList = {}; +- QStringList mCalendarList = {}; +- QStringList mFirstDayList = {}; +- QStringList mDateFormatList = {}; +- QStringList mtimeFormatList = {}; +- QStringList mShowLanguageList = {}; +- QStringList mLanguageList = {}; +- QString mLanguage = ""; +- QString mFormatCountry = ""; +- QString mCalendar = ""; +- QString mFirstDay = ""; +- QString mDateFormat = ""; +- QString mTimeFormat = ""; +-}; +- +-#endif // AREAINTERFACE_H +diff --git a/registeredSession/main.cpp b/registeredSession/main.cpp +index e9a688c..b37e031 100644 +--- a/registeredSession/main.cpp ++++ b/registeredSession/main.cpp +@@ -12,7 +12,6 @@ + #include "plugins/area/areainterface.h" + #include "plugins/default/defaultinterface.h" + #include "plugins/autoboot/autostartinterface.h" +-#include "plugins/notice/noticeinterface.h" + #include "plugins/about/aboutinterface.h" + #include "plugins/datetime/datetimeinterface.h" + #include "plugins/wallpaper/wallpaperinterface.h" +@@ -61,7 +60,6 @@ int main(int argc, char *argv[]) + plugins["/Mouse"] = new MouseInterface; + plugins["/Default"] = new DefaultInterface; + plugins["/Autoboot"] = new AutoStartInterface; +- plugins["/Notice"] = new NoticeInterface; + plugins["/About"] = new AboutInterface; + plugins["/Wallpaper"] = new WallpaperInterface; + plugins["/Screenlock"] = new ScreenlockInterface; +diff --git a/registeredSession/plugins/notice/noticeinterface.cpp b/registeredSession/plugins/notice/noticeinterface.cpp +deleted file mode 100644 +index d41e182..0000000 +--- a/registeredSession/plugins/notice/noticeinterface.cpp ++++ /dev/null +@@ -1,288 +0,0 @@ +-#include "noticeinterface.h" +-#include "../../universalinterface.h" +-#include <QDebug> +-#include <QStandardPaths> +-#include <QSettings> +-#include <KApplicationTrader> +-#include <KService> +-#include <KSharedConfig> +-#include <KConfigGroup> +-#include <QFileInfo> +- +-#define NOTICE_SCHEMA "org.ukui.control-center.notice" +-#define ENABLE_NOTICE_KEY "enable-notice" +- +-#define NOTICE_ORIGIN_SCHEMA "org.ukui.control-center.noticeorigin" +-#define NOTICE_ORIGIN_PATH "/org/ukui/control-center/noticeorigin/" +-#define MAX_SHORTCUTS 1000 +-#define MESSAGES_KEY "messages" +-#define VOICE_KEY "voice" +-#define SHOW_SCREENLOCK_KEY "show-on-screenlock" +-#define SHOW_DETAIL_KEY "show-detail" +-#define STYLE_KEY "notification-style" +- +-#define NOTIFICATION_DEMO_SCHEMA "org.ukui.notification.demo" +-#define AUTOSTART_KEY "autostartdisturb" +-#define PROJECTIONSCREEN_KEY "projectionscreendisturb" +-#define FULLSCREEN_KEY "fullscreendisturb" +-#define ALARMCLOCK_KEY "alarmclockdisturb" +-#define TIMESTART_KEY "timestart" +-#define TIMEEND_KEY "timeend" +- +-#define AUTOSTARTDIR "/etc/xdg/autostart/" +- +-NoticeInterface::NoticeInterface() +-{ +- mUkccNoticeGsettings = UniversalInterface::self()->ukccNoticeGsettings(); +- mUkuiNoticeGsettings = UniversalInterface::self()->ukuiNoticeGsettings(); +- mStyleGsettings = UniversalInterface::self()->ukuiStyleGsettings(); +- +- mGsettingMap[ENABLE_NOTICE_KEY] = QString("enableNotice"); +- mGsettingMap[SHOW_SCREENLOCK_KEY] = QString("showOnScreenlock"); +- mGsettingMap[SHOW_DETAIL_KEY] = QString("showDetail"); +- mGsettingMap[STYLE_KEY] = QString("notificationStyle"); +- +- mWhiteList.append("kylin-screenshot.desktop"); +- mWhiteList.append("peony.desktop"); +- mWhiteList.append("kylin-device-daemon.desktop"); +- mWhiteList.append("ukui-power-manager.desktop"); +- mWhiteList.append("kylin-system-update.desktop"); +- mWhiteList.append("ukui-bluetooth.desktop"); +- +- if (mUkccNoticeGsettings) +- connect(mUkccNoticeGsettings, &QGSettings::changed, [=](const QString &key){ +- emit changed(key); +- }); +- if (mUkuiNoticeGsettings) +- connect(mUkuiNoticeGsettings, &QGSettings::changed, [=](const QString &key){ +- emit changed(key); +- }); +- if (mStyleGsettings) +- connect(mStyleGsettings, &QGSettings::changed, [=](const QString &key){ +- emit changed(key); +- }); +- +- +- +-} +- +-bool NoticeInterface::getAutostartDisturb() +-{ +- if (mUkuiNoticeGsettings->keys().contains(AUTOSTART_KEY)) { +- return mUkuiNoticeGsettings->get(AUTOSTART_KEY).toBool(); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << AUTOSTART_KEY; +- } +- return false; +-} +- +-bool NoticeInterface::getProjectionsScreenDisturb() +-{ +- if (mUkuiNoticeGsettings->keys().contains(PROJECTIONSCREEN_KEY)) { +- return mUkuiNoticeGsettings->get(PROJECTIONSCREEN_KEY).toBool(); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << PROJECTIONSCREEN_KEY; +- } +- return false; +-} +- +-bool NoticeInterface::getFullScreenDisturb() +-{ +- if (mUkuiNoticeGsettings->keys().contains(FULLSCREEN_KEY)) { +- return mUkuiNoticeGsettings->get(FULLSCREEN_KEY).toBool(); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << FULLSCREEN_KEY; +- } +- return false; +-} +- +-bool NoticeInterface::getAlarmClockDisturb() +-{ +- if (mUkuiNoticeGsettings->keys().contains(ALARMCLOCK_KEY)) { +- return mUkuiNoticeGsettings->get(ALARMCLOCK_KEY).toBool(); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << ALARMCLOCK_KEY; +- } +- return false; +-} +- +-QString NoticeInterface::getTimeStart() +-{ +- if (mUkuiNoticeGsettings->keys().contains(TIMESTART_KEY)) { +- return mUkuiNoticeGsettings->get(TIMESTART_KEY).toString(); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << TIMESTART_KEY; +- } +- return QString(); +-} +- +-QString NoticeInterface::getTimeEnd() +-{ +- if (mUkuiNoticeGsettings->keys().contains(TIMEEND_KEY)) { +- return mUkuiNoticeGsettings->get(TIMEEND_KEY).toString(); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << TIMEEND_KEY; +- } +- return QString(); +-} +- +-bool NoticeInterface::getNoticeEnable() +-{ +- if (mUkccNoticeGsettings->keys().contains(mGsettingMap[ENABLE_NOTICE_KEY])) { +- return mUkccNoticeGsettings->get(ENABLE_NOTICE_KEY).toBool(); +- } else { +- qCritical() << "mUkccNoticeGsettings not contains the key: " << mUkccNoticeGsettings; +- } +- return false; +-} +- +-QList <QVariant> NoticeInterface::getNoticeAppList() +-{ +- qDBusRegisterMetaType<NoticeApp>(); +- QList <QVariant> list; +- for (QString desktopName : mWhiteList) { +- QFileInfo file(AUTOSTARTDIR + desktopName); +- if (file.exists()) { +- QString mainSection = QStringLiteral("Desktop Entry"); +- KSharedConfig::Ptr sharedConfig = KSharedConfig::openConfig(AUTOSTARTDIR + desktopName, KConfig::NoGlobals); +- KConfigGroup cfg(sharedConfig, mainSection); +- QString name = cfg.readEntry("Name"); +- QString icon = cfg.readEntry("Icon"); +- QString fileName = desktopName.left(desktopName.indexOf(QLatin1Char('.'))); +- +- if (mApplist.contains(name)) +- continue; +- mApplist.append(name); +- NoticeApp app; +- app.desktop = fileName; +- app.name = name; +- app.icon = icon; +- getAppInfo(app, fileName); +- list.append(QVariant::fromValue(app)); +- } +- } +- +- KApplicationTrader::query([=, &list](const KService::Ptr &service) { +- if (service->exec().isEmpty() || service->noDisplay()) +- return false; +- +- QString appname, desktopEntryName, icon; +- appname = service->name(); +- desktopEntryName = service->desktopEntryName(); +- icon = service->icon(); +- +- if (mApplist.contains(appname)) +- return false; +- +- mApplist.append(appname); +- NoticeApp app; +- app.desktop = desktopEntryName; +- app.name = appname; +- app.icon = icon; +- getAppInfo(app, desktopEntryName); +- list.append(QVariant::fromValue(app)); +- return true; +- }); +- mApplist.clear(); +- return list; +-} +- +-void NoticeInterface::getAppInfo(NoticeApp &app, const QString &desktop) +-{ +- const QByteArray id(NOTICE_ORIGIN_SCHEMA); +- QString path = QString("%1%2%3").arg(NOTICE_ORIGIN_PATH).arg(desktop).arg("/"); +- QGSettings *settings = new QGSettings(id, path.toUtf8().data(), this); +- +- app.status = settings->get(MESSAGES_KEY).toBool(); +- +- app.voice = settings->get(VOICE_KEY).toBool(); +- app.detail = settings->get(SHOW_DETAIL_KEY).toBool(); +- app.show = settings->get(SHOW_SCREENLOCK_KEY).toBool(); +- QString style = settings->get(STYLE_KEY).toString(); +- app.mode = 0; +- if (style == "mutative") { +- app.mode = 0; +- } else if (style == "always") { +- app.mode = 1; +- } else if (style == "none") { +- app.mode = 2; +- } +- mNoticeAppsMap[desktop] = settings; +-} +- +-void NoticeInterface::setNoticeDisturb(const QString &key, bool value) +-{ +- if (mUkuiNoticeGsettings->keys().contains(key)) { +- return mUkuiNoticeGsettings->set(key, value); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << key; +- } +-} +- +-void NoticeInterface::setNoticeDisturb(const QString &key, const QString &value) +-{ +- if (mUkuiNoticeGsettings->keys().contains(key)) { +- return mUkuiNoticeGsettings->set(key, value); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << key; +- } +-} +- +-void NoticeInterface::setUkccNotice(const QString &key, bool value) +-{ +- if (mUkccNoticeGsettings->keys().contains(mGsettingMap[key]) || mUkccNoticeGsettings->keys().contains(key)) { +- return mUkccNoticeGsettings->set(key, value); +- } else { +- qCritical() << "mUkccNoticeGsettings not contains the key: " << key; +- } +-} +- +-void NoticeInterface::setAppInfo(const QString &desktop, const QString &key, bool value) +-{ +- auto iter = mNoticeAppsMap.find(desktop); +- if (iter != mNoticeAppsMap.end()) { +- QGSettings *settings = iter.value(); +- if (settings) +- settings->set(key, value); +- } +-} +- +-void NoticeInterface::setAppInfo(const QString &desktop, const QString &key, const QString &value) +-{ +- auto iter = mNoticeAppsMap.find(desktop); +- if (iter != mNoticeAppsMap.end()) { +- QGSettings *settings = iter.value(); +- if (settings) +- settings->set(key, value); +- } +-} +- +-const QDBusArgument &operator<<(QDBusArgument &argument, const NoticeApp &app) +-{ +- argument.beginStructure(); +- argument << app.desktop; +- argument << app.icon; +- argument << app.name; +- argument << app.status; +- argument << app.voice; +- argument << app.detail; +- argument << app.show; +- argument << app.mode; +- argument.endStructure(); +- return argument; +-} +- +-const QDBusArgument &operator>>(const QDBusArgument &argument, NoticeApp &app) +-{ +- argument.beginStructure(); +- argument >> app.desktop; +- argument >> app.icon; +- argument >> app.name; +- argument >> app.status; +- argument >> app.voice; +- argument >> app.detail; +- argument >> app.show; +- argument >> app.mode; +- argument.endStructure(); +- return argument; +-} +diff --git a/registeredSession/plugins/notice/noticeinterface.h b/registeredSession/plugins/notice/noticeinterface.h +deleted file mode 100644 +index ee37bc8..0000000 +--- a/registeredSession/plugins/notice/noticeinterface.h ++++ /dev/null +@@ -1,78 +0,0 @@ +-#ifndef NOTICEINTERFACE_H +-#define NOTICEINTERFACE_H +- +-#include <QObject> +-#include <QDBusArgument> +-#include <QVariant> +-#include <QDBusMetaType> +-#include <QGSettings> +- +-struct NoticeApp +-{ +- QString desktop; +- QString name; +- QString icon; +- bool status; +- bool voice; +- bool detail; +- bool show; +- int mode; +-}; +-const QDBusArgument &operator<<(QDBusArgument &argument, const NoticeApp &app); +-const QDBusArgument &operator>>(const QDBusArgument &argument, NoticeApp &app); +-Q_DECLARE_METATYPE(NoticeApp) +- +- +-class NoticeInterface : public QObject +-{ +- Q_OBJECT +- Q_CLASSINFO("D-Bus Interface", "org.ukui.ukcc.session.Notice") +- Q_PROPERTY(bool isAutostartDisturb READ getAutostartDisturb) +- Q_PROPERTY(bool isProjectionScreenDisturb READ getProjectionsScreenDisturb) +- Q_PROPERTY(bool isFullScreenDisturb READ getFullScreenDisturb) +- Q_PROPERTY(bool isAlarmClockDisturb READ getAlarmClockDisturb) +- Q_PROPERTY(QString timeStart READ getTimeStart) +- Q_PROPERTY(QString timeEnd READ getTimeEnd) +- Q_PROPERTY(bool isEnable READ getNoticeEnable) +- Q_PROPERTY(QList <QVariant> noticeAppList READ getNoticeAppList) +-// Q_PROPERTY(int cursorSpeed READ getCursorSpeed) +-public: +- NoticeInterface(); +- +-protected: +- bool getAutostartDisturb(); +- bool getProjectionsScreenDisturb(); +- bool getFullScreenDisturb(); +- bool getAlarmClockDisturb(); +- QString getTimeStart(); +- QString getTimeEnd(); +- +- bool getNoticeEnable(); +- QList <QVariant> getNoticeAppList(); +- +-private: +- void getAppInfo(NoticeApp &app,const QString &desktop); +- +-public Q_SLOTS: +- void setNoticeDisturb(const QString &key, bool value); +- void setNoticeDisturb(const QString &key, const QString &value); +- void setUkccNotice(const QString &key, bool value); +- void setAppInfo(const QString &desktop, const QString &key, bool value); +- void setAppInfo(const QString &desktop, const QString &key, const QString &value); +- +-private: +- QGSettings *mUkccNoticeGsettings = nullptr; +- QGSettings *mUkuiNoticeGsettings = nullptr; +- QGSettings *mStyleGsettings = nullptr; +- +- QMap <QString, QString> mGsettingMap; +- QMap <QString, QGSettings *> mNoticeAppsMap; +- +- QStringList mWhiteList; +- QStringList mApplist; +- +-Q_SIGNALS: +- void changed(const QString &key); +-}; +- +-#endif // NOTICEINTERFACE_H +diff --git a/registeredSession/registeredSession.pro b/registeredSession/registeredSession.pro +index 262acfe..ddb17e5 100644 +--- a/registeredSession/registeredSession.pro ++++ b/registeredSession/registeredSession.pro +@@ -49,7 +49,6 @@ SOURCES += \ + plugins/keyboard/keyboardinterface.cpp \ + plugins/mouse/mouseinterface.cpp \ + plugins/default/defaultinterface.cpp \ +- plugins/notice/noticeinterface.cpp \ + plugins/screenlock/screenlockinterface.cpp \ + plugins/screensaver/screensaverinterface.cpp \ + plugins/shortcut/getshortcutworker.cpp \ +@@ -76,7 +75,6 @@ HEADERS += \ + plugins/keyboard/keyboardinterface.h \ + plugins/mouse/mouseinterface.h \ + plugins/default/defaultinterface.h \ +- plugins/notice/noticeinterface.h \ + plugins/screenlock/screenlockinterface.h \ + plugins/screensaver/screensaverinterface.h \ + plugins/shortcut/getshortcutworker.h \ Binary files /tmp/tmp1hmvpp67/duLIK7uEMQ/ukui-control-center-4.10.0.0/debian/patches/0116-chore-md.patch and /tmp/tmp1hmvpp67/lxnzdyeDcf/ukui-control-center-4.10.0.0/debian/patches/0116-chore-md.patch differ diff -Nru ukui-control-center-4.10.0.0/debian/patches/0117-133-v11-2501.patch ukui-control-center-4.10.0.0/debian/patches/0117-133-v11-2501.patch --- ukui-control-center-4.10.0.0/debian/patches/0117-133-v11-2501.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0117-133-v11-2501.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,1042 @@ +From: nil <zhoubin@kylinos.cn> +Date: Wed, 8 Jan 2025 07:48:16 +0000 +Subject: =?utf-8?b?ITEzMyDjgJB2MTEtMjUwMeOAkeWNleWFg+a1i+ivlSDmjqfliLbpnaI=?= + =?utf-8?b?5p2/IE1lcmdlIHB1bGwgcmVxdWVzdCAhMTMzIGZyb20g5L2V5oCd6IOcL25pbGU=?= + +--- + registeredSession/json.cpp | 732 -------------------------------- + registeredSession/json.h | 265 ------------ + registeredSession/registeredSession.pro | 2 - + 3 files changed, 999 deletions(-) + delete mode 100644 registeredSession/json.cpp + delete mode 100644 registeredSession/json.h + +diff --git a/registeredSession/json.cpp b/registeredSession/json.cpp +deleted file mode 100644 +index 6f3c0de..0000000 +--- a/registeredSession/json.cpp ++++ /dev/null +@@ -1,732 +0,0 @@ +-/** +- * QtJson - A simple class for parsing JSON data into a QVariant hierarchies and vice-versa. +- * Copyright (C) 2011 Eeli Reilin +- * +- * This program is free software: you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation, either version 3 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program. If not, see <http://www.gnu.org/licenses/>. +- */ +- +-/** +- * \file json.cpp +- */ +- +-#include <QDateTime> +-#include <QStringList> +-#include "json.h" +- +-namespace QtJson { +- static QString dateFormat, dateTimeFormat; +- static bool prettySerialize = false; +- +- static QString sanitizeString(QString str); +- static QByteArray join(const QList<QByteArray> &list, const QByteArray &sep); +- static QVariant parseValue(const QString &json, int &index, bool &success); +- static QVariant parseObject(const QString &json, int &index, bool &success); +- static QVariant parseArray(const QString &json, int &index, bool &success); +- static QVariant parseString(const QString &json, int &index, bool &success); +- static QVariant parseNumber(const QString &json, int &index); +- static int lastIndexOfNumber(const QString &json, int index); +- static void eatWhitespace(const QString &json, int &index); +- static int lookAhead(const QString &json, int index); +- static int nextToken(const QString &json, int &index); +- +- template<typename T> +- QByteArray serializeMap(const T &map, bool &success, int _level = 0) { +- QByteArray newline; +- QByteArray tabs; +- QByteArray tabsFields; +- if (prettySerialize && !map.isEmpty()) { +- newline = "\n"; +- for (int l=1; l<_level; l++) { +- tabs += " "; +- } +- tabsFields = tabs + " "; +- } +- +- QByteArray str = "{" + newline; +- QList<QByteArray> pairs; +- for (typename T::const_iterator it = map.begin(), itend = map.end(); it != itend; ++it) { +- bool otherSuccess = true; +- QByteArray serializedValue = serialize(it.value(), otherSuccess, _level); +- if (serializedValue.isNull()) { +- success = false; +- break; +- } +- pairs << tabsFields + sanitizeString(it.key()).toUtf8() + ":" + (prettySerialize ? " " : "") + serializedValue; +- } +- +- str += join(pairs, "," + newline) + newline; +- str += tabs + "}"; +- return str; +- } +- +- void insert(QVariant &v, const QString &key, const QVariant &value); +- void append(QVariant &v, const QVariant &value); +- +- template<typename T> +- void cloneMap(QVariant &json, const T &map) { +- for (typename T::const_iterator it = map.begin(), itend = map.end(); it != itend; ++it) { +- insert(json, it.key(), (*it)); +- } +- } +- +- template<typename T> +- void cloneList(QVariant &json, const T &list) { +- for (typename T::const_iterator it = list.begin(), itend = list.end(); it != itend; ++it) { +- append(json, (*it)); +- } +- } +- +- /** +- * parse +- */ +- QVariant parse(const QString &json) { +- bool success = true; +- return parse(json, success); +- } +- +- /** +- * parse +- */ +- QVariant parse(const QString &json, bool &success) { +- success = true; +- +- // Return an empty QVariant if the JSON data is either null or empty +- if (!json.isNull() || !json.isEmpty()) { +- QString data = json; +- // We'll start from index 0 +- int index = 0; +- +- // Parse the first value +- QVariant value = parseValue(data, index, success); +- +- // Return the parsed value +- return value; +- } else { +- // Return the empty QVariant +- return QVariant(); +- } +- } +- +- /** +- * clone +- */ +- QVariant clone(const QVariant &data) { +- QVariant v; +- +- if (data.type() == QVariant::Map) { +- cloneMap(v, data.toMap()); +- } else if (data.type() == QVariant::Hash) { +- cloneMap(v, data.toHash()); +- } else if (data.type() == QVariant::List) { +- cloneList(v, data.toList()); +- } else if (data.type() == QVariant::StringList) { +- cloneList(v, data.toStringList()); +- } else { +- v = QVariant(data); +- } +- +- return v; +- } +- +- /** +- * insert value (map case) +- */ +- void insert(QVariant &v, const QString &key, const QVariant &value) { +- if (!v.canConvert<QVariantMap>()) v = QVariantMap(); +- QVariantMap *p = (QVariantMap *)v.data(); +- p->insert(key, clone(value)); +- } +- +- /** +- * append value (list case) +- */ +- void append(QVariant &v, const QVariant &value) { +- if (!v.canConvert<QVariantList>()) v = QVariantList(); +- QVariantList *p = (QVariantList *)v.data(); +- p->append(value); +- } +- +- QByteArray serialize(const QVariant &data) { +- bool success = true; +- return serialize(data, success); +- } +- +- QByteArray serialize(const QVariant &data, bool &success, int _level /*= 0*/) { +- QByteArray newline; +- QByteArray tabs; +- QByteArray tabsFields; +- if (prettySerialize) { +- newline = "\n"; +- for (int l=0; l<_level; l++) { +- tabs += " "; +- } +- tabsFields = tabs + " "; +- } +- +- QByteArray str; +- success = true; +- +- if (!data.isValid()) { // invalid or null? +- str = "null"; +- } else if ((data.type() == QVariant::List) || +- (data.type() == QVariant::StringList)) { // variant is a list? +- QList<QByteArray> values; +- const QVariantList list = data.toList(); +- Q_FOREACH(const QVariant& v, list) { +- bool otherSuccess = true; +- QByteArray serializedValue = serialize(v, otherSuccess, _level+1); +- if (serializedValue.isNull()) { +- success = false; +- break; +- } +- values << tabsFields + serializedValue; +- } +- +- if (!values.isEmpty()) { +- str = "[" + newline + join( values, "," + newline ) + newline + tabs + "]"; +- } else { +- str = "[]"; +- } +- } else if (data.type() == QVariant::Hash) { // variant is a hash? +- str = serializeMap<>(data.toHash(), success, _level+1); +- } else if (data.type() == QVariant::Map) { // variant is a map? +- str = serializeMap<>(data.toMap(), success, _level+1); +- } else if ((data.type() == QVariant::String) || +- (data.type() == QVariant::ByteArray)) {// a string or a byte array? +- str = sanitizeString(data.toString()).toUtf8(); +- } else if (data.type() == QVariant::Double) { // double? +- double value = data.toDouble(&success); +- if (success) { +- str = QByteArray::number(value, 'g'); +- if (!str.contains(".") && ! str.contains("e")) { +- str += ".0"; +- } +- } +- } else if (data.type() == QVariant::Bool) { // boolean value? +- str = data.toBool() ? "true" : "false"; +- } else if (data.type() == QVariant::ULongLong) { // large unsigned number? +- str = QByteArray::number(data.value<qulonglong>()); +- } else if (data.canConvert<qlonglong>()) { // any signed number? +- str = QByteArray::number(data.value<qlonglong>()); +- } else if (data.canConvert<long>()) { //TODO: this code is never executed because all smaller types can be converted to qlonglong +- str = QString::number(data.value<long>()).toUtf8(); +- } else if (data.type() == QVariant::DateTime) { // datetime value? +- str = sanitizeString(dateTimeFormat.isEmpty() +- ? data.toDateTime().toString() +- : data.toDateTime().toString(dateTimeFormat)).toUtf8(); +- } else if (data.type() == QVariant::Date) { // date value? +- str = sanitizeString(dateTimeFormat.isEmpty() +- ? data.toDate().toString() +- : data.toDate().toString(dateFormat)).toUtf8(); +- } else if (data.canConvert<QString>()) { // can value be converted to string? +- // this will catch QUrl, ... (all other types which can be converted to string) +- str = sanitizeString(data.toString()).toUtf8(); +- } else { +- success = false; +- } +- +- if (success) { +- return str; +- } +- return QByteArray(); +- } +- +- QString serializeStr(const QVariant &data) { +- return QString::fromUtf8(serialize(data)); +- } +- +- QString serializeStr(const QVariant &data, bool &success) { +- return QString::fromUtf8(serialize(data, success)); +- } +- +- +- /** +- * \enum JsonToken +- */ +- enum JsonToken { +- JsonTokenNone = 0, +- JsonTokenCurlyOpen = 1, +- JsonTokenCurlyClose = 2, +- JsonTokenSquaredOpen = 3, +- JsonTokenSquaredClose = 4, +- JsonTokenColon = 5, +- JsonTokenComma = 6, +- JsonTokenString = 7, +- JsonTokenNumber = 8, +- JsonTokenTrue = 9, +- JsonTokenFalse = 10, +- JsonTokenNull = 11 +- }; +- +- static QString sanitizeString(QString str) { +- str.replace(QLatin1String("\\"), QLatin1String("\\\\")); +- str.replace(QLatin1String("\""), QLatin1String("\\\"")); +- str.replace(QLatin1String("\b"), QLatin1String("\\b")); +- str.replace(QLatin1String("\f"), QLatin1String("\\f")); +- str.replace(QLatin1String("\n"), QLatin1String("\\n")); +- str.replace(QLatin1String("\r"), QLatin1String("\\r")); +- str.replace(QLatin1String("\t"), QLatin1String("\\t")); +- return QString(QLatin1String("\"%1\"")).arg(str); +- } +- +- static QByteArray join(const QList<QByteArray> &list, const QByteArray &sep) { +- QByteArray res; +- Q_FOREACH(const QByteArray &i, list) { +- if (!res.isEmpty()) { +- res += sep; +- } +- res += i; +- } +- return res; +- } +- +- /** +- * parseValue +- */ +- static QVariant parseValue(const QString &json, int &index, bool &success) { +- // Determine what kind of data we should parse by +- // checking out the upcoming token +- switch(lookAhead(json, index)) { +- case JsonTokenString: +- return parseString(json, index, success); +- case JsonTokenNumber: +- return parseNumber(json, index); +- case JsonTokenCurlyOpen: +- return parseObject(json, index, success); +- case JsonTokenSquaredOpen: +- return parseArray(json, index, success); +- case JsonTokenTrue: +- nextToken(json, index); +- return QVariant(true); +- case JsonTokenFalse: +- nextToken(json, index); +- return QVariant(false); +- case JsonTokenNull: +- nextToken(json, index); +- return QVariant(); +- case JsonTokenNone: +- break; +- } +- +- // If there were no tokens, flag the failure and return an empty QVariant +- success = false; +- return QVariant(); +- } +- +- /** +- * parseObject +- */ +- static QVariant parseObject(const QString &json, int &index, bool &success) { +- QVariantMap map; +- int token; +- +- // Get rid of the whitespace and increment index +- nextToken(json, index); +- +- // Loop through all of the key/value pairs of the object +- bool done = false; +- while (!done) { +- // Get the upcoming token +- token = lookAhead(json, index); +- +- if (token == JsonTokenNone) { +- success = false; +- return QVariantMap(); +- } else if (token == JsonTokenComma) { +- nextToken(json, index); +- } else if (token == JsonTokenCurlyClose) { +- nextToken(json, index); +- return map; +- } else { +- // Parse the key/value pair's name +- QString name = parseString(json, index, success).toString(); +- +- if (!success) { +- return QVariantMap(); +- } +- +- // Get the next token +- token = nextToken(json, index); +- +- // If the next token is not a colon, flag the failure +- // return an empty QVariant +- if (token != JsonTokenColon) { +- success = false; +- return QVariant(QVariantMap()); +- } +- +- // Parse the key/value pair's value +- QVariant value = parseValue(json, index, success); +- +- if (!success) { +- return QVariantMap(); +- } +- +- // Assign the value to the key in the map +- map[name] = value; +- } +- } +- +- // Return the map successfully +- return QVariant(map); +- } +- +- /** +- * parseArray +- */ +- static QVariant parseArray(const QString &json, int &index, bool &success) { +- QVariantList list; +- +- nextToken(json, index); +- +- bool done = false; +- while(!done) { +- int token = lookAhead(json, index); +- +- if (token == JsonTokenNone) { +- success = false; +- return QVariantList(); +- } else if (token == JsonTokenComma) { +- nextToken(json, index); +- } else if (token == JsonTokenSquaredClose) { +- nextToken(json, index); +- break; +- } else { +- QVariant value = parseValue(json, index, success); +- if (!success) { +- return QVariantList(); +- } +- list.push_back(value); +- } +- } +- +- return QVariant(list); +- } +- +- /** +- * parseString +- */ +- static QVariant parseString(const QString &json, int &index, bool &success) { +- QString s; +- QChar c; +- +- eatWhitespace(json, index); +- +- c = json[index++]; +- +- bool complete = false; +- while(!complete) { +- if (index == json.size()) { +- break; +- } +- +- c = json[index++]; +- +- if (c == '\"') { +- complete = true; +- break; +- } else if (c == '\\') { +- if (index == json.size()) { +- break; +- } +- +- c = json[index++]; +- +- if (c == '\"') { +- s.append('\"'); +- } else if (c == '\\') { +- s.append('\\'); +- } else if (c == '/') { +- s.append('/'); +- } else if (c == 'b') { +- s.append('\b'); +- } else if (c == 'f') { +- s.append('\f'); +- } else if (c == 'n') { +- s.append('\n'); +- } else if (c == 'r') { +- s.append('\r'); +- } else if (c == 't') { +- s.append('\t'); +- } else if (c == 'u') { +- int remainingLength = json.size() - index; +- if (remainingLength >= 4) { +- QString unicodeStr = json.mid(index, 4); +- +- int symbol = unicodeStr.toInt(0, 16); +- +- s.append(QChar(symbol)); +- +- index += 4; +- } else { +- break; +- } +- } +- } else { +- s.append(c); +- } +- } +- +- if (!complete) { +- success = false; +- return QVariant(); +- } +- +- return QVariant(s); +- } +- +- /** +- * parseNumber +- */ +- static QVariant parseNumber(const QString &json, int &index) { +- eatWhitespace(json, index); +- +- int lastIndex = lastIndexOfNumber(json, index); +- int charLength = (lastIndex - index) + 1; +- QString numberStr; +- +- numberStr = json.mid(index, charLength); +- +- index = lastIndex + 1; +- bool ok; +- +- if (numberStr.contains('.')) { +- return QVariant(numberStr.toDouble(NULL)); +- } else if (numberStr.startsWith('-')) { +- int i = numberStr.toInt(&ok); +- if (!ok) { +- qlonglong ll = numberStr.toLongLong(&ok); +- return ok ? ll : QVariant(numberStr); +- } +- return i; +- } else { +- uint u = numberStr.toUInt(&ok); +- if (!ok) { +- qulonglong ull = numberStr.toULongLong(&ok); +- return ok ? ull : QVariant(numberStr); +- } +- return u; +- } +- } +- +- /** +- * lastIndexOfNumber +- */ +- static int lastIndexOfNumber(const QString &json, int index) { +- int lastIndex; +- +- for(lastIndex = index; lastIndex < json.size(); lastIndex++) { +- if (QString("0123456789+-.eE").indexOf(json[lastIndex]) == -1) { +- break; +- } +- } +- +- return lastIndex -1; +- } +- +- /** +- * eatWhitespace +- */ +- static void eatWhitespace(const QString &json, int &index) { +- for(; index < json.size(); index++) { +- if (QString(" \t\n\r").indexOf(json[index]) == -1) { +- break; +- } +- } +- } +- +- /** +- * lookAhead +- */ +- static int lookAhead(const QString &json, int index) { +- int saveIndex = index; +- return nextToken(json, saveIndex); +- } +- +- /** +- * nextToken +- */ +- static int nextToken(const QString &json, int &index) { +- eatWhitespace(json, index); +- +- if (index == json.size()) { +- return JsonTokenNone; +- } +- +- QChar c = json[index]; +- index++; +- switch(c.toLatin1()) { +- case '{': return JsonTokenCurlyOpen; +- case '}': return JsonTokenCurlyClose; +- case '[': return JsonTokenSquaredOpen; +- case ']': return JsonTokenSquaredClose; +- case ',': return JsonTokenComma; +- case '"': return JsonTokenString; +- case '0': case '1': case '2': case '3': case '4': +- case '5': case '6': case '7': case '8': case '9': +- case '-': return JsonTokenNumber; +- case ':': return JsonTokenColon; +- } +- index--; // ^ WTF? +- +- int remainingLength = json.size() - index; +- +- // True +- if (remainingLength >= 4) { +- if (json[index] == 't' && json[index + 1] == 'r' && +- json[index + 2] == 'u' && json[index + 3] == 'e') { +- index += 4; +- return JsonTokenTrue; +- } +- } +- +- // False +- if (remainingLength >= 5) { +- if (json[index] == 'f' && json[index + 1] == 'a' && +- json[index + 2] == 'l' && json[index + 3] == 's' && +- json[index + 4] == 'e') { +- index += 5; +- return JsonTokenFalse; +- } +- } +- +- // Null +- if (remainingLength >= 4) { +- if (json[index] == 'n' && json[index + 1] == 'u' && +- json[index + 2] == 'l' && json[index + 3] == 'l') { +- index += 4; +- return JsonTokenNull; +- } +- } +- +- return JsonTokenNone; +- } +- +- void setDateTimeFormat(const QString &format) { +- dateTimeFormat = format; +- } +- +- void setDateFormat(const QString &format) { +- dateFormat = format; +- } +- +- QString getDateTimeFormat() { +- return dateTimeFormat; +- } +- +- QString getDateFormat() { +- return dateFormat; +- } +- +- void setPrettySerialize(bool enabled) { +- prettySerialize = enabled; +- } +- +- bool isPrettySerialize() { +- return prettySerialize; +- } +- +- +- +- QQueue<BuilderJsonObject *> BuilderJsonObject::created_list; +- +- BuilderJsonObject::BuilderJsonObject() { +- // clean objects previous "created" +- while (!BuilderJsonObject::created_list.isEmpty()) { +- delete BuilderJsonObject::created_list.dequeue(); +- } +- } +- +- BuilderJsonObject::BuilderJsonObject(JsonObject &json) { +- BuilderJsonObject(); +- +- obj = json; +- } +- +- BuilderJsonObject *BuilderJsonObject::set(const QString &key, const QVariant &value) { +- obj[key] = value; +- +- return this; +- } +- +- BuilderJsonObject *BuilderJsonObject::set(const QString &key, BuilderJsonObject *builder) { +- return set(key, builder->create()); +- } +- +- BuilderJsonObject *BuilderJsonObject::set(const QString &key, BuilderJsonArray *builder) { +- return set(key, builder->create()); +- } +- +- JsonObject BuilderJsonObject::create() { +- BuilderJsonObject::created_list.enqueue(this); +- +- return obj; +- } +- +- +- QQueue<BuilderJsonArray *> BuilderJsonArray::created_list; +- +- BuilderJsonArray::BuilderJsonArray() { +- // clean objects previous "created" +- while (!BuilderJsonArray::created_list.isEmpty()) { +- delete BuilderJsonArray::created_list.dequeue(); +- } +- } +- +- BuilderJsonArray::BuilderJsonArray(JsonArray &json) { +- BuilderJsonArray(); +- +- array = json; +- } +- +- BuilderJsonArray *BuilderJsonArray::add(const QVariant &element) { +- array.append(element); +- +- return this; +- } +- +- BuilderJsonArray *BuilderJsonArray::add(BuilderJsonObject *builder) { +- return add(builder->create()); +- } +- +- BuilderJsonArray *BuilderJsonArray::add(BuilderJsonArray *builder) { +- return add(builder->create()); +- } +- +- JsonArray BuilderJsonArray::create() { +- BuilderJsonArray::created_list.enqueue(this); +- +- return array; +- } +- +- +- +- +- BuilderJsonObject *objectBuilder() { +- return new BuilderJsonObject(); +- } +- +- BuilderJsonObject *objectBuilder(JsonObject &json) { +- return new BuilderJsonObject(json); +- } +- +- BuilderJsonArray *arrayBuilder() { +- return new BuilderJsonArray(); +- } +- +- BuilderJsonArray *arrayBuilder(JsonArray &json) { +- return new BuilderJsonArray(json); +- } +- +-} //end namespace +diff --git a/registeredSession/json.h b/registeredSession/json.h +deleted file mode 100644 +index 74a2c40..0000000 +--- a/registeredSession/json.h ++++ /dev/null +@@ -1,265 +0,0 @@ +-/** +- * QtJson - A simple class for parsing JSON data into a QVariant hierarchies and vice-versa. +- * Copyright (C) 2011 Eeli Reilin +- * +- * This program is free software: you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation, either version 3 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program. If not, see <http://www.gnu.org/licenses/>. +- */ +- +-/** +- * \file json.h +- */ +- +-#ifndef JSON_H +-#define JSON_H +- +-#include <QVariant> +-#include <QString> +-#include <QQueue> +- +- +-/** +- * \namespace QtJson +- * \brief A JSON data parser +- * +- * Json parses a JSON data into a QVariant hierarchy. +- */ +-namespace QtJson { +- typedef QVariantMap JsonObject; +- typedef QVariantList JsonArray; +- +- /** +- * Clone a JSON object (makes a deep copy) +- * +- * \param data The JSON object +- */ +- QVariant clone(const QVariant &data); +- +- /** +- * Insert value to JSON object (QVariantMap) +- * +- * \param v The JSON object +- * \param key The key +- * \param value The value +- */ +- void insert(QVariant &v, const QString &key, const QVariant &value); +- +- /** +- * Append value to JSON array (QVariantList) +- * +- * \param v The JSON array +- * \param value The value +- */ +- void append(QVariant &v, const QVariant &value); +- +- /** +- * Parse a JSON string +- * +- * \param json The JSON data +- */ +- QVariant parse(const QString &json); +- +- /** +- * Parse a JSON string +- * +- * \param json The JSON data +- * \param success The success of the parsing +- */ +- QVariant parse(const QString &json, bool &success); +- +- /** +- * This method generates a textual JSON representation +- * +- * \param data The JSON data generated by the parser. +- * +- * \return QByteArray Textual JSON representation in UTF-8 +- */ +- QByteArray serialize(const QVariant &data); +- +- /** +- * This method generates a textual JSON representation +- * +- * \param data The JSON data generated by the parser. +- * \param success The success of the serialization +- * +- * \return QByteArray Textual JSON representation in UTF-8 +- */ +- QByteArray serialize(const QVariant &data, bool &success, int _level = 0); +- +- /** +- * This method generates a textual JSON representation +- * +- * \param data The JSON data generated by the parser. +- * +- * \return QString Textual JSON representation +- */ +- QString serializeStr(const QVariant &data); +- +- /** +- * This method generates a textual JSON representation +- * +- * \param data The JSON data generated by the parser. +- * \param success The success of the serialization +- * +- * \return QString Textual JSON representation +- */ +- QString serializeStr(const QVariant &data, bool &success, int _level = 0); +- +- /** +- * This method sets date(time) format to be used for QDateTime::toString +- * If QString is empty, Qt::TextDate is used. +- * +- * \param format The JSON data generated by the parser. +- */ +- void setDateTimeFormat(const QString& format); +- void setDateFormat(const QString& format); +- +- /** +- * This method gets date(time) format to be used for QDateTime::toString +- * If QString is empty, Qt::TextDate is used. +- */ +- QString getDateTimeFormat(); +- QString getDateFormat(); +- +- /** +- * @brief setPrettySerialize enable/disabled pretty-print when serialize() a json +- * @param enabled +- */ +- void setPrettySerialize(bool enabled); +- +- /** +- * @brief isPrettySerialize check if is enabled pretty-print when serialize() a json +- * @return +- */ +- bool isPrettySerialize(); +- +- +- +- +- /** +- * QVariant based Json object +- */ +- class Object : public QVariant { +- template<typename T> +- Object& insertKey(Object* ptr, const QString& key) { +- T* p = (T*)ptr->data(); +- if (!p->contains(key)) p->insert(key, QVariant()); +- return *reinterpret_cast<Object*>(&p->operator[](key)); +- } +- template<typename T> +- void removeKey(Object *ptr, const QString& key) { +- T* p = (T*)ptr->data(); +- p->remove(key); +- } +- public: +- Object() : QVariant() {} +- Object(const Object& ref) : QVariant(ref) {} +- +- Object& operator=(const QVariant& rhs) { +- /** It maybe more robust when running under Qt versions below 4.7 */ +- QObject * obj = qvariant_cast<QObject *>(rhs); +- // setValue(rhs); +- setValue(obj); +- return *this; +- } +- Object& operator[](const QString& key) { +- if (type() == QVariant::Map) +- return insertKey<QVariantMap>(this, key); +- else if (type() == QVariant::Hash) +- return insertKey<QVariantHash>(this, key); +- +- setValue(QVariantMap()); +- +- return insertKey<QVariantMap>(this, key); +- } +- const Object& operator[](const QString& key) const { +- return const_cast<Object*>(this)->operator[](key); +- } +- void remove(const QString& key) { +- if (type() == QVariant::Map) +- removeKey<QVariantMap>(this, key); +- else if (type() == QVariant::Hash) +- removeKey<QVariantHash>(this, key); +- } +- }; +- +- +- class BuilderJsonArray; +- +- /** +- * @brief The BuilderJsonObject class +- */ +- class BuilderJsonObject { +- +- public: +- BuilderJsonObject(); +- BuilderJsonObject(JsonObject &json); +- +- BuilderJsonObject *set(const QString &key, const QVariant &value); +- BuilderJsonObject *set(const QString &key, BuilderJsonObject *builder); +- BuilderJsonObject *set(const QString &key, BuilderJsonArray *builder); +- JsonObject create(); +- +- private: +- static QQueue<BuilderJsonObject *> created_list; +- +- JsonObject obj; +- }; +- +- /** +- * @brief The BuilderJsonArray class +- */ +- class BuilderJsonArray { +- +- public: +- BuilderJsonArray(); +- BuilderJsonArray(JsonArray &json); +- +- BuilderJsonArray *add(const QVariant &element); +- BuilderJsonArray *add(BuilderJsonObject *builder); +- BuilderJsonArray *add(BuilderJsonArray *builder); +- JsonArray create(); +- +- private: +- static QQueue<BuilderJsonArray *> created_list; +- +- JsonArray array; +- }; +- +- +- /** +- * @brief Create a BuilderJsonObject +- * @return +- */ +- BuilderJsonObject *objectBuilder(); +- +- /** +- * @brief Create a BuilderJsonObject starting from copy of another json +- * @return +- */ +- BuilderJsonObject *objectBuilder(JsonObject &json); +- +- /** +- * @brief Create a BuilderJsonArray +- * @return +- */ +- BuilderJsonArray *arrayBuilder(); +- +- /** +- * @brief Create a BuilderJsonArray starting from copy of another json +- * @return +- */ +- BuilderJsonArray *arrayBuilder(JsonArray &json); +-} +- +-#endif //JSON_H +diff --git a/registeredSession/registeredSession.pro b/registeredSession/registeredSession.pro +index ddb17e5..9189016 100644 +--- a/registeredSession/registeredSession.pro ++++ b/registeredSession/registeredSession.pro +@@ -40,7 +40,6 @@ INSTALLS += inst1 + #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + + SOURCES += \ +- json.cpp \ + main.cpp \ + plugins/about/aboutinterface.cpp \ + plugins/area/areainterface.cpp \ +@@ -67,7 +66,6 @@ target.path = /usr/bin/ + + + HEADERS += \ +- json.h \ + plugins/about/aboutinterface.h \ + plugins/area/areainterface.h \ + plugins/autoboot/autostartinterface.h \ diff -Nru ukui-control-center-4.10.0.0/debian/patches/0118-135-291185.patch ukui-control-center-4.10.0.0/debian/patches/0118-135-291185.patch --- ukui-control-center-4.10.0.0/debian/patches/0118-135-291185.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0118-135-291185.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,28 @@ +From: nil <zhoubin@kylinos.cn> +Date: Wed, 8 Jan 2025 08:09:26 +0000 +Subject: =?utf-8?b?ITEzNSAyOTExODUg44CQ5pe26Ze05LiO5pel5pyf44CR5re75Yqg5paw?= + =?utf-8?b?5pe25Yy677yM5paw5pe25Yy65LiL6Z2i55qE5pe26Ze05pi+56S65byC5bi477yM?= + =?utf-8?b?5q+U5b2T5YmN5pe25Yy65pma55qE5pe26Ze05pi+56S65Li65q+U5LuK5aSp5pep?= + =?utf-8?b?55qE5pe26Ze0IE1lcmdlIHB1bGwgcmVxdWVzdCAhMTM1IGZyb20gbmlsL25pbGUt?= + =?utf-8?b?MDEwNw==?= + +--- + plugins/time-language/datetime/timeBtn.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plugins/time-language/datetime/timeBtn.cpp b/plugins/time-language/datetime/timeBtn.cpp +index 4b27eaf..cdba347 100644 +--- a/plugins/time-language/datetime/timeBtn.cpp ++++ b/plugins/time-language/datetime/timeBtn.cpp +@@ -103,9 +103,9 @@ void TimeBtn::updateTime(bool hour_24) { + QDateTime thisZoneTime; + const double timeDelta = (thisZone.offsetFromUtc(QDateTime::currentDateTime()) - currentZone.offsetFromUtc(QDateTime::currentDateTime())) / 3600.0; + QString dateLiteral; +- if (QDateTime::currentDateTime().toTimeZone(thisZone).time().hour() + timeDelta >= 24) { ++ if ((QDateTime::currentDateTime().time().hour() + timeDelta) >= 24) { + dateLiteral = tr("Tomorrow"); +- } else if (QDateTime::currentDateTime().toTimeZone(thisZone).time().hour() + timeDelta < 0) { ++ } else if ((QDateTime::currentDateTime().time().hour() + timeDelta) < 0) { + dateLiteral = tr("Yesterday"); + } else { + dateLiteral = tr("Today"); diff -Nru ukui-control-center-4.10.0.0/debian/patches/0119-139-bug.patch ukui-control-center-4.10.0.0/debian/patches/0119-139-bug.patch --- ukui-control-center-4.10.0.0/debian/patches/0119-139-bug.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0119-139-bug.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,107 @@ +From: nil <zhoubin@kylinos.cn> +Date: Fri, 10 Jan 2025 08:53:16 +0000 +Subject: =?utf-8?b?ITEzOSDkv67lpI1idWcgTWVyZ2UgcHVsbCByZXF1ZXN0ICExMzkgZnJv?= + =?utf-8?b?bSDkvZXmgJ3og5wvbmlsZQ==?= + +--- + plugins/account/userinfo/createusernew.cpp | 2 +- + plugins/commoninfo/boot/grubverifydialog.cpp | 4 ++-- + plugins/devices/keyboard/keyboardmain.cpp | 2 ++ + plugins/system/vino/vino.cpp | 20 +++++++++++++++++++- + plugins/system/vino/vino.h | 1 + + 5 files changed, 25 insertions(+), 4 deletions(-) + +diff --git a/plugins/account/userinfo/createusernew.cpp b/plugins/account/userinfo/createusernew.cpp +index dff09ca..e892dec 100644 +--- a/plugins/account/userinfo/createusernew.cpp ++++ b/plugins/account/userinfo/createusernew.cpp +@@ -206,7 +206,7 @@ void CreateUserNew::initUI(){ + typeBtnGroup->addButton(adminRadioBtn, 1); + typeBtnGroup->addButton(standardRadioBtn, 0); + +- adminRadioBtn->setChecked(true); ++ standardRadioBtn->setChecked(true); + + //管理员RadioButton布局 + admin1VerLayout = new QVBoxLayout; +diff --git a/plugins/commoninfo/boot/grubverifydialog.cpp b/plugins/commoninfo/boot/grubverifydialog.cpp +index 0b89e21..0569cd1 100644 +--- a/plugins/commoninfo/boot/grubverifydialog.cpp ++++ b/plugins/commoninfo/boot/grubverifydialog.cpp +@@ -38,7 +38,7 @@ void GrubVerify::initUI() + + //新密码 + newPwdLabel = new QLabel(); +- newPwdLabel->setFixedSize(100,24); ++ newPwdLabel->setFixedWidth(100); + setTextDynamicInPwd(newPwdLabel, tr("Pwd")); + newTipLabel = new QLabel(); + QFont ft; +@@ -81,7 +81,7 @@ void GrubVerify::initUI() + + //确认密码 + surePwdLabel = new QLabel(); +- surePwdLabel->setFixedSize(100,24); ++ surePwdLabel->setFixedWidth(100); + setTextDynamicInPwd(surePwdLabel, tr("Sure Pwd")); + + surePwdLineEdit = new QLineEdit(); +diff --git a/plugins/devices/keyboard/keyboardmain.cpp b/plugins/devices/keyboard/keyboardmain.cpp +index a3db782..e561a03 100644 +--- a/plugins/devices/keyboard/keyboardmain.cpp ++++ b/plugins/devices/keyboard/keyboardmain.cpp +@@ -132,6 +132,8 @@ void KeyboardMain::initKeyboardStatus() + + initShowIconOnDesktop(); + ++ initInputMethodSet(); ++ + initShowIconOnTray(); + + initKeyboardSize(); +diff --git a/plugins/system/vino/vino.cpp b/plugins/system/vino/vino.cpp +index 85c875f..74e23f4 100644 +--- a/plugins/system/vino/vino.cpp ++++ b/plugins/system/vino/vino.cpp +@@ -73,7 +73,10 @@ bool Vino::isEnable() const + if (!UkccCommon::isWayland()) { + return !UkccCommon::isCommunity() && isExistVino(); + } else { +- return true; ++ if (isExistKylinRemote()) { ++ return true; ++ } ++ return false; + } + } + +@@ -81,3 +84,18 @@ bool Vino::isExistVino() const + { + return QGSettings::isSchemaInstalled(QByteArray("org.gnome.Vino")); + } ++ ++bool Vino::isExistKylinRemote() const ++{ ++ QProcess *process = new QProcess; ++ process->start("dpkg -l | grep kylin-remote-desktop-daemon"); ++ process->waitForFinished(); ++ ++ QByteArray ba = process->readAllStandardOutput(); ++ delete process; ++ QString mOutput = QString(ba.data()); ++ if (mOutput.contains("kylin-remote-desktop-daemon")) { ++ return true; ++ } ++ return false; ++} +diff --git a/plugins/system/vino/vino.h b/plugins/system/vino/vino.h +index 9ee60ef..8beaf41 100644 +--- a/plugins/system/vino/vino.h ++++ b/plugins/system/vino/vino.h +@@ -54,5 +54,6 @@ private: + private: + bool isExistVino() const; + ++ bool isExistKylinRemote() const; + }; + #endif // VINO_H Binary files /tmp/tmp1hmvpp67/duLIK7uEMQ/ukui-control-center-4.10.0.0/debian/patches/0120-140-fix-panel-bug-278913.patch and /tmp/tmp1hmvpp67/lxnzdyeDcf/ukui-control-center-4.10.0.0/debian/patches/0120-140-fix-panel-bug-278913.patch differ diff -Nru ukui-control-center-4.10.0.0/debian/patches/0121-141-380937-2024-OEM-v11-2501.patch ukui-control-center-4.10.0.0/debian/patches/0121-141-380937-2024-OEM-v11-2501.patch --- ukui-control-center-4.10.0.0/debian/patches/0121-141-380937-2024-OEM-v11-2501.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0121-141-380937-2024-OEM-v11-2501.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,721 @@ +From: nil <zhoubin@kylinos.cn> +Date: Wed, 15 Jan 2025 06:43:14 +0000 +Subject: =?utf-8?b?ITE0MSAzODA5Mzcg5a2QIOOAkDIwMjTjgJHln7rnoYDnu4Tku7bnu4Q=?= + =?utf-8?b?5ZGo5L6L5Lya5b6F5YqeJuW5s+aXtuS7u+WKoSZPRU3kuLTml7bku7vliqEgLyA=?= + =?utf-8?b?44CQdjExLTI1MDHjgJHljZXlhYPmtYvor5Ug5o6n5Yi26Z2i5p2/IOW8gOWPkSBN?= + =?utf-8?b?ZXJnZSBwdWxsIHJlcXVlc3QgITE0MSBmcm9tIOiLj+WXo+WFuC9vcGVua3lsaW4v?= + =?utf-8?b?bmlsZS0xMTA3?= + +--- + registeredSession/main.cpp | 2 - + .../plugins/datetime/datetimeinterface.cpp | 3 +- + .../plugins/datetime/datetimeinterface.h | 2 +- + .../plugins/shortcut/shortcutinterface.cpp | 13 +-- + .../plugins/shortcut/shortcutinterface.h | 2 +- + registeredSession/plugins/shortcut/type.cpp | 51 -------- + registeredSession/plugins/shortcut/type.h | 10 -- + registeredSession/plugins/vino/vinointerface.cpp | 129 --------------------- + registeredSession/plugins/vino/vinointerface.h | 56 --------- + .../plugins/wallpaper/wallpaperinterface.cpp | 5 +- + registeredSession/plugins/wallpaper/xmlhandle.cpp | 51 -------- + registeredSession/plugins/wallpaper/xmlhandle.h | 1 - + registeredSession/registeredSession.pro | 3 - + tests/unit_test_datetime/unit_test_datetime.cpp | 22 ++++ + .../unit_test_screenlock/unit_test_screenlock.cpp | 10 ++ + tests/unit_test_shortcut/unit_test_shortcut.cpp | 11 +- + tests/unit_test_shortcut/unit_test_shortcut.pro | 4 - + tests/unit_test_wallpaper/unit_test_wallpaper.cpp | 44 ++++++- + 18 files changed, 85 insertions(+), 334 deletions(-) + delete mode 100644 registeredSession/plugins/shortcut/type.cpp + delete mode 100644 registeredSession/plugins/vino/vinointerface.cpp + delete mode 100644 registeredSession/plugins/vino/vinointerface.h + +diff --git a/registeredSession/main.cpp b/registeredSession/main.cpp +index b37e031..357580e 100644 +--- a/registeredSession/main.cpp ++++ b/registeredSession/main.cpp +@@ -18,7 +18,6 @@ + #include "plugins/screenlock/screenlockinterface.h" + #include "plugins/shortcut/shortcutinterface.h" + #include "plugins/screensaver/screensaverinterface.h" +-#include "plugins/vino/vinointerface.h" + + void registerPlugins(const QString &path, QObject *object, QDBusConnection &connection) { + if (!connection.registerObject(path, object, QDBusConnection::ExportAllSlots | +@@ -65,7 +64,6 @@ int main(int argc, char *argv[]) + plugins["/Screenlock"] = new ScreenlockInterface; + plugins["/Shortcut"] = new ShortcutInterface; + plugins["/Screensaver"] = new ScreensaverInterface; +- plugins["/Vino"] = new VinoInterface; + + for (std::map<QString, QObject*>::value_type plugin : plugins) + registerPlugins(plugin.first, plugin.second, sessionBus); +diff --git a/registeredSession/plugins/datetime/datetimeinterface.cpp b/registeredSession/plugins/datetime/datetimeinterface.cpp +index 02ad875..51234cc 100644 +--- a/registeredSession/plugins/datetime/datetimeinterface.cpp ++++ b/registeredSession/plugins/datetime/datetimeinterface.cpp +@@ -24,11 +24,12 @@ DatetimeInterface::~DatetimeInterface() + + } + +-void DatetimeInterface::timezoneChanged(QString key) ++bool DatetimeInterface::timezoneChanged(QString key) + { + if (key == "timezone") { + Q_EMIT changed("timezone"); + } ++ return true; + } + + QStringList DatetimeInterface::getTimezone() +diff --git a/registeredSession/plugins/datetime/datetimeinterface.h b/registeredSession/plugins/datetime/datetimeinterface.h +index a98c0c3..78bc727 100644 +--- a/registeredSession/plugins/datetime/datetimeinterface.h ++++ b/registeredSession/plugins/datetime/datetimeinterface.h +@@ -33,7 +33,7 @@ public Q_SLOTS: + QStringList timezoneName(QString timezone); + + private Q_SLOTS: +- void timezoneChanged(QString key); ++ bool timezoneChanged(QString key); + + private: + QDBusInterface *timeDateInterface = nullptr; +diff --git a/registeredSession/plugins/shortcut/shortcutinterface.cpp b/registeredSession/plugins/shortcut/shortcutinterface.cpp +index 8febb69..707fb04 100644 +--- a/registeredSession/plugins/shortcut/shortcutinterface.cpp ++++ b/registeredSession/plugins/shortcut/shortcutinterface.cpp +@@ -3,16 +3,6 @@ + + ShortcutInterface::ShortcutInterface() + { +- qRegisterMetaType<QStringPair>("QStringPair"); +- qDBusRegisterMetaType<QStringPair>(); +- qRegisterMetaType<QStringPairList>("QStringPairList"); +- qDBusRegisterMetaType<QStringPairList>(); +- +- qRegisterMetaType<KeyEntry>("KeyEntry"); +- qDBusRegisterMetaType<KeyEntry>(); +- qRegisterMetaType<KeyEntryList>("KeyEntryList"); +- qDBusRegisterMetaType<KeyEntryList>(); +- + getShortcutThread(); + } + +@@ -109,9 +99,10 @@ QList<QStringPair> ShortcutInterface::getCustomShortcut() + return customShortcutList; + } + +-void ShortcutInterface::updateShortcut() ++bool ShortcutInterface::updateShortcut() + { + getShortcutThread(); ++ return true; + } + + void ShortcutInterface::setSystemShortcut(const QString &key, const QString &value) +diff --git a/registeredSession/plugins/shortcut/shortcutinterface.h b/registeredSession/plugins/shortcut/shortcutinterface.h +index cb80cdc..2946ff8 100644 +--- a/registeredSession/plugins/shortcut/shortcutinterface.h ++++ b/registeredSession/plugins/shortcut/shortcutinterface.h +@@ -24,7 +24,7 @@ public Q_SLOTS: + QList<KeyEntry> getSystemShortcutEntry(); + QList<KeyEntry> getCustomShortcutEntry(); + +- void updateShortcut(); ++ bool updateShortcut(); + void setSystemShortcut(const QString &key, const QString &value); + + private: +diff --git a/registeredSession/plugins/shortcut/type.cpp b/registeredSession/plugins/shortcut/type.cpp +deleted file mode 100644 +index d05fb35..0000000 +--- a/registeredSession/plugins/shortcut/type.cpp ++++ /dev/null +@@ -1,51 +0,0 @@ +-#include "type.h" +- +-const QDBusArgument &operator<<(QDBusArgument &argument, const QStringPair &string) +-{ +- argument.beginStructure(); +- argument << string.name; +- argument << string.key; +- argument << string.mediakey; +- argument.endStructure(); +- return argument; +-} +- +-const QDBusArgument &operator>>(const QDBusArgument &argument, QStringPair &string) +-{ +- argument.beginStructure(); +- argument >> string.name; +- argument >> string.key; +- argument >> string.mediakey; +- argument.endStructure(); +- return argument; +-} +- +-const QDBusArgument &operator<<(QDBusArgument &argument, const KeyEntry &key) +-{ +- argument.beginStructure(); +- argument << key.gsSchema; +- argument << key.keyStr; +- argument << key.valueStr; +- argument << key.descStr; +- argument << key.gsPath; +- argument << key.nameStr; +- argument << key.bindingStr; +- argument << key.actionStr; +- argument.endStructure(); +- return argument; +-} +- +-const QDBusArgument &operator>>(const QDBusArgument &argument, KeyEntry &key) +-{ +- argument.beginStructure(); +- argument >> key.gsSchema; +- argument >> key.keyStr; +- argument >> key.valueStr; +- argument >> key.descStr; +- argument >> key.gsPath; +- argument >> key.nameStr; +- argument >> key.bindingStr; +- argument >> key.actionStr; +- argument.endStructure(); +- return argument; +-} +diff --git a/registeredSession/plugins/shortcut/type.h b/registeredSession/plugins/shortcut/type.h +index 814668a..00aa7a3 100644 +--- a/registeredSession/plugins/shortcut/type.h ++++ b/registeredSession/plugins/shortcut/type.h +@@ -1,9 +1,6 @@ + #ifndef TYPE_H + #define TYPE_H + +-#include <QDBusArgument> +-#include <QDBusMetaType> +- + typedef struct _KeyEntry { + QString gsSchema; + QString keyStr; +@@ -14,9 +11,6 @@ typedef struct _KeyEntry { + QString bindingStr; + QString actionStr; + }KeyEntry; +-const QDBusArgument &operator<<(QDBusArgument &argument, const KeyEntry &key); +-const QDBusArgument &operator>>(const QDBusArgument &argument, KeyEntry &key); +-Q_DECLARE_METATYPE(KeyEntry) + + typedef struct + { +@@ -25,10 +19,6 @@ typedef struct + QString mediakey; + }QStringPair; + +-const QDBusArgument &operator<<(QDBusArgument &argument, const QStringPair &string); +-const QDBusArgument &operator>>(const QDBusArgument &argument, QStringPair &string); +-Q_DECLARE_METATYPE(QStringPair) +- + typedef QList<KeyEntry> KeyEntryList; + typedef QList<QStringPair> QStringPairList; + +diff --git a/registeredSession/plugins/vino/vinointerface.cpp b/registeredSession/plugins/vino/vinointerface.cpp +deleted file mode 100644 +index da94c11..0000000 +--- a/registeredSession/plugins/vino/vinointerface.cpp ++++ /dev/null +@@ -1,129 +0,0 @@ +-#include "vinointerface.h" +-#include <QDebug> +-#include <QProcess> +- +-VinoInterface::VinoInterface() +-{ +- mVinoGsettings = UniversalInterface::self()->gnomeVinoGsettings(); +- mUkuiVinoGsettings = UniversalInterface::self()->ukuiVinoGsettings(); +- +- mGsettingMap[kVinoViewOnlyKey] = QString("viewOnly"); +- mGsettingMap[kVinoPromptKey] = QString("promptEnabled"); +- mGsettingMap[kAuthenticationKey] = QString("authenticationMethods"); +- mGsettingMap[kVncPwdKey] = QString("vncPassword"); +- mGsettingMap[kVinoEnableKey] = QString("vinoEnabled"); +- mGsettingMap[kXrdpEnableKey] = QString("xrdpEnabled"); +- mGsettingMap[kEnableKey] = QString("enabled"); +-} +- +-bool VinoInterface::getViewOnly() +-{ +- if (mVinoGsettings->keys().contains("viewOnly")) { +- return mVinoGsettings->get(kVinoViewOnlyKey).toBool(); +- } else { +- qCritical() << "mVinoGsettings not contains the key: " << kVinoViewOnlyKey; +- } +- return false; +-} +- +-bool VinoInterface::getPromptEnabled() +-{ +- if (mVinoGsettings->keys().contains("promptEnabled")) { +- return mVinoGsettings->get(kVinoPromptKey).toBool(); +- } else { +- qCritical() << "mVinoGsettings not contains the key: " << kVinoPromptKey; +- } +- return false; +-} +- +-QString VinoInterface::getMethod() +-{ +- if (mVinoGsettings->keys().contains("authenticationMethods")) { +- return mVinoGsettings->get(kAuthenticationKey).toString(); +- } else { +- qCritical() << "mVinoGsettings not contains the key: " << kAuthenticationKey; +- } +- return QString(); +-} +- +-QString VinoInterface::getPassword() +-{ +- if (mVinoGsettings->keys().contains("vncPassword")) { +- return mVinoGsettings->get(kVncPwdKey).toString(); +- } else { +- qCritical() << "mVinoGsettings not contains the key: " << kVncPwdKey; +- } +- return QString(); +-} +- +-bool VinoInterface::getVinoServerStatus() +-{ +- QProcess process; +- process.start("systemctl", QStringList() << "--user" << "is-active" << "vino-server.service"); +- process.waitForFinished(); +- bool isActive = process.readAllStandardOutput().replace("\n", "") == "active"; +- return isActive; +-} +- +-bool VinoInterface::getVinoStatus() +-{ +- if (mUkuiVinoGsettings->keys().contains("vinoEnabled")) { +- return mUkuiVinoGsettings->get(kVinoEnableKey).toBool(); +- } else { +- qCritical() << "mUkuiVinoGsettings not contains the key: " << kVinoEnableKey; +- } +- return false; +-} +- +-bool VinoInterface::getXrdpStatus() +-{ +- if (mUkuiVinoGsettings->keys().contains("xrdpEnabled")) { +- return mUkuiVinoGsettings->get(kXrdpEnableKey).toBool(); +- } else { +- qCritical() << "mUkuiVinoGsettings not contains the key: " << kXrdpEnableKey; +- } +- return false; +-} +- +-bool VinoInterface::getEnableStatus() +-{ +- if (mUkuiVinoGsettings->keys().contains("enabled")) { +- return mUkuiVinoGsettings->get(kEnableKey).toBool(); +- } else { +- qCritical() << "mUkuiVinoGsettings not contains the key: " << kEnableKey; +- } +- return false; +-} +- +-void VinoInterface::setVinoKey(const QString &key, bool value) +-{ +- if (mVinoGsettings->keys().contains(mGsettingMap[key])) { +- return mVinoGsettings->set(key, value); +- } else { +- qCritical() << "mVinoGsettings not contains the key: " << key; +- } +- +- if (mUkuiVinoGsettings->keys().contains(mGsettingMap[key])) { +- return mUkuiVinoGsettings->set(key, value); +- } else { +- qCritical() << "mUkuiVinoGsettings not contains the key: " << key; +- } +-} +- +-void VinoInterface::setVinoKey(const QString &key, QString value) +-{ +- if (mVinoGsettings->keys().contains(mGsettingMap[key])) { +- return mVinoGsettings->set(key, value); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << key; +- } +-} +- +-void VinoInterface::setVinoKey(const QString &key, QByteArray value) +-{ +- if (mVinoGsettings->keys().contains(mGsettingMap[key])) { +- return mVinoGsettings->set(key, value); +- } else { +- qCritical() << "ukuiNoticeGsettings not contains the key: " << key; +- } +-} +diff --git a/registeredSession/plugins/vino/vinointerface.h b/registeredSession/plugins/vino/vinointerface.h +deleted file mode 100644 +index 2691edb..0000000 +--- a/registeredSession/plugins/vino/vinointerface.h ++++ /dev/null +@@ -1,56 +0,0 @@ +-#ifndef VINOINTERFACE_H +-#define VINOINTERFACE_H +- +-#include <QObject> +-#include <QDBusArgument> +-#include <QVariant> +-#include <QDBusMetaType> +-#include <QGSettings> +-#include "../../universalinterface.h" +- +-class VinoInterface : public QObject +-{ +- Q_OBJECT +- Q_CLASSINFO("D-Bus Interface", "org.ukui.ukcc.session.Vino") +- Q_PROPERTY(bool isViewOnly READ getViewOnly) +- Q_PROPERTY(bool isPrompt READ getPromptEnabled) +- Q_PROPERTY(QString method READ getMethod) +- Q_PROPERTY(QString password READ getPassword) +- Q_PROPERTY(bool isActive READ getVinoServerStatus) +- Q_PROPERTY(bool isVino READ getVinoStatus) +- Q_PROPERTY(bool isXrdp READ getXrdpStatus) +- Q_PROPERTY(bool isEnable READ getEnableStatus) +- +-public: +- VinoInterface(); +- +-protected: +- bool getViewOnly(); +- bool getPromptEnabled(); +- QString getMethod(); +- QString getPassword(); +- bool getVinoServerStatus(); +- bool getVinoStatus(); +- bool getXrdpStatus(); +- bool getEnableStatus(); +- +-public Q_SLOTS: +- void setVinoKey(const QString &key, bool value); +- void setVinoKey(const QString &key, QString value); +- void setVinoKey(const QString &key, QByteArray value); +- +-private: +- const QString kEnableKey = "enabled"; +- const QString kXrdpEnableKey = "xrdp-enabled"; +- const QString kVinoEnableKey = "vino-enabled"; +- const QString kVinoViewOnlyKey = "view-only"; +- const QString kVinoPromptKey = "prompt-enabled"; +- const QString kAuthenticationKey = "authentication-methods"; +- const QString kVncPwdKey = "vnc-password"; +- +- QGSettings *mVinoGsettings = nullptr; +- QGSettings *mUkuiVinoGsettings = nullptr; +- QMap <QString, QString> mGsettingMap; +-}; +- +-#endif // VINOINTERFACE_H +diff --git a/registeredSession/plugins/wallpaper/wallpaperinterface.cpp b/registeredSession/plugins/wallpaper/wallpaperinterface.cpp +index 1ca44fd..aaf3eba 100644 +--- a/registeredSession/plugins/wallpaper/wallpaperinterface.cpp ++++ b/registeredSession/plugins/wallpaper/wallpaperinterface.cpp +@@ -3,12 +3,12 @@ + WallpaperInterface::WallpaperInterface() + { + WorkerObject *workThread = new WorkerObject(this); ++ workThread->start(); + connect(workThread, &WorkerObject::wallpaperReaded, this, [=](QStringList previewFiles, QStringList sourceFiles) { + previewWallpaperList = previewFiles; + sourceWallpaperList = sourceFiles; + }); +- workThread->start(); +- ++ connect(workThread, &QThread::finished, workThread, &QThread::deleteLater); + mWallpaperMode.clear(); + QString filename = UniversalInterface::self()->mateBackgroundGsettings()->get("picture-filename").toString(); + if (filename.isEmpty()) { +@@ -54,6 +54,7 @@ WallpaperInterface::WallpaperInterface() + Q_EMIT changed("wallpaper"); + } + }); ++ workThread->wait(); + } + + WallpaperInterface::~WallpaperInterface() +diff --git a/registeredSession/plugins/wallpaper/xmlhandle.cpp b/registeredSession/plugins/wallpaper/xmlhandle.cpp +index 34ffea9..8654355 100644 +--- a/registeredSession/plugins/wallpaper/xmlhandle.cpp ++++ b/registeredSession/plugins/wallpaper/xmlhandle.cpp +@@ -245,54 +245,3 @@ void XmlHandle::_xmlGenerate(){ + + file.close(); + } +- +-void XmlHandle::xmlUpdate(QMap<QString, QMap<QString, QString> > wallpaperinfosMap){ +- QFile file(localconf); +- if (!file.open(QFile::WriteOnly | QFile::Text)){ +- qDebug() << "Error Open XML File When Update Local Xml: " << file.errorString(); +- return; +- } +- +- if (0 == wallpaperinfosMap.count()){ +- qDebug() << "Error QMap Empty"; +- return; +- } +- +- QMap<QString, QString> currentheadMap; +- currentheadMap = wallpaperinfosMap.find("head").value(); +- +- QXmlStreamWriter writer; +- writer.setDevice(&file); +- writer.setAutoFormatting(true); //自动格式化 +-// writer.setCodec(headMap.find("encoding")); +- writer.writeStartDocument(QString(currentheadMap.find("version").value()), false); +- +- //DTD +- writer.writeDTD(QString::fromLocal8Bit("<!DOCTYPE %1 SYSTEM \"%2\">").arg(currentheadMap.find("doctype").value()).arg(currentheadMap.find("system").value())); +- +- //BODY +- writer.writeStartElement("wallpapers"); +- QMap<QString, QMap<QString, QString> >::iterator its = wallpaperinfosMap.begin(); +- for (; its != wallpaperinfosMap.end(); its++){ +- if (QString(its.key()) == "head") +- continue; +- +- QMap<QString, QString> sourceMap = (QMap<QString, QString>)its.value(); +- QMap<QString, QString>::iterator it = sourceMap.begin(); +- +- writer.writeStartElement("wallpaper"); +- writer.writeAttribute("deleted", QString(sourceMap.find("deleted").value())); +- +- for(; it != sourceMap.end(); it++){ +- if (it.key() == "deleted") +- continue; +- writer.writeTextElement(QString(it.key()), QString(it.value())); +- } +- +- writer.writeEndElement(); +- } +- writer.writeEndElement(); +- writer.writeEndDocument(); +- +- file.close(); +-} +diff --git a/registeredSession/plugins/wallpaper/xmlhandle.h b/registeredSession/plugins/wallpaper/xmlhandle.h +index 97f4a76..77ac8cf 100644 +--- a/registeredSession/plugins/wallpaper/xmlhandle.h ++++ b/registeredSession/plugins/wallpaper/xmlhandle.h +@@ -38,7 +38,6 @@ public: + public: + void init(); + void xmlreader(QString filename); +- void xmlUpdate(QMap<QString, QMap<QString, QString>> wallpaperinfosMap); + QMap<QString, QMap<QString, QString> > requireXmlData(); + + public: +diff --git a/registeredSession/registeredSession.pro b/registeredSession/registeredSession.pro +index 9189016..b1420dd 100644 +--- a/registeredSession/registeredSession.pro ++++ b/registeredSession/registeredSession.pro +@@ -52,8 +52,6 @@ SOURCES += \ + plugins/screensaver/screensaverinterface.cpp \ + plugins/shortcut/getshortcutworker.cpp \ + plugins/shortcut/shortcutinterface.cpp \ +- plugins/shortcut/type.cpp \ +- plugins/vino/vinointerface.cpp \ + plugins/wallpaper/wallpaperinterface.cpp \ + plugins/wallpaper/workerobject.cpp \ + plugins/wallpaper/xmlhandle.cpp \ +@@ -78,7 +76,6 @@ HEADERS += \ + plugins/shortcut/getshortcutworker.h \ + plugins/shortcut/shortcutinterface.h \ + plugins/shortcut/type.h \ +- plugins/vino/vinointerface.h \ + plugins/wallpaper/wallpaperinterface.h \ + plugins/wallpaper/workerobject.h \ + plugins/wallpaper/xmlhandle.h \ +diff --git a/tests/unit_test_datetime/unit_test_datetime.cpp b/tests/unit_test_datetime/unit_test_datetime.cpp +index 32ae84a..c326b3a 100644 +--- a/tests/unit_test_datetime/unit_test_datetime.cpp ++++ b/tests/unit_test_datetime/unit_test_datetime.cpp +@@ -94,3 +94,25 @@ TEST_F(DatetimeInterfaceTest, getNtpServers) + QStringList ret = m_pDatetimeInterface->getNtpServers(); + ASSERT_STREQ(ret.at(0).toStdString().c_str(), "pool.ntp.org"); + } ++ ++TEST_F(DatetimeInterfaceTest, timezoneChanged) ++{ ++ bool ret = m_pDatetimeInterface->timezoneChanged("timezone"); ++ ASSERT_EQ(ret, true); ++} ++ ++TEST_F(DatetimeInterfaceTest, getTimeMode) ++{ ++ QString ret = m_pDatetimeInterface->getTimeMode(); ++ if (ret == "automatic") { ++ ASSERT_STREQ(ret.toStdString().c_str(), "automatic"); ++ } else { ++ ASSERT_STREQ(ret.toStdString().c_str(), "manual"); ++ } ++} ++ ++TEST_F(DatetimeInterfaceTest, getNtpServer) ++{ ++ QString ret = m_pDatetimeInterface->getNtpServer(); ++ ASSERT_GE(ret.size(), 0); ++} +diff --git a/tests/unit_test_screenlock/unit_test_screenlock.cpp b/tests/unit_test_screenlock/unit_test_screenlock.cpp +index c2bcee4..58f9314 100644 +--- a/tests/unit_test_screenlock/unit_test_screenlock.cpp ++++ b/tests/unit_test_screenlock/unit_test_screenlock.cpp +@@ -32,6 +32,10 @@ protected: + + static void TearDownTestSuite() + { ++ if (m_pScreenlockInterface) { ++ delete m_pScreenlockInterface; ++ m_pScreenlockInterface = nullptr; ++ } + } + + static ScreenlockInterface *m_pScreenlockInterface; +@@ -80,3 +84,9 @@ TEST_F(ScreenlockInterfaceTest, getSourceWallpapers) + int size = m_pScreenlockInterface->getSourceWallpapers().size(); + ASSERT_GE(size, 0); + } ++ ++TEST_F(ScreenlockInterfaceTest, getWallpaper) ++{ ++ int size = m_pScreenlockInterface->getWallpaper().size(); ++ ASSERT_GE(size, 0); ++} +diff --git a/tests/unit_test_shortcut/unit_test_shortcut.cpp b/tests/unit_test_shortcut/unit_test_shortcut.cpp +index 4c38573..8315ff2 100644 +--- a/tests/unit_test_shortcut/unit_test_shortcut.cpp ++++ b/tests/unit_test_shortcut/unit_test_shortcut.cpp +@@ -20,7 +20,6 @@ + #include <gtest/gtest.h> + #include <gtest/gtest-death-test.h> + #include "../../registeredSession/plugins/shortcut/shortcutinterface.h" +-#include "../../registeredSession/plugins/shortcut/type.h" + + class ShortcutInterfaceTest : public testing::Test + { +@@ -33,10 +32,6 @@ protected: + + static void TearDownTestSuite() + { +- if (m_pShortcutInterface) { +- delete m_pShortcutInterface; +- m_pShortcutInterface = nullptr; +- } + } + + static ShortcutInterface *m_pShortcutInterface; +@@ -76,6 +71,12 @@ TEST_F(ShortcutInterfaceTest, getShowShortcutString) + ASSERT_GE(newShortKey.toStdString().c_str(), "Win+A"); + } + ++TEST_F(ShortcutInterfaceTest, updateShortcut) ++{ ++ bool ret = m_pShortcutInterface->updateShortcut(); ++ ASSERT_EQ(ret, true); ++} ++ + TEST_F(ShortcutInterfaceTest, setSystemShortcut) + { + QGSettings generalShort("org.ukui.SettingsDaemon.plugins.media-keys"); +diff --git a/tests/unit_test_shortcut/unit_test_shortcut.pro b/tests/unit_test_shortcut/unit_test_shortcut.pro +index 23bee08..7e0df90 100644 +--- a/tests/unit_test_shortcut/unit_test_shortcut.pro ++++ b/tests/unit_test_shortcut/unit_test_shortcut.pro +@@ -38,13 +38,9 @@ INCLUDEPATH += $$PROJECT_ROOTDIR \ + + SOURCES += ../../registeredSession/plugins/shortcut/shortcutinterface.cpp \ + ../../registeredSession/plugins/shortcut/getshortcutworker.cpp \ +- ../../registeredSession/plugins/shortcut/type.cpp \ +- ../../registeredSession/universalinterface.cpp \ + unit_test_shortcut.cpp \ + main.cpp + + HEADERS += ../../registeredSession/plugins/shortcut/shortcutinterface.h \ + ../../registeredSession/plugins/shortcut/getshortcutworker.h \ + ../../registeredSession/plugins/shortcut/type.h \ +- ../../registeredSession/universalinterface.h +- +diff --git a/tests/unit_test_wallpaper/unit_test_wallpaper.cpp b/tests/unit_test_wallpaper/unit_test_wallpaper.cpp +index b450cd6..142e008 100644 +--- a/tests/unit_test_wallpaper/unit_test_wallpaper.cpp ++++ b/tests/unit_test_wallpaper/unit_test_wallpaper.cpp +@@ -32,6 +32,10 @@ protected: + + static void TearDownTestSuite() + { ++ if (m_pWallpaperInterface) { ++ delete m_pWallpaperInterface; ++ m_pWallpaperInterface = nullptr; ++ } + } + + static WallpaperInterface* m_pWallpaperInterface; +@@ -43,6 +47,7 @@ TEST_F(WallpaperInterfaceTest, getWallpaperMode) + { + QGSettings gset("org.mate.background"); + QString oldValue = gset.get("picture-filename").toString(); ++ m_pWallpaperInterface->getWallpaper(); + std::string curValue = m_pWallpaperInterface->getWallpaperMode().toStdString(); + if (oldValue.isEmpty()) { + ASSERT_STREQ(curValue.c_str(), "color"); +@@ -51,18 +56,45 @@ TEST_F(WallpaperInterfaceTest, getWallpaperMode) + } + } + +-TEST_F(WallpaperInterfaceTest, setWallpaper) ++TEST_F(WallpaperInterfaceTest, setWallpaperPicture) + { + QGSettings gset("org.mate.background"); + QString oldValue = gset.get("picture-filename").toString(); ++ QString mode = "picture"; ++ QString colorData = ""; ++ if (oldValue.isEmpty()) { ++ mode = "color"; ++ colorData = gset.get("primary-color").toString(); ++ } + std::string wallpaperMode = m_pWallpaperInterface->getWallpaperMode().toStdString(); +- if (!oldValue.isEmpty()) { +- m_pWallpaperInterface->setWallpaper("picture", "/usr/share/backgrounds/city.jpg"); +- std::string newValue = gset.get("picture-filename").toString().toStdString(); +- ASSERT_STREQ(newValue.c_str(), "/usr/share/backgrounds/city.jpg"); ++ m_pWallpaperInterface->setWallpaper("picture", "/usr/share/backgrounds/city.jpg"); ++ std::string newValue = gset.get("picture-filename").toString().toStdString(); ++ ASSERT_STREQ(newValue.c_str(), "/usr/share/backgrounds/city.jpg"); ++ if (mode == "color") { ++ m_pWallpaperInterface->setWallpaper("color", colorData.toStdString().c_str()); ++ } else { + m_pWallpaperInterface->setWallpaper("picture", oldValue.toStdString().c_str()); ++ } ++} ++ ++TEST_F(WallpaperInterfaceTest, setWallpaperColor) ++{ ++ QGSettings gset("org.mate.background"); ++ QString oldValue = gset.get("picture-filename").toString(); ++ QString mode = "picture"; ++ QString colorData = ""; ++ if (oldValue.isEmpty()) { ++ mode = "color"; ++ colorData = gset.get("primary-color").toString(); ++ } ++ std::string wallpaperMode = m_pWallpaperInterface->getWallpaperMode().toStdString(); ++ m_pWallpaperInterface->setWallpaper("color", "#2d7d9a"); ++ std::string newValue = gset.get("primary-color").toString().toStdString(); ++ ASSERT_STREQ(newValue.c_str(), "#2d7d9a"); ++ if (mode == "color") { ++ m_pWallpaperInterface->setWallpaper("color", colorData.toStdString().c_str()); + } else { +- ASSERT_STREQ(wallpaperMode.c_str(), "color"); ++ m_pWallpaperInterface->setWallpaper("picture", oldValue.toStdString().c_str()); + } + } + diff -Nru ukui-control-center-4.10.0.0/debian/patches/0122-142-vino.patch ukui-control-center-4.10.0.0/debian/patches/0122-142-vino.patch --- ukui-control-center-4.10.0.0/debian/patches/0122-142-vino.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0122-142-vino.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,251 @@ +From: nil <zhoubin@kylinos.cn> +Date: Wed, 15 Jan 2025 09:11:00 +0000 +Subject: =?utf-8?b?ITE0MiDmm7TmlrB2aW5vIE1lcmdlIHB1bGwgcmVxdWVzdCAhMTQyIGZy?= + =?utf-8?b?b20g6IuP5Zej5YW4L29wZW5reWxpbi9uaWxlLTExMDc=?= + +--- + registeredSession/main.cpp | 2 + + registeredSession/plugins/vino/vinointerface.cpp | 129 +++++++++++++++++++++++ + registeredSession/plugins/vino/vinointerface.h | 56 ++++++++++ + registeredSession/registeredSession.pro | 2 + + 4 files changed, 189 insertions(+) + create mode 100644 registeredSession/plugins/vino/vinointerface.cpp + create mode 100644 registeredSession/plugins/vino/vinointerface.h + +diff --git a/registeredSession/main.cpp b/registeredSession/main.cpp +index 357580e..68f458a 100644 +--- a/registeredSession/main.cpp ++++ b/registeredSession/main.cpp +@@ -9,6 +9,7 @@ + + #include "plugins/keyboard/keyboardinterface.h" + #include "plugins/mouse/mouseinterface.h" ++#include "plugins/vino/vinointerface.h" + #include "plugins/area/areainterface.h" + #include "plugins/default/defaultinterface.h" + #include "plugins/autoboot/autostartinterface.h" +@@ -64,6 +65,7 @@ int main(int argc, char *argv[]) + plugins["/Screenlock"] = new ScreenlockInterface; + plugins["/Shortcut"] = new ShortcutInterface; + plugins["/Screensaver"] = new ScreensaverInterface; ++ plugins["/Vino"] = new VinoInterface; + + for (std::map<QString, QObject*>::value_type plugin : plugins) + registerPlugins(plugin.first, plugin.second, sessionBus); +diff --git a/registeredSession/plugins/vino/vinointerface.cpp b/registeredSession/plugins/vino/vinointerface.cpp +new file mode 100644 +index 0000000..da94c11 +--- /dev/null ++++ b/registeredSession/plugins/vino/vinointerface.cpp +@@ -0,0 +1,129 @@ ++#include "vinointerface.h" ++#include <QDebug> ++#include <QProcess> ++ ++VinoInterface::VinoInterface() ++{ ++ mVinoGsettings = UniversalInterface::self()->gnomeVinoGsettings(); ++ mUkuiVinoGsettings = UniversalInterface::self()->ukuiVinoGsettings(); ++ ++ mGsettingMap[kVinoViewOnlyKey] = QString("viewOnly"); ++ mGsettingMap[kVinoPromptKey] = QString("promptEnabled"); ++ mGsettingMap[kAuthenticationKey] = QString("authenticationMethods"); ++ mGsettingMap[kVncPwdKey] = QString("vncPassword"); ++ mGsettingMap[kVinoEnableKey] = QString("vinoEnabled"); ++ mGsettingMap[kXrdpEnableKey] = QString("xrdpEnabled"); ++ mGsettingMap[kEnableKey] = QString("enabled"); ++} ++ ++bool VinoInterface::getViewOnly() ++{ ++ if (mVinoGsettings->keys().contains("viewOnly")) { ++ return mVinoGsettings->get(kVinoViewOnlyKey).toBool(); ++ } else { ++ qCritical() << "mVinoGsettings not contains the key: " << kVinoViewOnlyKey; ++ } ++ return false; ++} ++ ++bool VinoInterface::getPromptEnabled() ++{ ++ if (mVinoGsettings->keys().contains("promptEnabled")) { ++ return mVinoGsettings->get(kVinoPromptKey).toBool(); ++ } else { ++ qCritical() << "mVinoGsettings not contains the key: " << kVinoPromptKey; ++ } ++ return false; ++} ++ ++QString VinoInterface::getMethod() ++{ ++ if (mVinoGsettings->keys().contains("authenticationMethods")) { ++ return mVinoGsettings->get(kAuthenticationKey).toString(); ++ } else { ++ qCritical() << "mVinoGsettings not contains the key: " << kAuthenticationKey; ++ } ++ return QString(); ++} ++ ++QString VinoInterface::getPassword() ++{ ++ if (mVinoGsettings->keys().contains("vncPassword")) { ++ return mVinoGsettings->get(kVncPwdKey).toString(); ++ } else { ++ qCritical() << "mVinoGsettings not contains the key: " << kVncPwdKey; ++ } ++ return QString(); ++} ++ ++bool VinoInterface::getVinoServerStatus() ++{ ++ QProcess process; ++ process.start("systemctl", QStringList() << "--user" << "is-active" << "vino-server.service"); ++ process.waitForFinished(); ++ bool isActive = process.readAllStandardOutput().replace("\n", "") == "active"; ++ return isActive; ++} ++ ++bool VinoInterface::getVinoStatus() ++{ ++ if (mUkuiVinoGsettings->keys().contains("vinoEnabled")) { ++ return mUkuiVinoGsettings->get(kVinoEnableKey).toBool(); ++ } else { ++ qCritical() << "mUkuiVinoGsettings not contains the key: " << kVinoEnableKey; ++ } ++ return false; ++} ++ ++bool VinoInterface::getXrdpStatus() ++{ ++ if (mUkuiVinoGsettings->keys().contains("xrdpEnabled")) { ++ return mUkuiVinoGsettings->get(kXrdpEnableKey).toBool(); ++ } else { ++ qCritical() << "mUkuiVinoGsettings not contains the key: " << kXrdpEnableKey; ++ } ++ return false; ++} ++ ++bool VinoInterface::getEnableStatus() ++{ ++ if (mUkuiVinoGsettings->keys().contains("enabled")) { ++ return mUkuiVinoGsettings->get(kEnableKey).toBool(); ++ } else { ++ qCritical() << "mUkuiVinoGsettings not contains the key: " << kEnableKey; ++ } ++ return false; ++} ++ ++void VinoInterface::setVinoKey(const QString &key, bool value) ++{ ++ if (mVinoGsettings->keys().contains(mGsettingMap[key])) { ++ return mVinoGsettings->set(key, value); ++ } else { ++ qCritical() << "mVinoGsettings not contains the key: " << key; ++ } ++ ++ if (mUkuiVinoGsettings->keys().contains(mGsettingMap[key])) { ++ return mUkuiVinoGsettings->set(key, value); ++ } else { ++ qCritical() << "mUkuiVinoGsettings not contains the key: " << key; ++ } ++} ++ ++void VinoInterface::setVinoKey(const QString &key, QString value) ++{ ++ if (mVinoGsettings->keys().contains(mGsettingMap[key])) { ++ return mVinoGsettings->set(key, value); ++ } else { ++ qCritical() << "ukuiNoticeGsettings not contains the key: " << key; ++ } ++} ++ ++void VinoInterface::setVinoKey(const QString &key, QByteArray value) ++{ ++ if (mVinoGsettings->keys().contains(mGsettingMap[key])) { ++ return mVinoGsettings->set(key, value); ++ } else { ++ qCritical() << "ukuiNoticeGsettings not contains the key: " << key; ++ } ++} +diff --git a/registeredSession/plugins/vino/vinointerface.h b/registeredSession/plugins/vino/vinointerface.h +new file mode 100644 +index 0000000..2691edb +--- /dev/null ++++ b/registeredSession/plugins/vino/vinointerface.h +@@ -0,0 +1,56 @@ ++#ifndef VINOINTERFACE_H ++#define VINOINTERFACE_H ++ ++#include <QObject> ++#include <QDBusArgument> ++#include <QVariant> ++#include <QDBusMetaType> ++#include <QGSettings> ++#include "../../universalinterface.h" ++ ++class VinoInterface : public QObject ++{ ++ Q_OBJECT ++ Q_CLASSINFO("D-Bus Interface", "org.ukui.ukcc.session.Vino") ++ Q_PROPERTY(bool isViewOnly READ getViewOnly) ++ Q_PROPERTY(bool isPrompt READ getPromptEnabled) ++ Q_PROPERTY(QString method READ getMethod) ++ Q_PROPERTY(QString password READ getPassword) ++ Q_PROPERTY(bool isActive READ getVinoServerStatus) ++ Q_PROPERTY(bool isVino READ getVinoStatus) ++ Q_PROPERTY(bool isXrdp READ getXrdpStatus) ++ Q_PROPERTY(bool isEnable READ getEnableStatus) ++ ++public: ++ VinoInterface(); ++ ++protected: ++ bool getViewOnly(); ++ bool getPromptEnabled(); ++ QString getMethod(); ++ QString getPassword(); ++ bool getVinoServerStatus(); ++ bool getVinoStatus(); ++ bool getXrdpStatus(); ++ bool getEnableStatus(); ++ ++public Q_SLOTS: ++ void setVinoKey(const QString &key, bool value); ++ void setVinoKey(const QString &key, QString value); ++ void setVinoKey(const QString &key, QByteArray value); ++ ++private: ++ const QString kEnableKey = "enabled"; ++ const QString kXrdpEnableKey = "xrdp-enabled"; ++ const QString kVinoEnableKey = "vino-enabled"; ++ const QString kVinoViewOnlyKey = "view-only"; ++ const QString kVinoPromptKey = "prompt-enabled"; ++ const QString kAuthenticationKey = "authentication-methods"; ++ const QString kVncPwdKey = "vnc-password"; ++ ++ QGSettings *mVinoGsettings = nullptr; ++ QGSettings *mUkuiVinoGsettings = nullptr; ++ QMap <QString, QString> mGsettingMap; ++}; ++ ++#endif // VINOINTERFACE_H +diff --git a/registeredSession/registeredSession.pro b/registeredSession/registeredSession.pro +index b1420dd..a2e7b05 100644 +--- a/registeredSession/registeredSession.pro ++++ b/registeredSession/registeredSession.pro +@@ -53,6 +53,7 @@ SOURCES += \ + plugins/shortcut/getshortcutworker.cpp \ + plugins/shortcut/shortcutinterface.cpp \ + plugins/wallpaper/wallpaperinterface.cpp \ ++ plugins/vino/vinointerface.cpp \ + plugins/wallpaper/workerobject.cpp \ + plugins/wallpaper/xmlhandle.cpp \ + ukccsessionserver.cpp \ +@@ -77,6 +78,7 @@ HEADERS += \ + plugins/shortcut/shortcutinterface.h \ + plugins/shortcut/type.h \ + plugins/wallpaper/wallpaperinterface.h \ ++ plugins/vino/vinointerface.h \ + plugins/wallpaper/workerobject.h \ + plugins/wallpaper/xmlhandle.h \ + screenStruct.h \ diff -Nru ukui-control-center-4.10.0.0/debian/patches/0123-fix-ukui-control-center-display-add-log.patch ukui-control-center-4.10.0.0/debian/patches/0123-fix-ukui-control-center-display-add-log.patch --- ukui-control-center-4.10.0.0/debian/patches/0123-fix-ukui-control-center-display-add-log.patch 1970-01-01 08:00:00.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/0123-fix-ukui-control-center-display-add-log.patch 2025-01-01 16:22:05.000000000 +0800 @@ -0,0 +1,60 @@ +From: susidian <susidian@kylinos.cn> +Date: Thu, 16 Jan 2025 14:18:06 +0800 +Subject: fix(ukui-control-center): display add log +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Description: 添加debug日志 + +Log: 添加debug日志 +--- + plugins/system/display/widget.cpp | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/plugins/system/display/widget.cpp b/plugins/system/display/widget.cpp +index 43275c3..a44ca18 100644 +--- a/plugins/system/display/widget.cpp ++++ b/plugins/system/display/widget.cpp +@@ -202,6 +202,7 @@ void Widget::setConfig(const KScreen::ConfigPtr &config) + mConfig = config; + mPrevConfig = config->clone(); + if (mMultiScreenFrame) { ++ qDebug() << Q_FUNC_INFO << "connetedOutputs count" << mConfig->connectedOutputs().size(); + mMultiScreenFrame->setVisible(mConfig->connectedOutputs().size() > 1); + } + updateMultiScreen(); +@@ -527,7 +528,7 @@ void Widget::slotUnifyOutputs() + if (!mIscloneMode) { + + unifySetconfig = true; +- ++ qDebug() << Q_FUNC_INFO << "is not clone Mode, setConfig"; + setConfig(mPrevConfig); + + monitorComboBox->setEnabled(isExtendMode); +@@ -1053,6 +1054,7 @@ int Widget::updateScreenConfig() + auto *preOp = new KScreen::GetConfigOperation(); + preOp->exec(); + mPrevConfig = preOp->config()->clone(); //重新获取屏幕当前状态,通过mconfig未必能获取到正确的状态 ++ qDebug() << Q_FUNC_INFO << "updateScreenConfig connectedOutput count" << mPrevConfig->connectedOutputs().size(); + preOp->deleteLater(); + return 0; + } +@@ -1870,6 +1872,7 @@ void Widget::usdScreenModeChangedSlot(int status) + mIscloneMode = false; + } + ++ qDebug() << Q_FUNC_INFO << "screenMode" << status << "mIscloneMode:" << mIscloneMode; + int time = 1500; + if (mIscloneMode) { + time = 0; +@@ -1972,7 +1975,7 @@ void Widget::initConnection() + }); + + connect(mTemptWidget, &SliderWidget::valueChanged, this, [=]{ +- qDebug() << Q_FUNC_INFO << "susidian valueChanged" << mTemptWidget->value(); ++ qDebug() << Q_FUNC_INFO << "TemptWidget valueChanged" << mTemptWidget->value(); + if (m_colorSettings) { + m_colorSettings->set(NIGHT_TEMPERATURE_KEY, mTemptWidget->value()); + } else { diff -Nru ukui-control-center-4.10.0.0/debian/patches/series ukui-control-center-4.10.0.0/debian/patches/series --- ukui-control-center-4.10.0.0/debian/patches/series 2024-12-13 15:51:13.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/patches/series 2025-01-01 16:22:05.000000000 +0800 @@ -98,3 +98,26 @@ 0098-106-293035.patch 0099-109-291097-UI.patch 0100-111-396109-2024-OEM-launchpad.patch +0101-113.patch +0102-114-issue-IB1REM-ARM.patch +0103-118-291281.patch +0104-120-380937-2024-OEM-v11-2501.patch +0105-121-310473.patch +0106-122-md.patch +0107-123-291357-100.patch +0108-124-bug.patch +0109-125-277741.patch +0110-chore-changelog.patch +0111-128-316417.patch +0112-fix-theme.patch +0113-fix-theme.patch +0114-127-bug.patch +0115-131-290807.patch +0116-chore-md.patch +0117-133-v11-2501.patch +0118-135-291185.patch +0119-139-bug.patch +0120-140-fix-panel-bug-278913.patch +0121-141-380937-2024-OEM-v11-2501.patch +0122-142-vino.patch +0123-fix-ukui-control-center-display-add-log.patch diff -Nru ukui-control-center-4.10.0.0/debian/source/include-binaries ukui-control-center-4.10.0.0/debian/source/include-binaries --- ukui-control-center-4.10.0.0/debian/source/include-binaries 2024-12-13 15:51:13.000000000 +0800 +++ ukui-control-center-4.10.0.0/debian/source/include-binaries 2025-01-01 16:22:05.000000000 +0800 @@ -20,3 +20,7 @@ debian/patches/0089-84-fix-Update-the-sound-section-of-the-user-manual.patch debian/patches/0093-99-update-user-guide-IAO24O-I8VNES-I8VNES.patch debian/patches/0095-102-bug.patch +debian/patches/0103-118-291281.patch +debian/patches/0106-122-md.patch +debian/patches/0116-chore-md.patch +debian/patches/0120-140-fix-panel-bug-278913.patch