Change home directory fallback to "C:\Claws-mail" on Windows.
[claws.git] / src / common / utils.c
index 182be8e6be97ebfbb3a30ef54972ef8051ee00a6..ad67d3cac9f42b9c6685ab9ca80d7a1446ac1a64 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2015 Hiroyuki Yamamoto & The Claws Mail Team
+ * Copyright (C) 1999-2016 Hiroyuki Yamamoto & The Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1792,7 +1792,7 @@ const gchar *get_home_dir(void)
                if (w32_shgetfolderpath
                            (NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE,
                             NULL, 0, home_dir_utf16) < 0)
-                               strcpy (home_dir_utf16, "C:\\Sylpheed");
+                               strcpy (home_dir_utf16, "C:\\Claws Mail");
                home_dir_utf8 = g_utf16_to_utf8 ((const gunichar *)home_dir_utf16, -1, NULL, NULL, NULL);
        }
        return home_dir_utf8;
@@ -2055,32 +2055,6 @@ time_t get_file_mtime(const gchar *file)
        return s.st_mtime;
 }
 
-off_t get_file_size_as_crlf(const gchar *file)
-{
-       FILE *fp;
-       off_t size = 0;
-       gchar buf[BUFFSIZE];
-
-       if ((fp = g_fopen(file, "rb")) == NULL) {
-               FILE_OP_ERROR(file, "g_fopen");
-               return -1;
-       }
-
-       while (fgets(buf, sizeof(buf), fp) != NULL) {
-               strretchomp(buf);
-               size += strlen(buf) + 2;
-       }
-
-       if (ferror(fp)) {
-               FILE_OP_ERROR(file, "fgets");
-               size = -1;
-       }
-
-       fclose(fp);
-
-       return size;
-}
-
 gboolean file_exist(const gchar *file, gboolean allow_fifo)
 {
        GStatBuf s;
@@ -3557,7 +3531,7 @@ gchar *tzoffset(time_t *now)
        return offset_string;
 }
 
-void get_rfc822_date(gchar *buf, gint len)
+static void _get_rfc822_date(gchar *buf, gint len, gboolean hidetz)
 {
        struct tm *lt;
        time_t t;
@@ -3573,7 +3547,17 @@ void get_rfc822_date(gchar *buf, gint len)
               day, mon, &dd, &hh, &mm, &ss, &yyyy);
 
        g_snprintf(buf, len, "%s, %d %s %d %02d:%02d:%02d %s",
-                  day, dd, mon, yyyy, hh, mm, ss, tzoffset(&t));
+                  day, dd, mon, yyyy, hh, mm, ss, (hidetz? "-0000": tzoffset(&t)));
+}
+
+void get_rfc822_date(gchar *buf, gint len)
+{
+       _get_rfc822_date(buf, len, FALSE);
+}
+
+void get_rfc822_date_hide_tz(gchar *buf, gint len)
+{
+       _get_rfc822_date(buf, len, TRUE);
 }
 
 void debug_set_mode(gboolean mode)