GtkTreeIter iter;
GtkTreeModel *model;
struct headline *headline;
- char *str;
+ char *str, *date;
log_debug("headline_cursor_changed_cbk()");
}
model = gtk_tree_view_get_model(w_headlinetree);
+ date = headline_get_date(headline);
gtk_list_store_set(GTK_LIST_STORE(model),
&iter,
COL_HEADLINE_TITLE, headline->title,
+ COL_HEADLINE_DATE, date,
-1);
+ g_free(date);
} else {
log_debug("headline not found");
}
#include <unistd.h>
#include <glib.h>
+#include <pthread.h>
#include "io.h"
#include "log.h"
#include "ttrss_cache.h"
+static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static char *cache_dir;
static const char *get_cache_dir()
path = content_get_path(h);
- if (path)
+ if (path) {
+ pthread_mutex_lock(&lock);
file_set_content(path, content);
+ pthread_mutex_unlock(&lock);
+ }
g_free(path);
}
path = content_get_path(h);
+ pthread_mutex_lock(&lock);
if (stat(path, &s) == -1)
result = 0;
else
result = 1;
+ pthread_mutex_unlock(&lock);
g_free(path);
{
char *content, *path;
+
path = content_get_path(h);
- if (path)
+ if (path) {
+ pthread_mutex_lock(&lock);
content = file_get_content(path);
- else
+ pthread_mutex_unlock(&lock);
+ } else {
content = NULL;
+ }
g_free(path);