/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2019 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
/*****************************************
* PropertyMapItem
*****************************************/
-PropertyMapItem::PropertyMapItem(const QStringList &propertyOrder, AbstractTreeItem *parent)
- : AbstractTreeItem(parent),
- _propertyOrder(propertyOrder)
-{
-}
-
-
PropertyMapItem::PropertyMapItem(AbstractTreeItem *parent)
- : AbstractTreeItem(parent),
- _propertyOrder(QStringList())
-{
-}
-
-
-PropertyMapItem::~PropertyMapItem()
+ : AbstractTreeItem(parent)
{
}
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();
}
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();
}