From ae4c893301331bdfd6908ea0a5d17d30f05ab8a7 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 29 Apr 2024 14:21:26 +0200 Subject: [PATCH] Fix the directory opened when exporting coding styles On macOS. Make sure to use an absolute path for the file dialog. Fixes: QTCREATORBUG-28832 Change-Id: I75f4166ee2bc3238a01089231bde4cf990269024 Reviewed-by: Marcus Tillmanns Reviewed-by: --- src/plugins/texteditor/codestyleselectorwidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/codestyleselectorwidget.cpp b/src/plugins/texteditor/codestyleselectorwidget.cpp index ddeea0a74eb..5eb373f00f1 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.cpp +++ b/src/plugins/texteditor/codestyleselectorwidget.cpp @@ -216,9 +216,11 @@ void CodeStyleSelectorWidget::slotImportClicked() void CodeStyleSelectorWidget::slotExportClicked() { ICodeStylePreferences *currentPreferences = m_codeStyle->currentPreferences(); - const FilePath filePath = FileUtils::getSaveFilePath(this, Tr::tr("Export Code Style"), - FilePath::fromString(QString::fromUtf8(currentPreferences->id() + ".xml")), - Tr::tr("Code styles (*.xml);;All files (*)")); + const FilePath filePath = FileUtils::getSaveFilePath( + this, + Tr::tr("Export Code Style"), + FileUtils::homePath().pathAppended(QString::fromUtf8(currentPreferences->id() + ".xml")), + Tr::tr("Code styles (*.xml);;All files (*)")); if (!filePath.isEmpty()) { CodeStylePool *codeStylePool = m_codeStyle->delegatingPool(); codeStylePool->exportCodeStyle(filePath, currentPreferences);