Repository navigation
Fix: [ops-log] Log file missing. - #411
Closed
GongHeng2017 wants to merge 1 commit into
Closed
GongHeng2017 wants to merge 1 commit into
GongHeng2017 wants to merge 1 commit into
Conversation
-- some platform not export system_info.txt Log: fix issue Bug: https://pms.uniontech.com/bug-view-335855.html
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017 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 |
deepin pr auto review这段代码是关于DLDBusHandler类中exportOpsLog方法的DBus调用部分。让我对这段代码进行审查:
改进建议:
const int EXPORT_OPS_LOG_TIMEOUT_MS = 1200000;
// ...
QDBusMessage reply = QDBusConnection::systemBus().call(message, QDBus::Block, EXPORT_OPS_LOG_TIMEOUT_MS);
if (reply.type() == QDBusMessage::ErrorMessage) {
qCritical(logDBusHandler) << "call dbus interface 'exportHwOpsLog' failed. error info:" << reply.errorMessage();
return false;
} else if (reply.type() == QDBusMessage::InvalidMessage) {
qCritical(logDBusHandler) << "Received invalid D-Bus reply";
return false;
}
if (reply.type() == QDBusMessage::ReplyMessage) {
// 检查返回值是否符合预期
if (reply.arguments().isEmpty()) {
qWarning(logDBusHandler) << "DBus call returned no arguments";
return false;
}
// 处理返回值...
}
qDebug(logDBusHandler) << "Starting exportOpsLog D-Bus call with output directory:" << outDir;
// 在类中定义
const int DEFAULT_EXPORT_OPS_LOG_TIMEOUT_MS = 1200000;
// 在方法中使用
QDBusMessage reply = QDBusConnection::systemBus().call(message, QDBus::Block, m_exportOpsLogTimeoutMs);这些改进可以提高代码的可维护性、可读性和健壮性,同时保持原有功能不变。 |
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.
-- some platform not export system_info.txt
Log: fix issue
Bug: https://pms.uniontech.com/bug-view-335855.html