#include "viewmodes/viewsettingspage.h"
#include "trash/trashsettingspage.h"
+#include <KAuthorized>
#include <KWindowConfig>
#include <KLocalizedString>
#include <QIcon>
connect(servicesSettingsPage, &ServicesSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// Trash
- TrashSettingsPage* trashSettingsPage = new TrashSettingsPage(this);
- KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage,
- i18nc("@title:group", "Trash"));
- trashSettingsFrame->setIcon(QIcon::fromTheme(QStringLiteral("trash-empty")));
- connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
+ auto* trashSettingsPage = createTrashSettingsPage(this);
+ if (trashSettingsPage) {
+ KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage,
+ i18nc("@title:group", "Trash"));
+ trashSettingsFrame->setIcon(QIcon::fromTheme(QStringLiteral("trash-empty")));
+ connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
+ }
// General
GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(url, this);
}
}
+SettingsPageBase *DolphinSettingsDialog::createTrashSettingsPage(QWidget *parent)
+{
+ if (!KAuthorized::authorizeControlModule(QStringLiteral("kcmtrash.desktop"))) {
+ return nullptr;
+ }
+
+ return new TrashSettingsPage(parent);
+}