diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:48:33 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:48:33 -0400 |
commit | 4885bfcef4d89cf0cb391e00af617b9fd19c9cbb (patch) | |
tree | e8ba8579bd76a1b277231202ca6579eb19c1ab4b /src/frontend/mainindex/bookmarks/cbookmarkindex.h | |
parent | 294b5ec5834affa57641475946b8d2aeca53c577 (diff) |
Imported Upstream version 2.5
Diffstat (limited to 'src/frontend/mainindex/bookmarks/cbookmarkindex.h')
-rw-r--r-- | src/frontend/mainindex/bookmarks/cbookmarkindex.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/frontend/mainindex/bookmarks/cbookmarkindex.h b/src/frontend/mainindex/bookmarks/cbookmarkindex.h index 9da12a6..90f9ab2 100644 --- a/src/frontend/mainindex/bookmarks/cbookmarkindex.h +++ b/src/frontend/mainindex/bookmarks/cbookmarkindex.h @@ -56,6 +56,19 @@ class CBookmarkIndex : public QTreeWidget { */ void createReadDisplayWindow( QList<CSwordModuleInfo*>, const QString& ); + public slots: + + /** + * Indicates a need to save the bookmarks. + * This is needed to provide a way for a bookmarkitem stored in the + * treeWidget to inform us that it has been modified, namely its + * description text. It only sets a dirty-bit so we don't execute many + * consecutive saves. + */ + void needToSaveBookmarks(); + void needToSaveBookmarks(QTreeWidgetItem* treeItem); + + protected: // Protected methods /** A hack to get the modifiers. */ @@ -173,6 +186,22 @@ class CBookmarkIndex : public QTreeWidget { QPoint m_dragMovementPosition; QPoint m_dragStartPosition; QTreeWidgetItem* m_extraItem; + + // The following is for managing saving bookmarks. It uses a QTimer to + // determine whether the bookmarks should be saved. This may seem like + // a hassle, but it is to prevent many saves from being executed at a + // time. + + /** Flag indicating that bookmarks have been modified. */ + bool m_bookmarksModified; + QTimer bookmarkSaveTimer; + + private slots: + /** + * Saves the bookmarks. + * It checks m_bookmarksModified and resets it at the end. It should be + * connected to a timer that periodically calls this. */ + void considerSavingBookmarks(); }; #endif |