From aa118539a41899f79a804341fd5695222b9fae74 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 26 Oct 2016 16:32:20 +0200 Subject: [PATCH] CMake: Fix warnings about cmake configuration model The index was handled wrongly. Change-Id: I8a98c7a16e32798a9b7662c6c5c1683d248580da Reviewed-by: Leena Miettinen Reviewed-by: Tim Jenssen --- src/plugins/cmakeprojectmanager/configmodel.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/configmodel.cpp b/src/plugins/cmakeprojectmanager/configmodel.cpp index 4ef34dd7fab..8516e3bc00b 100644 --- a/src/plugins/cmakeprojectmanager/configmodel.cpp +++ b/src/plugins/cmakeprojectmanager/configmodel.cpp @@ -44,17 +44,12 @@ ConfigModel::ConfigModel(QObject *parent) : QAbstractTableModel(parent) int ConfigModel::rowCount(const QModelIndex &parent) const { - QTC_ASSERT(parent.model() == nullptr || parent.model() == this, return 0); - if (parent.isValid()) - return 0; - return m_configuration.count(); + return parent.isValid() ? 0 : m_configuration.count(); } int ConfigModel::columnCount(const QModelIndex &parent) const { - QTC_ASSERT(!parent.isValid(), return 0); - QTC_ASSERT(parent.model() == nullptr, return 0); - return 3; + return parent.isValid() ? 0 : 3; } Qt::ItemFlags ConfigModel::flags(const QModelIndex &index) const