aboutsummaryrefslogtreecommitdiff
path: root/lib/bookmarks/model/bookmarkmodel.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-12-27 16:27:25 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-12-27 16:27:25 +0100
commitab6f5290fc1582cf89257e6e5d12ec33ed428143 (patch)
tree68b5856bf7f3fdbcf5ff0ad6ec83945a8bbb60dc /lib/bookmarks/model/bookmarkmodel.h
parentRename TabWidget::deleteTab to TabWidget::removeTab (diff)
downloadsmolbote-ab6f5290fc1582cf89257e6e5d12ec33ed428143.tar.xz
Bookmarks: track modified state in the model rather than the widget
Dragging and dropping bookmarks is done by the QTreeView rather than through the BookmarksWidget, so the widget could not track modification state correctly when items were reordered. BUG: #9 Bookmark reordering does not persist
Diffstat (limited to 'lib/bookmarks/model/bookmarkmodel.h')
-rw-r--r--lib/bookmarks/model/bookmarkmodel.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/bookmarks/model/bookmarkmodel.h b/lib/bookmarks/model/bookmarkmodel.h
index 3e0f35e..8efd2fb 100644
--- a/lib/bookmarks/model/bookmarkmodel.h
+++ b/lib/bookmarks/model/bookmarkmodel.h
@@ -52,11 +52,22 @@ public:
QStringList search(const QString &term) const;
+ void resetModified()
+ {
+ m_isModified = false;
+ }
+ bool isModified() const
+ {
+ return m_isModified;
+ }
+
private:
const QLatin1Literal mimeType = QLatin1Literal("application/xbel");
BookmarkItem *getItem(const QModelIndex &index) const;
BookmarkItem *rootItem;
+
+ bool m_isModified = false;
};
#endif // SMOLBOTE_BOOKMARKMODEL_H