X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fshortcutsmodel.cpp;h=25d11848fd399f32abddc60e82e51aeed983d804;hb=4e51500401db3c85dbe5e92e5e5c15b6e3c87787;hp=0cf3f5e2f8f0dd77f3e04d8851d6bcff0c5c0ffb;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;p=quassel.git diff --git a/src/qtui/settingspages/shortcutsmodel.cpp b/src/qtui/settingspages/shortcutsmodel.cpp index 0cf3f5e2..25d11848 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-2020 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);