From d8a37114ebeacb5200c02bb594fdfd5456f30fcc Mon Sep 17 00:00:00 2001 From: momen Date: Tue, 23 Sep 2025 13:42:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E4=BD=86=E6=98=BE=E7=A4=BA=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp index bf0d8ad..d417f20 100644 --- a/src/utils/utils.cpp +++ b/src/utils/utils.cpp @@ -361,6 +361,14 @@ bool Utils::exportLogs(const QString &targetPath) bool success = QFile::copy(logFilePath, targetLogPath); + // 额外检查:即使QFile::copy返回false,也要检查目标文件是否实际存在且大小合理 + if (!success) { + QFileInfo targetFileInfo(targetLogPath); + if (targetFileInfo.exists() && targetFileInfo.size() > 0) { + success = true; + } + } + if (success) { writeLog("INFO", QString("Logs exported to: %1").arg(targetLogPath)); } else {