diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-28 14:59:23 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-28 14:59:23 +0200 |
commit | eea675e1f33d29550c9f3e90eb6b6b2402e5ef37 (patch) | |
tree | 66172403b143b371324505a39e0d92a4563a3d11 /lib/bookmarks/bookmarkformat.h | |
parent | Refactor Browser::addPlugin to ::loadPlugins (diff) | |
download | smolbote-eea675e1f33d29550c9f3e90eb6b6b2402e5ef37.tar.xz |
Add bookmarks toolbar
Bookmarks Toolbar displays the contents of the top-level "Bookmarks
Toolbar" folder.
Diffstat (limited to 'lib/bookmarks/bookmarkformat.h')
-rw-r--r-- | lib/bookmarks/bookmarkformat.h | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/lib/bookmarks/bookmarkformat.h b/lib/bookmarks/bookmarkformat.h index c886546..cdae24e 100644 --- a/lib/bookmarks/bookmarkformat.h +++ b/lib/bookmarks/bookmarkformat.h @@ -9,57 +9,28 @@ #ifndef BOOKMARKFORMAT_H #define BOOKMARKFORMAT_H -#include "bookmarkmodel.h" - class QIODevice; +class BookmarkItem; enum BookmarkFormats { XbelFormat, FirefoxJsonFormat }; -template<BookmarkFormats format> +template <BookmarkFormats format> class BookmarkFormat { public: explicit BookmarkFormat(QIODevice *device) { - Q_CHECK_PTR(device); m_device = device; } void read(BookmarkItem *root) const; - void write(BookmarkItem *root); + void write(const BookmarkItem *root); protected: QIODevice *m_device; }; -template<BookmarkFormats T> -void operator<<(BookmarkModel *model, const BookmarkFormat<T> &format) -{ - format.read(model->root()); -} - -template<BookmarkFormats T> -void operator>>(const BookmarkFormat<T> &format, BookmarkModel *model) -{ - format.read(model->root()); -} - -template<BookmarkFormats T> -void operator<<(BookmarkFormat<T> &format, BookmarkModel *model) -{ - format.write(model->root()); - model->resetModified(); -} - -template<BookmarkFormats T> -void operator>>(BookmarkModel *model, BookmarkFormat<T> &format) -{ - format.write(model->root()); - model->resetModified(); -} - #endif // BOOKMARKSFORMAT_H - |