diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-17 13:14:11 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-17 13:34:34 +0200 |
commit | 2c982ae87935c2ce2e2144694a4d55c5e1a688b6 (patch) | |
tree | fa8693aed8f8a96d3348dc263c03fcd78416352b /lib/bookmarks | |
parent | Add Import option to BookmarksWidget (diff) | |
download | smolbote-2c982ae87935c2ce2e2144694a4d55c5e1a688b6.tar.xz |
Parse Tags and Descriptions in FFJson
Diffstat (limited to 'lib/bookmarks')
-rw-r--r-- | lib/bookmarks/formats/ffjson.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/bookmarks/formats/ffjson.cpp b/lib/bookmarks/formats/ffjson.cpp index 98f8e60..1fe6a96 100644 --- a/lib/bookmarks/formats/ffjson.cpp +++ b/lib/bookmarks/formats/ffjson.cpp @@ -25,6 +25,19 @@ inline void readElementData(const QJsonObject &object, BookmarkItem *item) item->setData(BookmarkItem::Title, object["title"].toString()); item->setData(BookmarkItem::DateAdded, asDate(object["dateAdded"])); item->setData(BookmarkItem::LastModified, asDate(object["lastModified"])); + + // tags + const auto tags = object["tags"].toString().split(","); + if(!tags.isEmpty()) + item->setData(BookmarkItem::Tags, tags); + + // descriptions + for(const auto &a : object["annos"].toArray()) { + const auto anno = a.toObject(); + if(anno["name"] == "bookmarkProperties/description") { + item->setData(BookmarkItem::Description, anno["value"].toString()); + } + } } void readChildElements(const QJsonObject &object, BookmarkItem *item) |