Changeset View
Changeset View
Standalone View
Standalone View
solid-device-automounter/kcm/DeviceAutomounterKCM.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 46 | { | |||
---|---|---|---|---|---|
58 | 58 | | |||
59 | addConfig(m_settings, this); | 59 | addConfig(m_settings, this); | ||
60 | 60 | | |||
61 | deviceView->setModel(m_devices); | 61 | deviceView->setModel(m_devices); | ||
62 | 62 | | |||
63 | deviceView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); | 63 | deviceView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); | ||
64 | deviceView->header()->setSectionResizeMode(0, QHeaderView::Stretch); | 64 | deviceView->header()->setSectionResizeMode(0, QHeaderView::Stretch); | ||
65 | 65 | | |||
66 | auto emitChanged = [this] { | 66 | connect(kcfg_AutomountOnLogin, &QCheckBox::stateChanged, this, [this](int state) { | ||
67 | m_devices->setAutomaticMountOnLogin(kcfg_AutomountOnLogin->isChecked()); | 67 | m_devices->setAutomaticMountOnLogin(state == Qt::Checked); | ||
68 | m_devices->setAutomaticMountOnPlugin(kcfg_AutomountOnPlugin->isChecked()); | 68 | }); | ||
69 | emit markAsChanged(); | 69 | connect(kcfg_AutomountOnPlugin, &QCheckBox::stateChanged, this, [this](int state) { | ||
ervin: ditto | |||||
70 | }; | 70 | m_devices->setAutomaticMountOnPlugin(state == Qt::Checked); | ||
71 | 71 | }); | |||
ervin: Missing this as third parameter | |||||
72 | connect(m_devices, &DeviceModel::dataChanged, this, emitChanged); | | |||
73 | 72 | | |||
74 | connect(deviceView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &DeviceAutomounterKCM::updateForgetDeviceButton); | 73 | connect(deviceView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &DeviceAutomounterKCM::updateForgetDeviceButton); | ||
75 | 74 | | |||
76 | connect(forgetDevice, &QAbstractButton::clicked, this, &DeviceAutomounterKCM::forgetSelectedDevices); | 75 | connect(forgetDevice, &QAbstractButton::clicked, this, &DeviceAutomounterKCM::forgetSelectedDevices); | ||
77 | 76 | | |||
78 | forgetDevice->setEnabled(false); | 77 | forgetDevice->setEnabled(false); | ||
79 | } | 78 | } | ||
80 | 79 | | |||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |
ditto