Gui: [skip ci] handle exception text as UTF-8 encoded string when saving failed

This commit is contained in:
wmayer
2021-09-29 14:03:51 +02:00
parent 7df49abba9
commit 5cff5654ca

View File

@@ -1167,7 +1167,7 @@ bool Document::save(void)
"or you do not have sufficient permissions, "
"or for other reasons. Error details:\n\n\"%1\"\n\n"
"Would you like to save the file with a different name?")
.arg(QString::fromLatin1(e.what())),
.arg(QString::fromUtf8(e.what())),
QMessageBox::Yes, QMessageBox::No);
if (ret == QMessageBox::No) {
// TODO: Understand what exactly is supposed to be returned here
@@ -1225,7 +1225,7 @@ bool Document::saveAs(void)
"or you do not have sufficient permissions, "
"or for other reasons. Error details:\n\n\"%1\"\n\n"
"Would you like to save the file with a different name?")
.arg(QString::fromLatin1(e.what())),
.arg(QString::fromUtf8(e.what())),
QMessageBox::Yes, QMessageBox::No);
if (ret == QMessageBox::No) {
// TODO: Understand what exactly is supposed to be returned here