Changeset View
Changeset View
Standalone View
Standalone View
src/kjotsmodel.h
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 80 | public: | |||
---|---|---|---|---|---|
91 | QVariant entityData(const Akonadi::Item &item, int column, int role = Qt::DisplayRole) const override; | 91 | QVariant entityData(const Akonadi::Item &item, int column, int role = Qt::DisplayRole) const override; | ||
92 | 92 | | |||
93 | QVariant data(const QModelIndex &index, int role) const override; | 93 | QVariant data(const QModelIndex &index, int role) const override; | ||
94 | 94 | | |||
95 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; | 95 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; | ||
96 | 96 | | |||
97 | static QModelIndex modelIndexForUrl(const QAbstractItemModel *model, const QUrl &url); | 97 | static QModelIndex modelIndexForUrl(const QAbstractItemModel *model, const QUrl &url); | ||
98 | /** | 98 | /** | ||
99 | * Returns an Item for @p index, and sets its content by @p document | ||||
100 | */ | ||||
101 | static Item updateItem(const QModelIndex &index, QTextDocument *document); | ||||
102 | /** | ||||
99 | * A helper function which returns a full "path" to the @p item (e.g. "Resource / Notebook / Note") | 103 | * A helper function which returns a full "path" to the @p item (e.g. "Resource / Notebook / Note") | ||
100 | * using @p sep as a separator. If multiple items are selected, returns "Multiple selection" | 104 | * using @p sep as a separator. If multiple items are selected, returns "Multiple selection" | ||
101 | */ | 105 | */ | ||
102 | static QString itemPath(const QModelIndex &index, const QString &sep = QStringLiteral(" / ")); | 106 | static QString itemPath(const QModelIndex &index, const QString &sep = QStringLiteral(" / ")); | ||
103 | private: | 107 | private: | ||
104 | QHash<Collection::Id, QColor> m_colors; | 108 | QHash<Collection::Id, QColor> m_colors; | ||
105 | mutable QHash<Item::Id, QTextDocument *> m_documents; | 109 | mutable QHash<Item::Id, QTextDocument *> m_documents; | ||
106 | }; | 110 | }; | ||
107 | 111 | | |||
108 | #endif | 112 | #endif | ||
109 | 113 | |