X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fshortcutsmodel.cpp;h=fe93e6103dfb8234f951eff516e29cc7f4cfe498;hp=0cf3f5e2f8f0dd77f3e04d8851d6bcff0c5c0ffb;hb=HEAD;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650 diff --git a/src/qtui/settingspages/shortcutsmodel.cpp b/src/qtui/settingspages/shortcutsmodel.cpp index 0cf3f5e2..c9a3b0b5 100644 --- a/src/qtui/settingspages/shortcutsmodel.cpp +++ b/src/qtui/settingspages/shortcutsmodel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -77,19 +77,9 @@ QModelIndex ShortcutsModel::index(int row, int column, const QModelIndex& parent return createIndex(row, column, _categoryItems.at(row)); } -int ShortcutsModel::columnCount(const QModelIndex& parent) const +int ShortcutsModel::columnCount(const QModelIndex&) const { return 2; - if (!parent.isValid()) - return 2; - - auto* item = static_cast(parent.internalPointer()); - Q_ASSERT(item); - - if (!item->parentItem) - return 2; - - return 2; } int ShortcutsModel::rowCount(const QModelIndex& parent) const @@ -159,7 +149,7 @@ QVariant ShortcutsModel::data(const QModelIndex& index, int role) const return QVariant(); case ActionRole: - return QVariant::fromValue(action); + return QVariant::fromValue(action); case DefaultShortcutRole: return action->shortcut(Action::DefaultShortcut);