diff options
author | Alexander Batischev <eual.jp@gmail.com> | 2022-06-18 20:11:49 +0300 |
---|---|---|
committer | Alexander Batischev <eual.jp@gmail.com> | 2022-06-22 22:19:07 +0300 |
commit | b5f266058c7042d450855dcef091fb6c73c3ca7c (patch) | |
tree | 2118249b11b31094c29e76194b7ab6c3fb1d9f32 | |
parent | cda535be4a3581d5cab3863863aa96358226260f (diff) |
Fix code formatting (lines wrapped too much)
-rw-r--r-- | src/feedhqapi.cpp | 3 | ||||
-rw-r--r-- | src/newsblurapi.cpp | 33 | ||||
-rw-r--r-- | src/ocnewsapi.cpp | 12 | ||||
-rw-r--r-- | src/oldreaderapi.cpp | 3 |
4 files changed, 17 insertions, 34 deletions
diff --git a/src/feedhqapi.cpp b/src/feedhqapi.cpp index 40591803..3b59d2c5 100644 --- a/src/feedhqapi.cpp +++ b/src/feedhqapi.cpp @@ -130,8 +130,7 @@ std::vector<TaggedFeedUrl> FeedHqApi::get_subscribed_urls() for (int i = 0; i < len; i++) { std::vector<std::string> tags; - json_object* sub = - json_object_array_get_idx(subscription_obj, i); + json_object* sub = json_object_array_get_idx(subscription_obj, i); json_object* id_str{}; json_object_object_get_ex(sub, "id", &id_str); diff --git a/src/newsblurapi.cpp b/src/newsblurapi.cpp index ec129ab9..8e208bc4 100644 --- a/src/newsblurapi.cpp +++ b/src/newsblurapi.cpp @@ -165,17 +165,12 @@ std::map<std::string, std::vector<std::string>> NewsBlurApi::mk_feeds_to_tags( // invariant: `tag_to_feed_ids` is a JSON object - json_object_object_foreach( - tag_to_feed_ids, key, feeds_with_tag_obj) { + json_object_object_foreach(tag_to_feed_ids, key, feeds_with_tag_obj) { std::string std_key(key); - array_list* feeds_with_tag_arr = - json_object_get_array(feeds_with_tag_obj); - int feeds_with_tag_len = - array_list_length(feeds_with_tag_arr); + array_list* feeds_with_tag_arr = json_object_get_array(feeds_with_tag_obj); + int feeds_with_tag_len = array_list_length(feeds_with_tag_arr); for (int j = 0; j < feeds_with_tag_len; ++j) { - json_object* feed_id_obj = - json_object_array_get_idx( - feeds_with_tag_obj, j); + json_object* feed_id_obj = json_object_array_get_idx(feeds_with_tag_obj, j); const auto id = json_object_get_string(feed_id_obj); if (id == nullptr) { LOG(Level::WARN, "Skipping subscription's tag whose name is a null value"); @@ -294,8 +289,7 @@ rsspp::Feed NewsBlurApi::fetch_feed(const std::string& id) items_size); for (int i = 0; i < items_size; i++) { - json_object* item_obj = - (json_object*)array_list_get_idx(items, i); + json_object* item_obj = (json_object*)array_list_get_idx(items, i); rsspp::Item item; @@ -330,19 +324,14 @@ rsspp::Feed NewsBlurApi::fetch_feed(const std::string& id) } const char* article_id{}; - if (json_object_object_get_ex(item_obj, "id", &node) == - TRUE) { + if (json_object_object_get_ex(item_obj, "id", &node) == TRUE) { article_id = json_object_get_string(node); } - item.guid = id + ID_SEPARATOR + - (article_id ? article_id : ""); - - if (json_object_object_get_ex( - item_obj, "read_status", &node) == TRUE) { - if (!static_cast<bool>( - json_object_get_int(node))) { - item.labels.push_back( - "newsblur:unread"); + item.guid = id + ID_SEPARATOR + (article_id ? article_id : ""); + + if (json_object_object_get_ex(item_obj, "read_status", &node) == TRUE) { + if (!static_cast<bool>(json_object_get_int(node))) { + item.labels.push_back("newsblur:unread"); } else { item.labels.push_back("newsblur:read"); } diff --git a/src/ocnewsapi.cpp b/src/ocnewsapi.cpp index 3c43275b..b2fbdbaf 100644 --- a/src/ocnewsapi.cpp +++ b/src/ocnewsapi.cpp @@ -129,12 +129,10 @@ std::vector<TaggedFeedUrl> OcNewsApi::get_subscribed_urls() current_feed.link = link; } - while (known_feeds.find(current_feed.title) != - known_feeds.end()) { + while (known_feeds.find(current_feed.title) != known_feeds.end()) { current_feed.title += "*"; } - known_feeds[current_feed.title] = - std::make_pair(current_feed, feed_id); + known_feeds[current_feed.title] = std::make_pair(current_feed, feed_id); json_object_object_get_ex(feed, "folderId", &node); long folder_id = json_object_get_int(node); @@ -285,10 +283,8 @@ rsspp::Feed OcNewsApi::fetch_feed(const std::string& feed_id) { json_object* type_obj; - json_object_object_get_ex( - item_j, "enclosureMime", &type_obj); - json_object_object_get_ex( - item_j, "enclosureLink", &node); + json_object_object_get_ex(item_j, "enclosureMime", &type_obj); + json_object_object_get_ex(item_j, "enclosureLink", &node); const auto type_ptr = json_object_get_string(type_obj); const auto url_ptr = json_object_get_string(node); diff --git a/src/oldreaderapi.cpp b/src/oldreaderapi.cpp index b8488af8..e13d0179 100644 --- a/src/oldreaderapi.cpp +++ b/src/oldreaderapi.cpp @@ -183,8 +183,7 @@ std::vector<TaggedFeedUrl> OldReaderApi::get_subscribed_urls() auto url = strprintf::fmt("%s%s?n=%u", OLDREADER_FEED_PREFIX, id, - cfg->get_configvalue_as_int( - "oldreader-min-items")); + cfg->get_configvalue_as_int("oldreader-min-items")); urls.push_back(TaggedFeedUrl(url, tags)); } } |