From 36fb915b8a930ff5f99ecc2854b88f4b10becdd8 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 28 Aug 2020 13:47:56 +0200 Subject: Write notes to file --- src/gui_backend_local.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/gui_backend_local.c') diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c index 1bf0c9b6..7411c9a2 100644 --- a/src/gui_backend_local.c +++ b/src/gui_backend_local.c @@ -166,6 +166,11 @@ static void *run_indexing(const char *job_title, struct stat s; char *workdir; const char *old_pwd; + GFile *workdir_file; + GFile *cwd_file; + GFile *notes_file; + char *notes_path; + FILE *fh; workdir = strdup(job_title); if ( workdir == NULL ) return NULL; @@ -182,6 +187,19 @@ static void *run_indexing(const char *job_title, return NULL; } + cwd_file = g_file_new_for_path("."); + workdir_file = g_file_get_child(cwd_file, workdir); + g_object_unref(cwd_file); + + notes_file = g_file_get_child(workdir_file, "notes.txt"); + notes_path = g_file_get_path(notes_file); + fh = fopen(notes_path, "w"); + fputs(job_notes, fh); + fclose(fh); + g_free(notes_path); + g_object_unref(notes_file); + g_object_unref(workdir_file); + job = malloc(sizeof(struct local_job)); if ( job == NULL ) return NULL; -- cgit v1.2.3