aboutsummaryrefslogtreecommitdiff
path: root/lib/bookmarks
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-05-26 22:23:25 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2020-05-28 19:43:45 +0300
commit9c4dd932c6d692178bb8d5265c634126cb415767 (patch)
tree527300f8e710859965c142aed4e779a16b9d4ab6 /lib/bookmarks
parentUpdate ProfileEditor plugin (diff)
downloadsmolbote-9c4dd932c6d692178bb8d5265c634126cb415767.tar.xz
Turn on more warnings by default
- fix clazy warnings - fix various other compiler warnings - bugfix: connect profiles' downloadRequested signal
Diffstat (limited to 'lib/bookmarks')
-rw-r--r--lib/bookmarks/bookmarkmodel.cpp7
-rw-r--r--lib/bookmarks/formats/ffjson.cpp8
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/bookmarks/bookmarkmodel.cpp b/lib/bookmarks/bookmarkmodel.cpp
index 8599f1d..0775ff2 100644
--- a/lib/bookmarks/bookmarkmodel.cpp
+++ b/lib/bookmarks/bookmarkmodel.cpp
@@ -241,10 +241,11 @@ inline QStringList searchThrough(const QString &term, const QStringList &tags, B
if(has(tags, child->data(BookmarkItem::Tags).toStringList())) {
// append all bookmarks
- for(int i = 0; i < child->childCount(); ++i) {
- auto *subChild = child->child(i);
- if(subChild->type() == BookmarkItem::Bookmark)
+ for(int j = 0; j < child->childCount(); ++j) {
+ auto *subChild = child->child(j);
+ if(subChild->type() == BookmarkItem::Bookmark) {
results.append(subChild->data(BookmarkItem::Href).toString());
+ }
}
}
results.append(searchThrough(term, tags, child));
diff --git a/lib/bookmarks/formats/ffjson.cpp b/lib/bookmarks/formats/ffjson.cpp
index 1fe6a96..f9e0866 100644
--- a/lib/bookmarks/formats/ffjson.cpp
+++ b/lib/bookmarks/formats/ffjson.cpp
@@ -32,7 +32,8 @@ inline void readElementData(const QJsonObject &object, BookmarkItem *item)
item->setData(BookmarkItem::Tags, tags);
// descriptions
- for(const auto &a : object["annos"].toArray()) {
+ const auto annos_array = object["annos"].toArray();
+ for(const auto &a : annos_array) {
const auto anno = a.toObject();
if(anno["name"] == "bookmarkProperties/description") {
item->setData(BookmarkItem::Description, anno["value"].toString());
@@ -40,9 +41,10 @@ inline void readElementData(const QJsonObject &object, BookmarkItem *item)
}
}
-void readChildElements(const QJsonObject &object, BookmarkItem *item)
+inline void readChildElements(const QJsonObject &object, BookmarkItem *item)
{
- for(const auto c : object["children"].toArray()) {
+ const auto children_array = object["children"].toArray();
+ for(const auto &c : children_array) {
const auto child = c.toObject();
const auto type = child["type"].toString();