X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Ftreemodel.cpp;h=507a5daf225f8e9df627482f9f6a9da172632b40;hb=61f33c7895e324f6e95034d86897ad2e963653f1;hp=486ed6c9fdcf1ad2f4267eda2a9373373598c172;hpb=e2188dc438be6f3eb0d9cdf47d28821aefe9835e;p=quassel.git diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index 486ed6c9..507a5daf 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -323,16 +323,16 @@ TreeModel::TreeModel(const QList &data, QObject *parent) connectItem(rootItem); if (Quassel::isOptionSet("debugmodel")) { - connect(this, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), - this, SLOT(debug_rowsAboutToBeInserted(const QModelIndex &, int, int))); - connect(this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), - this, SLOT(debug_rowsAboutToBeRemoved(const QModelIndex &, int, int))); - connect(this, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(debug_rowsInserted(const QModelIndex &, int, int))); - connect(this, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), - this, SLOT(debug_rowsRemoved(const QModelIndex &, int, int))); - connect(this, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(debug_dataChanged(const QModelIndex &, const QModelIndex &))); + connect(this, &QAbstractItemModel::rowsAboutToBeInserted, + this, &TreeModel::debug_rowsAboutToBeInserted); + connect(this, &QAbstractItemModel::rowsAboutToBeRemoved, + this, &TreeModel::debug_rowsAboutToBeRemoved); + connect(this, &QAbstractItemModel::rowsInserted, + this, &TreeModel::debug_rowsInserted); + connect(this, &QAbstractItemModel::rowsRemoved, + this, &TreeModel::debug_rowsRemoved); + connect(this, &QAbstractItemModel::dataChanged, + this, &TreeModel::debug_dataChanged); } } @@ -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); } @@ -497,18 +497,18 @@ void TreeModel::itemDataChanged(int column) void TreeModel::connectItem(AbstractTreeItem *item) { - connect(item, SIGNAL(dataChanged(int)), - this, SLOT(itemDataChanged(int))); + connect(item, &AbstractTreeItem::dataChanged, + this, &TreeModel::itemDataChanged); - connect(item, SIGNAL(beginAppendChilds(int, int)), - this, SLOT(beginAppendChilds(int, int))); - connect(item, SIGNAL(endAppendChilds()), - this, SLOT(endAppendChilds())); + connect(item, &AbstractTreeItem::beginAppendChilds, + this, &TreeModel::beginAppendChilds); + connect(item, &AbstractTreeItem::endAppendChilds, + this, &TreeModel::endAppendChilds); - connect(item, SIGNAL(beginRemoveChilds(int, int)), - this, SLOT(beginRemoveChilds(int, int))); - connect(item, SIGNAL(endRemoveChilds()), - this, SLOT(endRemoveChilds())); + connect(item, &AbstractTreeItem::beginRemoveChilds, + this, &TreeModel::beginRemoveChilds); + connect(item, &AbstractTreeItem::endRemoveChilds, + this, &TreeModel::endRemoveChilds); }