X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Ftreemodel.cpp;h=314ec7f50c19f18bc20bff1dd176a6df079020df;hp=486ed6c9fdcf1ad2f4267eda2a9373373598c172;hb=98144aaad0cd747f186edcd0e36a1d67326ac766;hpb=e2188dc438be6f3eb0d9cdf47d28821aefe9835e diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index 486ed6c9..314ec7f5 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -352,7 +352,7 @@ AbstractTreeItem *TreeModel::root() const QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) const { if (row < 0 || row >= rowCount(parent) || column < 0 || column >= columnCount(parent)) - return QModelIndex(); + return {}; AbstractTreeItem *parentItem; @@ -366,7 +366,7 @@ QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) con if (childItem) return createIndex(row, column, childItem); else - return QModelIndex(); + return {}; } @@ -374,11 +374,11 @@ QModelIndex TreeModel::indexByItem(AbstractTreeItem *item) const { if (item == nullptr) { qWarning() << "TreeModel::indexByItem(AbstractTreeItem *item) received NULL-Pointer"; - return QModelIndex(); + return {}; } if (item == rootItem) - return QModelIndex(); + return {}; else return createIndex(item->row(), 0, item); } @@ -389,7 +389,7 @@ QModelIndex TreeModel::parent(const QModelIndex &index) const if (!index.isValid()) { // ModelTest does this // qWarning() << "TreeModel::parent(): has been asked for the rootItems Parent!"; - return QModelIndex(); + return {}; } auto *childItem = static_cast(index.internalPointer()); @@ -397,7 +397,7 @@ QModelIndex TreeModel::parent(const QModelIndex &index) const Q_ASSERT(parentItem); if (parentItem == rootItem) - return QModelIndex(); + return {}; return createIndex(parentItem->row(), 0, parentItem); }