Skip to content

Commit 34c0e2a

Browse files
authored
Fix Console output on save error (openscad#5637)
"File/Save As..." to a read-only directory can cause invalid characters to be written to the Console.
1 parent dd7286b commit 34c0e2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gui/TabManager.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,8 @@ bool TabManager::shouldClose()
618618

619619
void TabManager::saveError(const QIODevice& file, const std::string& msg, const QString& filepath)
620620
{
621-
const char *fileName = filepath.toLocal8Bit().constData();
622-
LOG("%1$s %2$s (%3$s)", msg.c_str(), fileName, file.errorString().toLocal8Bit().constData());
621+
const std::string fileName = filepath.toStdString();
622+
LOG("%1$s %2$s (%3$s)", msg.c_str(), fileName, file.errorString().toStdString());
623623

624624
const std::string dialogFormatStr = msg + "\n\"%1\"\n(%2)";
625625
const QString dialogFormat(dialogFormatStr.c_str());

0 commit comments

Comments
 (0)