From eea675e1f33d29550c9f3e90eb6b6b2402e5ef37 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 28 Jan 2020 14:59:23 +0200 Subject: Add bookmarks toolbar Bookmarks Toolbar displays the contents of the top-level "Bookmarks Toolbar" folder. --- lib/bookmarks/bookmarkformat.h | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'lib/bookmarks/bookmarkformat.h') 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 +template 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 -void operator<<(BookmarkModel *model, const BookmarkFormat &format) -{ - format.read(model->root()); -} - -template -void operator>>(const BookmarkFormat &format, BookmarkModel *model) -{ - format.read(model->root()); -} - -template -void operator<<(BookmarkFormat &format, BookmarkModel *model) -{ - format.write(model->root()); - model->resetModified(); -} - -template -void operator>>(BookmarkModel *model, BookmarkFormat &format) -{ - format.write(model->root()); - model->resetModified(); -} - #endif // BOOKMARKSFORMAT_H - -- cgit v1.2.1