aboutsummaryrefslogtreecommitdiff
path: root/lib/bookmarks/xbel.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-02-07 21:08:39 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-02-07 21:08:39 +0100
commitf779510603e01de438e337c82c439cc6649cd7c3 (patch)
tree98254e5ab079edcc6e207d692af28378573d4f0f /lib/bookmarks/xbel.h
parentBookmarks bugfixes (diff)
downloadsmolbote-f779510603e01de438e337c82c439cc6649cd7c3.tar.xz
Rewrote bookmark manager to use QTreeWidget over QTreeView
- cut out all the boilerplate that was BookmarkItem/BookmarksModel - deleting items no longer crash; proper drag'n'drop - Split Xbel into XbelReader and XbelWriter
Diffstat (limited to 'lib/bookmarks/xbel.h')
-rw-r--r--lib/bookmarks/xbel.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/bookmarks/xbel.h b/lib/bookmarks/xbel.h
index f0945bf..6981627 100644
--- a/lib/bookmarks/xbel.h
+++ b/lib/bookmarks/xbel.h
@@ -9,21 +9,27 @@
#ifndef XBELREADER_H
#define XBELREADER_H
-#include "bookmarkitem.h"
#include <QString>
#include <QXmlStreamReader>
+#include "bookmarksview.h"
-class Xbel
+class XbelReader
{
public:
- explicit Xbel(QIODevice *file);
- bool read(BookmarkItem *root);
- bool write(BookmarkItem *root);
+ explicit XbelReader(QIODevice *file);
+ void read(BookmarksView *treeWidget);
private:
- void readChildElements(QXmlStreamReader &reader, BookmarkItem *parentItem);
- void writeChildElements(QXmlStreamWriter &writer, BookmarkItem *parentItem);
+ QIODevice *m_file;
+};
+
+class XbelWriter
+{
+public:
+ explicit XbelWriter(QIODevice *file);
+ void write(BookmarksView *treeWidget);
+private:
QIODevice *m_file;
};