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 <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Eike Ziller
2024-04-29 14:21:26 +02:00
parent 7a47cf0a11
commit ae4c893301

View File

@@ -216,8 +216,10 @@ 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")),
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();