Diff of /trunk/src/notes.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 256 by harbaum, Sat Jan 23 20:12:41 2010 UTC revision 257 by harbaum, Fri Feb 12 16:18:08 2010 UTC
# Line 877  void notes_log_export(appdata_t *appdata Line 877  void notes_log_export(appdata_t *appdata
877      time_t now = time(NULL);      time_t now = time(NULL);
878      struct tm *tm_now = localtime(&now);      struct tm *tm_now = localtime(&now);
879      char now_str[32];      char now_str[32];
880      strftime(now_str, sizeof(now_str)-1, "%F_%H:%M", tm_now);      strftime(now_str, sizeof(now_str)-1, "%F_%H-%M", tm_now);
881      char *fname = g_strdup_printf(appdata->fieldnotes_path, now_str);      char *fname = g_strdup_printf(appdata->fieldnotes_path, now_str);
882    
883      printf("--- about to export logs to %s ---\n", fname);      printf("--- about to export logs to %s ---\n", fname);
884      FILE *file = fopen(fname, "w");      FILE *file = fopen(fname, "w");
885      g_free(fname);      g_free(fname);
886    
887      if(file) {      if(file) {
   
888        llog = log;        llog = log;
889        while(llog) {        while(llog) {
890          printf("Exporting %s\n", llog->cache->id);          printf("Exporting %s\n", llog->cache->id);
# Line 974  void notes_log_export(appdata_t *appdata Line 974  void notes_log_export(appdata_t *appdata
974        }        }
975    
976        fclose(file);        fclose(file);
977      }      } else
978          errorf(_("Can't open file:\n\n%s"), strerror(errno));
979    
980    } else {    } else {
981      /* restore old path, in case it has been altered but not been used */      /* restore old path, in case it has been altered but not been used */
982      free(appdata->fieldnotes_path);      free(appdata->fieldnotes_path);

Legend:
Removed from v.256  
changed lines
  Added in v.257