Changeset View
Changeset View
Standalone View
Standalone View
kcms/keys/kglobalshortcutseditor.cpp
Show First 20 Lines • Show All 826 Lines • ▼ Show 20 Line(s) | 824 | void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::removeComponent( | |||
---|---|---|---|---|---|
827 | // TODO: Remove contexts too. | 827 | // TODO: Remove contexts too. | ||
828 | 828 | | |||
829 | Q_FOREACH (const QString &text, components.keys()) | 829 | Q_FOREACH (const QString &text, components.keys()) | ||
830 | { | 830 | { | ||
831 | if (components.value(text)->uniqueName() == componentUnique) | 831 | if (components.value(text)->uniqueName() == componentUnique) | ||
832 | { | 832 | { | ||
833 | // Remove from QComboBox | 833 | // Remove from QComboBox | ||
834 | QModelIndexList results = proxyModel->match(proxyModel->index(0, 0), Qt::DisplayRole, text); | 834 | QModelIndexList results = proxyModel->match(proxyModel->index(0, 0), Qt::DisplayRole, text); | ||
835 | Q_ASSERT(results.isEmpty()); | 835 | Q_ASSERT(!results.isEmpty()); | ||
836 | model->removeRow(proxyModel->mapToSource(results.first()).row()); | 836 | model->removeRow(proxyModel->mapToSource(results.first()).row()); | ||
837 | 837 | | |||
838 | // Remove from QStackedWidget | 838 | // Remove from QStackedWidget | ||
839 | stack->removeWidget(components[text]->editor()); | 839 | stack->removeWidget(components[text]->editor()); | ||
840 | 840 | | |||
841 | // Remove the componentData | 841 | // Remove the componentData | ||
842 | delete components.take(text); | 842 | delete components.take(text); | ||
843 | } | 843 | } | ||
844 | } | 844 | } | ||
845 | } | 845 | } | ||
846 | 846 | | |||
847 | 847 | |