(no commit message)
authorJean-Philippe Orsini <jeanfi@gmail.com>
Wed, 24 Apr 2013 12:32:09 +0000 (12:32 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Wed, 24 Apr 2013 12:32:09 +0000 (12:32 +0000)
src/http.c
src/main.c
src/ttrss.c

index 55eab0f..a9cf301 100644 (file)
@@ -77,7 +77,7 @@ char *http_get(const char *url, const char *content)
        if (content) {
                curl_easy_setopt(curl, CURLOPT_POSTFIELDS, content);
                curl_easy_setopt(curl,
        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);
                                 (long)strlen(content));
        }
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cbk_curl);
@@ -104,14 +104,14 @@ json_object *http_json_get(const char *url, struct json_object *j)
        if (debug)
                printf("HTTP request= %s\n",
                       json_object_to_json_string(j));
        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;
        if (out) {
                result = json_tokener_parse(out);
                if (debug)
                        printf("HTTP reply= %s\n", out);
                free(out);
                return result;
-       } 
+       }
 
        return NULL;
 }
 
        return NULL;
 }
index 9de84d4..af2c2f8 100644 (file)
@@ -93,14 +93,14 @@ void update()
        gtk_list_store_clear(GTK_LIST_STORE(model));
        printf("update(): clear feed tree done\n");
        feeds = ttrss_get_feeds();
        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);
                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);
 
 
                gtk_list_store_append(GTK_LIST_STORE(model), &iter);
 
@@ -151,13 +151,13 @@ void settings_activate_cbk(GtkWidget *menu_item, gpointer data)
 
        if (gtk_dialog_run(diag)) {
                g_settings_set_string(settings,
 
        if (gtk_dialog_run(diag)) {
                g_settings_set_string(settings,
-                                     "password", 
+                                     "password",
                                      gtk_entry_get_text(pwd));
                g_settings_set_string(settings,
                                      gtk_entry_get_text(pwd));
                g_settings_set_string(settings,
-                                     "url", 
+                                     "url",
                                      gtk_entry_get_text(url));
                g_settings_set_string(settings,
                                      gtk_entry_get_text(url));
                g_settings_set_string(settings,
-                                     "user", 
+                                     "user",
                                      gtk_entry_get_text(login));
 
                update();
                                      gtk_entry_get_text(login));
 
                update();
@@ -231,7 +231,7 @@ int headline_cursor_changed_cbk(GtkTreeView *treeview, gpointer data)
        const char *str;
 
        printf("headline_cursor_changed_cbk\n");
        const char *str;
 
        printf("headline_cursor_changed_cbk\n");
-       
+
        if (model_state)
                return TRUE;
 
        if (model_state)
                return TRUE;
 
@@ -284,11 +284,11 @@ void headline_row_activated_cbk(GtkWidget *widget, gpointer data)
                gtk_tree_model_get(model, &iter, 1, &feed, -1);
                url = feed->url;
 
                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();
                        screen = gtk_widget_get_screen(widget);
                else
                        screen = gdk_screen_get_default();
-               
+
                printf("%s\n", url);
 
                error = NULL;
                printf("%s\n", url);
 
                error = NULL;
index f955cee..00ee138 100644 (file)
@@ -37,9 +37,9 @@ static int list_length(void **list)
 
        if (!list)
                return 0;
 
        if (!list)
                return 0;
-       
+
        n = 0;
        n = 0;
-       while(*list) {
+       while (*list) {
                n++;
                list++;
        }
                n++;
                list++;
        }
@@ -241,22 +241,21 @@ char *ws_get_article_content(int id)
 
        rq = ws_request_new("getArticle");
        ws_request_add_att_int(rq, "article_id", id);
 
        rq = ws_request_new("getArticle");
        ws_request_add_att_int(rq, "article_id", id);
-       
+
        rp = ws_execute(rq);
        rp = ws_execute(rq);
-       
+
        json_object_put(rq);
 
        str = NULL;
 
        if (rp) {
                item = json_object_array_get_idx(rp, 0);
        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");
                if (item) {
                        content = json_object_object_get(item, "content");
-                       
                        str = strdup(json_object_get_string(content));
                }
                        str = strdup(json_object_get_string(content));
                }
-               
+
                json_object_put(rp);
        }
 
                json_object_put(rp);
        }
 
@@ -284,7 +283,7 @@ int ws_update_headlines(struct feed *feed)
                        j = json_object_object_get(jheadline, "id");
                        hid = json_object_get_int(j);
                        h = feed_get_headline(feed, hid);
                        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;
                        if (!h) {
                                h = malloc(sizeof(struct headline));
                                h->id = hid;
@@ -292,7 +291,7 @@ int ws_update_headlines(struct feed *feed)
                                h->content = NULL;
                                h->title = NULL;
                                h->url = NULL;
                                h->content = NULL;
                                h->title = NULL;
                                h->url = NULL;
-                               
+
                                tmp = headlines_add(feed->headlines, h);
                                if (feed->headlines)
                                        free(feed->headlines);
                                tmp = headlines_add(feed->headlines, h);
                                if (feed->headlines)
                                        free(feed->headlines);
@@ -403,7 +402,7 @@ void ttrss_set_article_unread(int id, int unread)
        json_object_object_add(rq, "mode", json_object_new_int(unread));
 
        rp = http_json_get(session_url, rq);
        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);
 }
        json_object_put(rq);
        json_object_put(rp);
 }