From ab6f5290fc1582cf89257e6e5d12ec33ed428143 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 27 Dec 2018 16:27:25 +0100 Subject: 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 --- lib/bookmarks/model/bookmarkmodel.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/bookmarks/model/bookmarkmodel.h') 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 -- cgit v1.2.1