From 76beda113e0edda7a67b61869da7fa9f0d50cde4 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Mon, 13 Apr 2026 12:15:17 +0200 Subject: [PATCH] Konstruktor: setDirty(false) am Ende, statt setDirty(true) via onShareToggled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verhindert dass das Öffnen des Properties-Dialogs als ungespeicherte Änderung interpretiert wird. KDE rief sonst applyChanges() auf allen Plugins auf, was z.B. das parallel installierte SMB-Plugin dazu brachte, seine User-Berechtigungen mit dem Default 'Everyone:R' zu überschreiben. Co-Authored-By: Claude Opus 4.6 (1M context) --- kf5/src/ftpshareplugin.cpp | 9 +++++++-- kf6/src/ftpshareplugin.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/kf5/src/ftpshareplugin.cpp b/kf5/src/ftpshareplugin.cpp index 35ec550..c48f4aa 100644 --- a/kf5/src/ftpshareplugin.cpp +++ b/kf5/src/ftpshareplugin.cpp @@ -205,8 +205,13 @@ FtpSharePlugin::FtpSharePlugin(QObject *parent, const QVariantList &args) // Load existing share info loadCurrentShare(); - // Initial UI state - onShareToggled(m_shareCheckBox->isChecked()); + // Initial UI state — apply enabled/disabled without marking dirty + m_nameEdit->setEnabled(m_shareCheckBox->isChecked()); + m_usersWidget->setEnabled(m_shareCheckBox->isChecked()); + + // Reset dirty after all initial setup so opening the dialog doesn't + // trigger applyChanges() on this or other plugins. + setDirty(false); // Add the page as a tab properties->addPage(m_page, i18n("FTP")); diff --git a/kf6/src/ftpshareplugin.cpp b/kf6/src/ftpshareplugin.cpp index 35ec550..c48f4aa 100644 --- a/kf6/src/ftpshareplugin.cpp +++ b/kf6/src/ftpshareplugin.cpp @@ -205,8 +205,13 @@ FtpSharePlugin::FtpSharePlugin(QObject *parent, const QVariantList &args) // Load existing share info loadCurrentShare(); - // Initial UI state - onShareToggled(m_shareCheckBox->isChecked()); + // Initial UI state — apply enabled/disabled without marking dirty + m_nameEdit->setEnabled(m_shareCheckBox->isChecked()); + m_usersWidget->setEnabled(m_shareCheckBox->isChecked()); + + // Reset dirty after all initial setup so opening the dialog doesn't + // trigger applyChanges() on this or other plugins. + setDirty(false); // Add the page as a tab properties->addPage(m_page, i18n("FTP"));