projects
/
prss.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c6e1efc
)
(no commit message)
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Tue, 30 Apr 2013 09:03:16 +0000
(09:03 +0000)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Tue, 30 Apr 2013 09:03:16 +0000
(09:03 +0000)
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index
132aec1
..
2661e4a
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-97,30
+97,34
@@
static void print_help()
GtkTreeView *w_feedtree;
GtkTreeView *w_headlinetree;
GtkTreeView *w_feedtree;
GtkTreeView *w_headlinetree;
+static char *feed_get_formated_title(struct feed *f)
+{
+ if (f->unread)
+ return g_strdup_printf("<b>%s (%d)</b>",
+ f->title,
+ f->unread);
+ else
+ return strdup(f->title);
+}
+
void update()
{
struct feed **feeds;
void update()
{
struct feed **feeds;
- GtkTreeModel *model, *headlinemodel;
+ GtkTreeModel *model, *headline
_
model;
GtkTreeIter iter;
char *title;
model = gtk_tree_view_get_model(GTK_TREE_VIEW(w_feedtree));
GtkTreeIter iter;
char *title;
model = gtk_tree_view_get_model(GTK_TREE_VIEW(w_feedtree));
+ headline_model = gtk_tree_view_get_model(GTK_TREE_VIEW(w_headlinetree));
log_debug("update(): clear feed tree.");
model_state = 1;
gtk_list_store_clear(GTK_LIST_STORE(model));
log_debug("update(): clear feed tree.");
model_state = 1;
gtk_list_store_clear(GTK_LIST_STORE(model));
- headlinemodel = gtk_tree_view_get_model(w_headlinetree);
- gtk_list_store_clear(GTK_LIST_STORE(headlinemodel));
+ gtk_list_store_clear(GTK_LIST_STORE(headline_model));
log_debug("update(): clear feed tree done.");
feeds = ttrss_get_feeds();
while (feeds && *feeds) {
log_debug("update(): clear feed tree done.");
feeds = ttrss_get_feeds();
while (feeds && *feeds) {
- if ((*feeds)->unread)
- title = g_strdup_printf("<b>%s (%d)</b>",
- (*feeds)->title,
- (*feeds)->unread);
- else
- title = strdup((*feeds)->title);
-
+ title = feed_get_formated_title(*feeds);
gtk_list_store_append(GTK_LIST_STORE(model), &iter);
gtk_list_store_append(GTK_LIST_STORE(model), &iter);
@@
-129,12
+133,12
@@
void update()
COL_FEED_TITLE, title,
COL_FEED_ID, (*feeds)->id,
-1);
COL_FEED_TITLE, title,
COL_FEED_ID, (*feeds)->id,
-1);
- free(title);
-
- ttrs_download_headline_content(feeds);
-
+ g_free(title);
feeds++;
}
feeds++;
}
+
+ ttrs_download_headline_content(feeds);
+
model_state = 0;
log_debug("update() done");
model_state = 0;
log_debug("update() done");