X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Ftreemodel.cpp;h=2a2ed857710504052cd176f583d22f379102011d;hp=19a68549d70905637c57469dcfb03bad88efc7d3;hb=f12dbcd32ef6eff25bd730444e5165935e6b0cf5;hpb=788fd0058595c815dc42597e9956c02aea45261f diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index 19a68549..2a2ed857 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -147,7 +147,7 @@ int AbstractTreeItem::row() const { return _parentItem->_childItems[column()].indexOf(const_cast(this)); } -AbstractTreeItem *AbstractTreeItem::parent() { +AbstractTreeItem *AbstractTreeItem::parent() const { return _parentItem; } @@ -380,14 +380,20 @@ QVariant TreeModel::headerData(int section, Qt::Orientation orientation, int rol void TreeModel::itemDataChanged(int column) { AbstractTreeItem *item = qobject_cast(sender()); - QModelIndex itemIndex; + QModelIndex leftIndex, rightIndex; - if(item == rootItem) - itemIndex = QModelIndex(); - else - itemIndex = createIndex(item->row(), column, item); + if(item == rootItem) + return; + + if(column == -1) { + leftIndex = createIndex(item->row(), 0, item); + rightIndex = createIndex(item->row(), item->columnCount(), item); + } else { + leftIndex = createIndex(item->row(), column, item); + rightIndex = leftIndex; + } - emit dataChanged(itemIndex, itemIndex); + emit dataChanged(leftIndex, rightIndex); } void TreeModel::appendChild(AbstractTreeItem *parent, AbstractTreeItem *child) {