Commit aca698e4 authored by Méven Car's avatar Méven Car Committed by Méven Car

Solid-device-automounter/kcm: correctly update automountOn

Test Plan:
Open kcmshell5 device_automounter_kcm
Play with the checkbox "Automatically mount..." and see that the corresponding columns below are enabled/disabled.

Reviewers: bport, #plasma, ervin, crossi, hchain

Reviewed By: ervin

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27971
parent 43d5a183
......@@ -63,13 +63,12 @@ DeviceAutomounterKCM::DeviceAutomounterKCM(QWidget *parent, const QVariantList &
deviceView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
deviceView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
auto emitChanged = [this] {
m_devices->setAutomaticMountOnLogin(kcfg_AutomountOnLogin->isChecked());
m_devices->setAutomaticMountOnPlugin(kcfg_AutomountOnPlugin->isChecked());
emit markAsChanged();
};
connect(m_devices, &DeviceModel::dataChanged, this, emitChanged);
connect(kcfg_AutomountOnLogin, &QCheckBox::stateChanged, this, [this](int state) {
m_devices->setAutomaticMountOnLogin(state == Qt::Checked);
});
connect(kcfg_AutomountOnPlugin, &QCheckBox::stateChanged, this, [this](int state) {
m_devices->setAutomaticMountOnPlugin(state == Qt::Checked);
});
connect(deviceView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &DeviceAutomounterKCM::updateForgetDeviceButton);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment