aboutsummaryrefslogtreecommitdiff
path: root/src/inc.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2012-05-02 04:31:04 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2012-05-02 04:31:04 +0000
commit1b55a7f5a4e04628b56f9da7db112a9f5373b33b (patch)
tree3a237b94bccad931366943b8b365c56531d1ac51 /src/inc.c
parent52d4fa94b7b703e95b76f7c4ec64a8a51fe237c0 (diff)
src/inc.c: use a flag to distinguish the state of activity.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3070 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/inc.c')
-rw-r--r--src/inc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/inc.c b/src/inc.c
index ddcfe3ed..bd86daf8 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -73,6 +73,8 @@ typedef struct _IncAccountNewMsgCount
static GList *inc_dialog_list = NULL;
+static gboolean inc_is_running = FALSE;
+
static guint inc_lock_count = 0;
static gboolean block_notify = FALSE;
@@ -279,6 +281,8 @@ void inc_mail(MainWindow *mainwin)
if (!main_window_toggle_online_if_offline(mainwin))
return;
+ inc_is_running = TRUE;
+
inc_autocheck_timer_remove();
summary_write_cache(mainwin->summaryview);
main_window_lock(mainwin);
@@ -290,6 +294,7 @@ void inc_mail(MainWindow *mainwin)
if (execute_command_line(prefs_common.extinc_cmd, FALSE) != 0) {
main_window_unlock(mainwin);
inc_autocheck_timer_set();
+ inc_is_running = FALSE;
return;
}
@@ -314,6 +319,8 @@ void inc_mail(MainWindow *mainwin)
g_slist_free(list);
main_window_unlock(mainwin);
inc_autocheck_timer_set();
+
+ inc_is_running = FALSE;
}
static gint inc_remote_account_mail(MainWindow *mainwin, PrefsAccount *account)
@@ -481,6 +488,8 @@ gint inc_account_mail(MainWindow *mainwin, PrefsAccount *account)
if (!main_window_toggle_online_if_offline(mainwin))
return 0;
+ inc_is_running = TRUE;
+
inc_autocheck_timer_remove();
summary_write_cache(mainwin->summaryview);
main_window_lock(mainwin);
@@ -496,6 +505,8 @@ gint inc_account_mail(MainWindow *mainwin, PrefsAccount *account)
main_window_unlock(mainwin);
inc_autocheck_timer_set();
+ inc_is_running = FALSE;
+
return new_msgs;
}
@@ -512,6 +523,8 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck)
if (!main_window_toggle_online_if_offline(mainwin))
return;
+ inc_is_running = TRUE;
+
inc_autocheck_timer_remove();
summary_write_cache(mainwin->summaryview);
main_window_lock(mainwin);
@@ -564,6 +577,8 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck)
g_slist_free(count_list);
main_window_unlock(mainwin);
inc_autocheck_timer_set();
+
+ inc_is_running = FALSE;
}
gint inc_pop_before_smtp(PrefsAccount *account)
@@ -579,6 +594,8 @@ gint inc_pop_before_smtp(PrefsAccount *account)
if (!main_window_toggle_online_if_offline(mainwin))
return -1;
+ inc_is_running = TRUE;
+
inc_autocheck_timer_remove();
main_window_lock(mainwin);
@@ -602,6 +619,8 @@ gint inc_pop_before_smtp(PrefsAccount *account)
main_window_unlock(mainwin);
inc_autocheck_timer_set();
+ inc_is_running = FALSE;
+
return 0;
}
@@ -1611,6 +1630,9 @@ gboolean inc_is_active(void)
{
GList *cur;
+ if (inc_is_running)
+ return TRUE;
+
if (inc_dialog_list == NULL)
return FALSE;