diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-11 17:30:38 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-11 17:30:38 +0100 |
commit | 5d0adf426a33440542eb88eca83c804dcec58475 (patch) | |
tree | 34358c8039c2f6cb2a121a169374dc4a7a21b614 /lib/bookmarks/bookmarksmodel.h | |
parent | Removed docs (moved to site) (diff) | |
download | smolbote-5d0adf426a33440542eb88eca83c804dcec58475.tar.xz |
Writing BookmarksModel to xbel
Diffstat (limited to 'lib/bookmarks/bookmarksmodel.h')
-rw-r--r-- | lib/bookmarks/bookmarksmodel.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bookmarks/bookmarksmodel.h b/lib/bookmarks/bookmarksmodel.h index 986a195..79bd9ce 100644 --- a/lib/bookmarks/bookmarksmodel.h +++ b/lib/bookmarks/bookmarksmodel.h @@ -7,8 +7,10 @@ */ #include "bookmarkitem.h" +#include "xbel.h" #include <QAbstractItemModel> #include <QIcon> +#include <QTreeView> #ifndef BOOKMARKSMODEL_H #define BOOKMARKSMODEL_H @@ -26,7 +28,10 @@ public: explicit BookmarksModel(QStyle *style, QObject *parent = nullptr); ~BookmarksModel() override; - void setRoot(BookmarkItem *root); + bool isModified() const; + + bool read(Xbel *xbel); + bool write(Xbel *xbel); QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; @@ -47,9 +52,12 @@ public: QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const override; + void expandItems(QTreeView *view, BookmarkItem *root = nullptr); + private: QIcon folderIcon; QIcon bookmarkIcon; + bool modified = false; BookmarkItem *m_rootItem; }; |