fix: Fix user operation write log while confirm dialog message has "\n".

This commit is contained in:
sunwen
2024-09-23 15:44:03 +08:00
parent 37b67b99da
commit 5d02c34fba

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() {