X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Ftreemodel.cpp;h=a8cd86b79721223058a1f68d72f93ca1699428d7;hb=6bfa260800588318e5a7b17e3b9dbfaa67bba635;hp=f02f7317e28c61a064d6d1be35797c9099e46d25;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;p=quassel.git diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index f02f7317..a8cd86b7 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -275,21 +275,8 @@ int SimpleTreeItem::columnCount() const /***************************************** * PropertyMapItem *****************************************/ -PropertyMapItem::PropertyMapItem(const QStringList &propertyOrder, AbstractTreeItem *parent) - : AbstractTreeItem(parent), - _propertyOrder(propertyOrder) -{ -} - - PropertyMapItem::PropertyMapItem(AbstractTreeItem *parent) - : AbstractTreeItem(parent), - _propertyOrder(QStringList()) -{ -} - - -PropertyMapItem::~PropertyMapItem() + : AbstractTreeItem(parent) { } @@ -304,7 +291,7 @@ QVariant PropertyMapItem::data(int column, int role) const return toolTip(column); case Qt::DisplayRole: case TreeModel::SortRole: // fallthrough, since SortRole should default to DisplayRole - return property(_propertyOrder[column].toLatin1()); + return property(propertyOrder()[column].toLatin1()); default: return QVariant(); } @@ -316,20 +303,15 @@ bool PropertyMapItem::setData(int column, const QVariant &value, int role) if (column >= columnCount() || role != Qt::DisplayRole) return false; + setProperty(propertyOrder()[column].toLatin1(), value); emit dataChanged(column); - return setProperty(_propertyOrder[column].toLatin1(), value); + return true; } int PropertyMapItem::columnCount() const { - return _propertyOrder.count(); -} - - -void PropertyMapItem::appendProperty(const QString &property) -{ - _propertyOrder << property; + return propertyOrder().count(); }