fix: Fix confirm dialog when message has "\n".

This commit is contained in:
sunwen
2024-09-23 15:38:17 +08:00
parent e8f3e7aaed
commit 6766f46aa6
2 changed files with 38 additions and 38 deletions

View File

@@ -68,7 +68,8 @@ void UserOperationLog::log(const QString& aOperationText)
QDateTime now = QDateTime::currentDateTime();
AppGlobalValues::setLastOperationTime(now);
QString UserName = (!User::Current() || User::Current()->getUserCode().isEmpty())?"anonymous":User::Current()->getUserCode();
out << now.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<UserName<<"\t"<<aOperationText<<endl;
QString operationText = aOperationText;
out << now.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<UserName<<"\t"<<operationText.replace("\n","\\n")<<endl;
}
void UserOperationLog::reloadFile() {