#endif /* USE_GPGME */
static gint prohibit_duplicate_launch (void);
+static gchar * get_crashfile_name (void);
static void lock_socket_input_cb (gpointer data,
gint source,
GdkInputCondition condition);
/* make one all-folder processing before using sylpheed */
folder_func_to_all_folders(initial_processing, (gpointer *)mainwin);
+ /* if Sylpheed crashed, rebuild caches */
+ if (!cmd.crash && is_file_exist(get_crashfile_name())) {
+ debug_print("Sylpheed crashed, checking for new messages\n");
+ folderview_check_new_all();
+ }
+ /* make the crash-indicator file */
+ str_write_to_file("foo", get_crashfile_name());
+
addressbook_read_file();
inc_autocheck_timer_init(mainwin);
fd_close(lock_socket);
filename = get_socket_name();
unlink(filename);
+
+ /* delete crashfile */
+ if (!cmd.crash)
+ unlink(get_crashfile_name());
#if USE_SSL
ssl_done();
return filename;
}
+static gchar *get_crashfile_name(void)
+{
+ static gchar *filename = NULL;
+
+ if (filename == NULL) {
+ filename = g_strdup_printf("%s%csylpheed-crashed",
+ get_tmp_dir(), G_DIR_SEPARATOR);
+ }
+
+ return filename;
+}
+
static gint prohibit_duplicate_launch(void)
{
gint uxsock;