diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-10-26 00:32:36 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-10-26 00:32:36 +0000 |
commit | 45e0af65ce55552b19aea7f2c876bb64f2c6a114 (patch) | |
tree | a53cd10f9c903b41dc765a5b38c90d3893721442 /hardinfo2 | |
parent | a1db645416cc1ce6a0e775fc2a508695d3608868 (diff) |
Disable Network Updater when there's nothing to be updated.
Fix race condition when switching between entries very quickly caused strange behaviour.
Diffstat (limited to 'hardinfo2')
-rw-r--r-- | hardinfo2/shell.c | 13 | ||||
-rw-r--r-- | hardinfo2/syncmanager.c | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c index db3a6155..50f36f6c 100644 --- a/hardinfo2/shell.c +++ b/hardinfo2/shell.c @@ -589,7 +589,11 @@ void shell_init(GSList * modules) shell_action_set_active("SidePaneAction", TRUE); shell_action_set_active("ToolbarAction", TRUE); +#ifndef HAS_LIBSOUP + shell_action_set_enabled("SyncManagerAction", FALSE); +#else shell_action_set_enabled("SyncManagerAction", sync_manager_count_entries() > 0); +#endif } static gboolean update_field(gpointer data) @@ -1127,6 +1131,8 @@ static void module_selected(gpointer data) GtkTreeIter parent; ShellModuleEntry *entry; static ShellModuleEntry *current = NULL; + static gboolean updating = FALSE; + /* Gets the currently selected item on the left-side TreeView; if there is no selection, silently return */ @@ -1141,6 +1147,12 @@ static void module_selected(gpointer data) current->selected = FALSE; } + if (updating) { + return; + } else { + updating = TRUE; + } + /* Get the current selection and shows its related info */ gtk_tree_model_get(model, &parent, TREE_COL_DATA, &entry, -1); if (entry && !entry->selected) { @@ -1189,6 +1201,7 @@ static void module_selected(gpointer data) } current = entry; + updating = FALSE; } static void info_selected(GtkTreeSelection * ts, gpointer data) diff --git a/hardinfo2/syncmanager.c b/hardinfo2/syncmanager.c index ad075a1d..f4949644 100644 --- a/hardinfo2/syncmanager.c +++ b/hardinfo2/syncmanager.c @@ -96,7 +96,11 @@ static void sync_dialog_netarea_start_actions(SyncDialog * sd, gint sync_manager_count_entries(void) { +#ifdef HAS_LIBSOUP return g_slist_length(entries); +#else + return 0; +#endif } void sync_manager_add_entry(SyncEntry * entry) |