-
Notifications
You must be signed in to change notification settings - Fork 80
pick v20 to v25 #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pick v20 to v25 #782
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)));
// 其他清理操作...
}这些改进将使代码更加健壮、可维护,并提高其安全性和性能。 |
|
[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 |
|
/merge |
pick v20 to v25