Commit d008de57 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Extract method

parent 26803c41
Pipeline #100206 canceled with stage
......@@ -85,7 +85,8 @@ SettingsDialog::SettingsDialog(const KSharedConfigPtr &config, UnifiedMailboxMan
auto removeButton = new QPushButton(QIcon::fromTheme(QStringLiteral("list-remove-symbolic")), i18n("Remove"));
removeButton->setEnabled(false);
v->addWidget(removeButton);
connect(removeButton, &QPushButton::clicked, this, [this, view]() {
const auto removeMailBox = [this, view]() {
const auto indexes = view->selectionModel()->selectedIndexes();
if (!indexes.isEmpty()) {
auto item = mBoxModel->itemFromIndex(indexes[0]);
......@@ -101,7 +102,8 @@ SettingsDialog::SettingsDialog(const KSharedConfigPtr &config, UnifiedMailboxMan
mBoxManager.saveBoxes();
}
}
});
};
connect(removeButton, &QPushButton::clicked, this, removeMailBox);
v->addStretch(1);
connect(view->selectionModel(), &QItemSelectionModel::selectionChanged, this, [view, editButton, removeButton]() {
......
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