if (content) {
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, content);
curl_easy_setopt(curl,
- CURLOPT_POSTFIELDSIZE,
+ CURLOPT_POSTFIELDSIZE,
(long)strlen(content));
}
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
if (debug)
printf("HTTP request= %s\n",
json_object_to_json_string(j));
-
+
if (out) {
result = json_tokener_parse(out);
if (debug)
printf("HTTP reply= %s\n", out);
free(out);
return result;
- }
+ }
return NULL;
}
gtk_list_store_clear(GTK_LIST_STORE(model));
printf("update(): clear feed tree done\n");
feeds = ttrss_get_feeds();
- while(feeds && *feeds) {
+ while (feeds && *feeds) {
if ((*feeds)->unread)
title = g_strdup_printf("<b>%s (%d)</b>",
(*feeds)->title,
(*feeds)->unread);
else
title = strdup((*feeds)->title);
-
+
gtk_list_store_append(GTK_LIST_STORE(model), &iter);
if (gtk_dialog_run(diag)) {
g_settings_set_string(settings,
- "password",
+ "password",
gtk_entry_get_text(pwd));
g_settings_set_string(settings,
- "url",
+ "url",
gtk_entry_get_text(url));
g_settings_set_string(settings,
- "user",
+ "user",
gtk_entry_get_text(login));
update();
const char *str;
printf("headline_cursor_changed_cbk\n");
-
+
if (model_state)
return TRUE;
gtk_tree_model_get(model, &iter, 1, &feed, -1);
url = feed->url;
- if (gtk_widget_has_screen (widget))
+ if (gtk_widget_has_screen(widget))
screen = gtk_widget_get_screen(widget);
else
screen = gdk_screen_get_default();
-
+
printf("%s\n", url);
error = NULL;
if (!list)
return 0;
-
+
n = 0;
- while(*list) {
+ while (*list) {
n++;
list++;
}
rq = ws_request_new("getArticle");
ws_request_add_att_int(rq, "article_id", id);
-
+
rp = ws_execute(rq);
-
+
json_object_put(rq);
str = NULL;
if (rp) {
item = json_object_array_get_idx(rp, 0);
-
+
if (item) {
content = json_object_object_get(item, "content");
-
str = strdup(json_object_get_string(content));
}
-
+
json_object_put(rp);
}
j = json_object_object_get(jheadline, "id");
hid = json_object_get_int(j);
h = feed_get_headline(feed, hid);
-
+
if (!h) {
h = malloc(sizeof(struct headline));
h->id = hid;
h->content = NULL;
h->title = NULL;
h->url = NULL;
-
+
tmp = headlines_add(feed->headlines, h);
if (feed->headlines)
free(feed->headlines);
json_object_object_add(rq, "mode", json_object_new_int(unread));
rp = http_json_get(session_url, rq);
-
+
json_object_put(rq);
json_object_put(rp);
}