From 007907be20cc63e4c12320b0406cc255286e7792 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 21 Apr 2012 23:27:53 +0200 Subject: Bring back basic bookmark support for the Places Panel The folders-panel signals have been adjusted too for consistency. --- src/kitemviews/kstandarditem.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/kitemviews/kstandarditem.h') diff --git a/src/kitemviews/kstandarditem.h b/src/kitemviews/kstandarditem.h index 0315f4bf6..a108572a7 100644 --- a/src/kitemviews/kstandarditem.h +++ b/src/kitemviews/kstandarditem.h @@ -22,16 +22,20 @@ #include +#include +#include #include #include +#include class KStandardItemModel; /** * @brief Represents and item of KStandardItemModel. * - * Provides setter- and getter-methods for most commonly - * used properties. + * Provides setter- and getter-methods for the most commonly + * used roles. It is possible to assign values for custom + * roles by using setDataValue(). */ class LIBDOLPHINPRIVATE_EXPORT KStandardItem { @@ -42,28 +46,40 @@ public: KStandardItem(const QIcon& icon, const QString& text, KStandardItem* parent = 0); virtual ~KStandardItem(); + /** + * Sets the text for the "text"-role. + */ void setText(const QString& text); QString text() const; + /** + * Sets the icon for the "iconName"-role. + */ void setIcon(const QIcon& icon); QIcon icon() const; + /** + * Sets the group for the "group"-role. + */ void setGroup(const QString& group); QString group() const; + void setDataValue(const QByteArray& role, const QVariant& value); + QVariant dataValue(const QByteArray& role) const; + void setParent(KStandardItem* parent); KStandardItem* parent() const; + QHash data() const; QList children() const; private: - QString m_text; - QIcon m_icon; - QString m_group; KStandardItem* m_parent; QList m_children; KStandardItemModel* m_model; + QHash m_data; + friend class KStandardItemModel; }; -- cgit v1.3.1