kcms/rules: Fix import and export dialog

This commit is contained in:
Vlad Zahorodnii 2023-03-03 00:49:42 +02:00
parent a6457fda40
commit f16814811b

View file

@ -4,8 +4,9 @@
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/ */
import QtQuick 2.14 import QtCore
import QtQuick.Dialogs 1.0 as QtDialogs import QtQuick
import QtQuick.Dialogs as QtDialogs
Loader { Loader {
id: root id: root
@ -21,8 +22,8 @@ Loader {
id: fileDialog id: fileDialog
title: root.title title: root.title
selectExisting: !root.isSaveDialog fileMode: root.isSaveDialog ? FileDialog.SaveFile : FileDialog.OpenFile
folder: root.lastFolder || shortcuts.home currentFolder: root.lastFolder || StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
nameFilters: [ i18n("KWin Rules (*.kwinrule)") ] nameFilters: [ i18n("KWin Rules (*.kwinrule)") ]
defaultSuffix: "*.kwinrule" defaultSuffix: "*.kwinrule"
@ -31,9 +32,9 @@ Loader {
} }
onAccepted: { onAccepted: {
root.lastFolder = folder; root.lastFolder = currentFolder;
if (fileUrl != "") { if (selectedFile != "") {
root.fileSelected(fileUrl); root.fileSelected(selectedFile);
} }
root.active = false; root.active = false;
} }