From a0736fce0f13ccf8ae96f00b5ed65af316c7571a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Tue, 23 Apr 2013 20:14:09 +0000 Subject: [PATCH 1/1] --- po/fr.gmo | Bin 453 -> 453 bytes po/fr.po | 18 +++++++++--------- po/prss.pot | 18 +++++++++--------- src/ttrss.c | 20 +++++++------------- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/po/fr.gmo b/po/fr.gmo index e8f5f9c5cf66275e8728e2b95082a22251af0a1e..153d3025c89452beaeea27fe310efec5b870cde2 100644 GIT binary patch delta 18 ZcmX@ge3W^@G\n" "Language-Team: French <>\n" @@ -19,7 +19,7 @@ msgstr "" "X-Launchpad-Export-Date: 2012-07-02 08:28+0000\n" "X-Generator: Launchpad (build 15520)\n" -#: src/main.c:44 +#: src/main.c:47 #, c-format msgid "" "Copyright (C) %s jeanfi@gmail.com\n" @@ -29,37 +29,37 @@ msgid "" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" -#: src/main.c:55 +#: src/main.c:58 #, c-format msgid "Usage: %s [OPTION]...\n" msgstr "" -#: src/main.c:57 +#: src/main.c:60 msgid "Prss is a GTK+ news reader for tt-rss." msgstr "" -#: src/main.c:60 +#: src/main.c:63 #, fuzzy msgid "Options:" msgstr "Description:" -#: src/main.c:61 +#: src/main.c:64 msgid "" " -h, --help display this help and exit\n" " -v, --version display version information and exit" msgstr "" -#: src/main.c:66 +#: src/main.c:69 #, c-format msgid "Report bugs to: %s\n" msgstr "" -#: src/main.c:68 +#: src/main.c:71 #, c-format msgid "%s home page: <%s>\n" msgstr "" -#: src/main.c:205 +#: src/main.c:341 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "" diff --git a/po/prss.pot b/po/prss.pot index 4876729..b0a958b 100644 --- a/po/prss.pot +++ b/po/prss.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: jeanfi@gmail.com\n" -"POT-Creation-Date: 2013-04-22 09:01+0200\n" +"POT-Creation-Date: 2013-04-23 21:54+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/main.c:44 +#: src/main.c:47 #, c-format msgid "" "Copyright (C) %s jeanfi@gmail.com\n" @@ -27,36 +27,36 @@ msgid "" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" -#: src/main.c:55 +#: src/main.c:58 #, c-format msgid "Usage: %s [OPTION]...\n" msgstr "" -#: src/main.c:57 +#: src/main.c:60 msgid "Prss is a GTK+ news reader for tt-rss." msgstr "" -#: src/main.c:60 +#: src/main.c:63 msgid "Options:" msgstr "" -#: src/main.c:61 +#: src/main.c:64 msgid "" " -h, --help display this help and exit\n" " -v, --version display version information and exit" msgstr "" -#: src/main.c:66 +#: src/main.c:69 #, c-format msgid "Report bugs to: %s\n" msgstr "" -#: src/main.c:68 +#: src/main.c:71 #, c-format msgid "%s home page: <%s>\n" msgstr "" -#: src/main.c:205 +#: src/main.c:341 #, c-format msgid "Try `%s --help' for more information.\n" msgstr "" diff --git a/src/ttrss.c b/src/ttrss.c index ae4a1c9..97f2803 100644 --- a/src/ttrss.c +++ b/src/ttrss.c @@ -94,8 +94,11 @@ struct json_object *ws_execute(struct json_object *rq) if (rp) { content = ws_reply_get_content(rp); - if (content && !json_object_object_get(rp, "error")) + if (content && !json_object_object_get(rp, "error")) { + json_object_get(content); + json_object_put(rp); return content; + } json_object_put(rp); } @@ -105,7 +108,7 @@ struct json_object *ws_execute(struct json_object *rq) int ws_get_api_version() { - struct json_object *rp, *rq, *j; + struct json_object *rp, *rq; int v; rq = ws_request_new("getApiLevel"); @@ -115,12 +118,7 @@ int ws_get_api_version() json_object_put(rq); if (rp) { - j = json_object_object_get(rp, "level"); - - if (j) - v = json_object_get_int(j); - else - v = 0; + v = json_object_get_int(json_object_object_get(rp, "level")); json_object_put(rp); } else { @@ -144,11 +142,7 @@ char *ws_login() if (rp) { j = json_object_object_get(rp, "session_id"); - - if (j) - str = strdup(json_object_get_string(j)); - else - str = NULL; + str = strdup(json_object_get_string(j)); json_object_put(rp); } else { -- 2.7.4