pick v20 to v25#782
Merged
deepin-bot[bot] merged 5 commits intoDec 16, 2025
Merged
Conversation
fix the command line to show the window picture pick from: e037b93 Log: fix the command line to show the window picture Bug: https://pms.uniontech.com/bug-view-276289.html
fix the 'alt print' shotcut not quit pick from de3e5e6 Log: fix the 'alt print' shotcut not quit Bug: https://pms.uniontech.com/bug-view-279221.html
修复外接4K屏卡顿不流畅,使用update去更新界面而不是repaint pick from: b5c424c Log: 修复外接4K屏卡顿不流畅,使用update去更新界面而不是repaint Bug:https://pms.uniontech.com/bug-view-255835.html
fix dormant wake up screen jam during screen recording pick from: ed69c81 Log: fix dormant wake up screen jam during screen recording Bug: https://pms.uniontech.com/bug-view-280187.html
fix dormant wake up screen jam during screen recording pick form:73d63eeb3d741ec99e25eac26fef8602418a60a Log: fix dormant wake up screen jam during screen recording in sw military Bug: https://pms.uniontech.com/bug-view-280187.html
deepin pr auto review我来对这段代码进行审查:
(1) 代码注释问题: /**
* @brief onPowersource 监听锁屏,监听锁屏信号,在锁屏后结束录屏,包括休眠恢复后也会锁屏,也会结束录屏
* @param flag
*/注释中的函数名错误,应该是 onLockedStopRecord 而不是 onPowersource。参数说明也不准确,实际参数是 name、map 和 list,而不是 flag。 建议修改为: /**
* @brief onLockedStopRecord 监听锁屏信号,在锁屏后结束录屏
* @param name 接口名称
* @param map 属性映射表,包含Locked状态
* @param list 变更的属性列表
*/(2) 性能优化建议: QTimer::singleShot(10, [=] {
exitApp();
});使用10ms的延迟可能太短,建议适当延长到100ms,确保所有操作都完成: QTimer::singleShot(100, [=] {
exitApp();
});(3) 安全性考虑: void MainWindow::onLockedStopRecord(const QString &name, QVariantMap map, const QStringList &list)
{
qDebug() << "Locked will quit!"<<"----------------" << name << map << list;
if (map.value("Locked").value<bool>()) {
onExit();
}
}建议增加错误处理和空值检查: void MainWindow::onLockedStopRecord(const QString &name, QVariantMap map, const QStringList &list)
{
qCDebug(dsrApp) << "Locked will quit!" << name << map << list;
if (!map.contains("Locked")) {
qCWarning(dsrApp) << "No Locked property in the map";
return;
}
bool isLocked = map.value("Locked").toBool();
if (isLocked) {
onExit();
}
}(4) 架构相关代码优化: #if defined (__mips__) || defined (__aarch64__)建议使用更清晰的宏定义,并添加注释说明原因: #if defined (__mips__) || defined (__aarch64__)
// 在这些架构下使用repaint()会导致界面卡死
// 问题出现在1052U2、1070和1060等设备上
update();
#else
repaint();
#endif(5) 代码组织: void MainWindow::setupLockScreenMonitoring()
{
#if defined __sw_64__
if (DSysInfo::uosEditionType() == DSysInfo::UosEdition::UosMilitary) {
QDBusConnection::sessionBus().connect("com.deepin.SessionManager",
"/com/deepin/SessionManager",
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
this,
SLOT(onLockedStopRecord(QString, QVariantMap, QStringList)));
}
#endif
}(6) 错误处理: bool connected = QDBusConnection::sessionBus().connect(...);
if (!connected) {
qCWarning(dsrApp) << "Failed to connect to SessionManager for lock screen monitoring";
}(7) 资源清理: void MainWindow::exitApp()
{
QDBusConnection::sessionBus().disconnect("com.deepin.SessionManager",
"/com/deepin/SessionManager",
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
this,
SLOT(onLockedStopRecord(QString, QVariantMap, QStringList)));
// 其他清理操作...
}这些改进将使代码更加健壮、可维护,并提高其安全性和性能。 |
lzwind
approved these changes
Dec 16, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pick v20 to v25