#include <QVBoxLayout>
namespace {
+ const bool ConfirmEmptyTrash = true;
const bool ConfirmTrash = false;
const bool ConfirmDelete = true;
const bool ConfirmScriptExecution = true;
ConfirmationsSettingsPage::ConfirmationsSettingsPage(QWidget* parent) :
SettingsPageBase(parent),
m_confirmMoveToTrash(nullptr),
+ m_confirmEmptyTrash(nullptr),
m_confirmDelete(nullptr),
m_confirmClosingMultipleTabs(nullptr)
{
m_confirmMoveToTrash = new QCheckBox(i18nc("@option:check Ask for confirmation when",
"Moving files or folders to trash"), this);
+ m_confirmEmptyTrash = new QCheckBox(i18nc("@option:check Ask for confirmation when",
+ "Emptying trash"), this);
m_confirmDelete = new QCheckBox(i18nc("@option:check Ask for confirmation when",
"Deleting files or folders"), this);
m_confirmScriptExecution = new QCheckBox(i18nc("@option:check Ask for confirmation when",
topLayout->addWidget(confirmLabelKde);
topLayout->addWidget(m_confirmMoveToTrash);
+ topLayout->addWidget(m_confirmEmptyTrash);
topLayout->addWidget(m_confirmDelete);
topLayout->addWidget(m_confirmScriptExecution);
topLayout->addWidget(confirmLabelDolphin);
loadSettings();
connect(m_confirmMoveToTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
+ connect(m_confirmEmptyTrash, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
connect(m_confirmDelete, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
connect(m_confirmScriptExecution, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
connect(m_confirmClosingMultipleTabs, &QCheckBox::toggled, this, &ConfirmationsSettingsPage::changed);
KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals);
KConfigGroup confirmationGroup(kioConfig, "Confirmations");
confirmationGroup.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked());
+ confirmationGroup.writeEntry("ConfirmEmptyTrash", m_confirmEmptyTrash->isChecked());
confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked());
confirmationGroup.sync();
settings->useDefaults(false);
m_confirmMoveToTrash->setChecked(ConfirmTrash);
+ m_confirmEmptyTrash->setChecked(ConfirmEmptyTrash);
m_confirmDelete->setChecked(ConfirmDelete);
m_confirmScriptExecution->setChecked(ConfirmScriptExecution);
}
KSharedConfig::Ptr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::IncludeGlobals);
const KConfigGroup confirmationGroup(kioConfig, "Confirmations");
m_confirmMoveToTrash->setChecked(confirmationGroup.readEntry("ConfirmTrash", ConfirmTrash));
+ m_confirmEmptyTrash->setChecked(confirmationGroup.readEntry("ConfirmEmptyTrash", ConfirmEmptyTrash));
m_confirmDelete->setChecked(confirmationGroup.readEntry("ConfirmDelete", ConfirmDelete));
const KConfigGroup scriptExecutionGroup(KSharedConfig::openConfig(QStringLiteral("kiorc")), "Executable scripts");