From 90347161faa1d84cb116f4b1c6796bd9ea50dcd0 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 21 Sep 2012 10:32:08 +0200 Subject: [PATCH] Remove ambiguous argument to createIndex. Change-Id: I12cf8fe5b82f675a6c9dcaa628410fc066745bea Reviewed-by: Oswald Buddenhagen --- src/linguist/linguist/messagemodel.cpp | 18 +++++++++--------- src/qconfig/featuretreemodel.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/linguist/linguist/messagemodel.cpp b/src/linguist/linguist/messagemodel.cpp index 5740a54..cd1fe46 100644 --- a/src/linguist/linguist/messagemodel.cpp +++ b/src/linguist/linguist/messagemodel.cpp @@ -716,7 +716,7 @@ void MultiDataModel::append(DataModel *dm, bool readWrite) m_msgModel->beginInsertColumns(QModelIndex(), insCol, insCol); m_dataModels.append(dm); for (int j = 0; j < contextCount(); ++j) { - m_msgModel->beginInsertColumns(m_msgModel->createIndex(j, 0, 0), insCol, insCol); + m_msgModel->beginInsertColumns(m_msgModel->createIndex(j, 0), insCol, insCol); m_multiContextList[j].appendEmptyModel(); m_msgModel->endInsertColumns(); } @@ -739,7 +739,7 @@ void MultiDataModel::append(DataModel *dm, bool readWrite) } if (!appendItems.isEmpty()) { int msgCnt = mc->messageCount(); - m_msgModel->beginInsertRows(m_msgModel->createIndex(mcx, 0, 0), + m_msgModel->beginInsertRows(m_msgModel->createIndex(mcx, 0), msgCnt, msgCnt + appendItems.size() - 1); mc->appendMessageItems(appendItems); m_msgModel->endInsertRows(); @@ -775,7 +775,7 @@ void MultiDataModel::close(int model) int delCol = model + 1; m_msgModel->beginRemoveColumns(QModelIndex(), delCol, delCol); for (int i = m_multiContextList.size(); --i >= 0;) { - m_msgModel->beginRemoveColumns(m_msgModel->createIndex(i, 0, 0), delCol, delCol); + m_msgModel->beginRemoveColumns(m_msgModel->createIndex(i, 0), delCol, delCol); m_multiContextList[i].removeModel(model); m_msgModel->endRemoveColumns(); } @@ -784,7 +784,7 @@ void MultiDataModel::close(int model) emit modelDeleted(model); for (int i = m_multiContextList.size(); --i >= 0;) { MultiContextItem &mc = m_multiContextList[i]; - QModelIndex contextIdx = m_msgModel->createIndex(i, 0, 0); + QModelIndex contextIdx = m_msgModel->createIndex(i, 0); for (int j = mc.messageCount(); --j >= 0;) if (mc.multiMessageItem(j)->isEmpty()) { m_msgModel->beginRemoveRows(contextIdx, j, j); @@ -1184,7 +1184,7 @@ MessageModel::MessageModel(QObject *parent, MultiDataModel *data) QModelIndex MessageModel::index(int row, int column, const QModelIndex &parent) const { if (!parent.isValid()) - return createIndex(row, column, 0); + return createIndex(row, column); if (!parent.internalId()) return createIndex(row, column, parent.row() + 1); return QModelIndex(); @@ -1193,19 +1193,19 @@ QModelIndex MessageModel::index(int row, int column, const QModelIndex &parent) QModelIndex MessageModel::parent(const QModelIndex& index) const { if (index.internalId()) - return createIndex(index.internalId() - 1, 0, 0); + return createIndex(index.internalId() - 1, 0); return QModelIndex(); } void MessageModel::multiContextItemChanged(const MultiDataIndex &index) { - QModelIndex idx = createIndex(index.context(), m_data->modelCount() + 2, 0); + QModelIndex idx = createIndex(index.context(), m_data->modelCount() + 2); emit dataChanged(idx, idx); } void MessageModel::contextItemChanged(const MultiDataIndex &index) { - QModelIndex idx = createIndex(index.context(), index.model() + 1, 0); + QModelIndex idx = createIndex(index.context(), index.model() + 1); emit dataChanged(idx, idx); } @@ -1218,7 +1218,7 @@ void MessageModel::messageItemChanged(const MultiDataIndex &index) QModelIndex MessageModel::modelIndex(const MultiDataIndex &index) { if (index.message() < 0) // Should be unused case - return createIndex(index.context(), index.model() + 1, 0); + return createIndex(index.context(), index.model() + 1); return createIndex(index.message(), index.model() + 1, index.context() + 1); } diff --git a/src/qconfig/featuretreemodel.cpp b/src/qconfig/featuretreemodel.cpp index dd03d00..848afa0 100644 --- a/src/qconfig/featuretreemodel.cpp +++ b/src/qconfig/featuretreemodel.cpp @@ -189,7 +189,7 @@ QModelIndex FeatureTreeModel::index(int row, int column, { if (!parent.isValid()) { // index is a section if (row < sections.size() && column == 0) - return QAbstractItemModel::createIndex(row, column, 0); + return QAbstractItemModel::createIndex(row, column); return QModelIndex(); } -- 2.7.4