diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-21 13:13:50 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-02-22 20:51:21 +0000 |
commit | a889451d21289ef454a7b8d40adc6e115a15407f (patch) | |
tree | f380799cef361f3025547602f68ee115efaee501 | |
parent | 9cab0c178f5ae6795b0aafa21d28b8ef227d7de4 (diff) |
Qt Designer: Fix mismatched slashes when writing backup files
Use a forward slash for the file name and native separators
for the message.
Task-number: QTBUG-122616
Change-Id: I6b0b7d84b58c600654ad11ac625906ac47259357
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 2488f8360aa6ac4fd758a339d4b2457c4ee5718c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/designer/src/designer/qdesigner_actions.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index 67f920a2b..1044658d6 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -1041,9 +1041,7 @@ void QDesignerActions::backupForms() QDesignerFormWindow *fw = m_workbench->formWindow(i); QDesignerFormWindowInterface *fwi = fw->editor(); - QString formBackupName; - QTextStream(&formBackupName) << m_backupPath << QDir::separator() - << "backup" << i << ".bak"; + QString formBackupName = m_backupPath + "/backup"_L1 + QString::number(i) + ".bak"_L1; QString fwn = QDir::toNativeSeparators(fwi->fileName()); if (fwn.isEmpty()) @@ -1061,7 +1059,9 @@ void QDesignerActions::backupForms() const QByteArray utf8Array = contents.toUtf8(); if (file.write(utf8Array, utf8Array.size()) != utf8Array.size()) { backupMap.remove(fwn); - qdesigner_internal::designerWarning(tr("The backup file %1 could not be written.").arg(file.fileName())); + qdesigner_internal::designerWarning(tr("The backup file %1 could not be written: %2"). + arg(QDir::toNativeSeparators(file.fileName()), + file.errorString())); } else tmpFiles.append(formBackupName); |