Commit db311474 authored by David Edmundson's avatar David Edmundson
Browse files

Fix use of assert/crash when removing global shortcut

Summary:
I'm not the author, but it's pretty clear what the intention was.

We expect to get one result back from proxyModel->match
We use results.first(), so we want to check we have at least one entry.
The assert was written backwards

BUG: 387444

Test Plan: Can now remove a group without a crash

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11567
parent 8af970fd
......@@ -832,7 +832,7 @@ void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::removeComponent(
{
// Remove from QComboBox
QModelIndexList results = proxyModel->match(proxyModel->index(0, 0), Qt::DisplayRole, text);
Q_ASSERT(results.isEmpty());
Q_ASSERT(!results.isEmpty());
model->removeRow(proxyModel->mapToSource(results.first()).row());
// Remove from QStackedWidget
......
Supports Markdown
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