Commit 3b8ff98d authored by Massimo Cora's avatar Massimo Cora

fixed #570877 – symbol-db doesn't scan user-added packages.

	* plugins/symbol-db/plugin.c (on_session_save), (on_session_load),
	(on_project_root_added):
	* plugins/symbol-db/symbol-db-system.c (sdb_system_do_engine_scan):
	fixed #570877 – symbol-db doesn't scan user-added packages.

svn path=/trunk/; revision=4711
parent 210059d7
2009-02-08 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
reviewed by: Massimo Cora' <mcora@svn.gnome.org>
* plugins/symbol-db/plugin.c (on_session_save), (on_session_load),
(on_project_root_added):
* plugins/symbol-db/symbol-db-system.c (sdb_system_do_engine_scan):
fixed #570877 – symbol-db doesn't scan user-added packages.
2009-02-08 Yang Hong <hongyang@redflag-linux.com> 2009-02-08 Yang Hong <hongyang@redflag-linux.com>
* plugins/git/plugin.c (git_activate_plugin): * plugins/git/plugin.c (git_activate_plugin):
...@@ -683,74 +683,6 @@ value_added_current_editor (AnjutaPlugin *plugin, const char *name, ...@@ -683,74 +683,6 @@ value_added_current_editor (AnjutaPlugin *plugin, const char *name,
sdb_plugin->need_symbols_update = FALSE; sdb_plugin->need_symbols_update = FALSE;
} }
static void
on_session_save (AnjutaShell *shell, AnjutaSessionPhase phase,
AnjutaSession *session,
SymbolDBPlugin *sdb_plugin)
{
if (phase != ANJUTA_SESSION_PHASE_NORMAL)
return;
DEBUG_PRINT ("%s", "SymbolDB: session_save");
anjuta_session_set_string_list (session,
SESSION_SECTION,
SESSION_KEY,
sdb_plugin->session_packages);
}
static void
on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
AnjutaSession *session,
SymbolDBPlugin *sdb_plugin)
{
IAnjutaProjectManager *pm;
pm = anjuta_shell_get_interface (ANJUTA_PLUGIN (sdb_plugin)->shell,
IAnjutaProjectManager, NULL);
if (phase == ANJUTA_SESSION_PHASE_START)
{
sdb_plugin->session_packages = anjuta_session_get_string_list (session,
SESSION_SECTION,
SESSION_KEY);
DEBUG_PRINT ("SymbolDB: session_loading started. Getting info from %s",
anjuta_session_get_session_directory (session));
sdb_plugin->session_loading = TRUE;
}
else if (phase == ANJUTA_SESSION_PHASE_END)
{
IAnjutaDocumentManager* docman;
sdb_plugin->session_loading = FALSE;
DEBUG_PRINT ("SymbolDB: session_loading finished");
/* Show the symbols for the current editor */
docman = anjuta_shell_get_interface (shell, IAnjutaDocumentManager, NULL);
if (docman)
{
IAnjutaDocument* cur_doc =
ianjuta_document_manager_get_current_document (docman, NULL);
if (cur_doc)
{
GValue value = {0, };
g_value_init (&value, G_TYPE_OBJECT);
g_value_set_object (&value, cur_doc);
value_added_current_editor (ANJUTA_PLUGIN (sdb_plugin),
"document_manager_current_document",
&value, NULL);
g_value_unset(&value);
}
}
if (sdb_plugin->project_opened == NULL)
{
gtk_widget_hide (sdb_plugin->progress_bar_project);
gtk_widget_hide (sdb_plugin->progress_bar_system);
}
}
}
static void static void
on_editor_foreach_disconnect (gpointer key, gpointer value, gpointer user_data) on_editor_foreach_disconnect (gpointer key, gpointer value, gpointer user_data)
{ {
...@@ -1724,6 +1656,95 @@ do_check_offline_files_changed (SymbolDBPlugin *sdb_plugin) ...@@ -1724,6 +1656,95 @@ do_check_offline_files_changed (SymbolDBPlugin *sdb_plugin)
return real_added > 0 ? TRUE : FALSE; return real_added > 0 ? TRUE : FALSE;
} }
static void
on_session_save (AnjutaShell *shell, AnjutaSessionPhase phase,
AnjutaSession *session,
SymbolDBPlugin *sdb_plugin)
{
if (phase != ANJUTA_SESSION_PHASE_NORMAL)
return;
DEBUG_PRINT ("%s", "SymbolDB: session_save");
anjuta_session_set_string_list (session,
SESSION_SECTION,
SESSION_KEY,
sdb_plugin->session_packages);
}
static void
on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
AnjutaSession *session,
SymbolDBPlugin *sdb_plugin)
{
IAnjutaProjectManager *pm;
pm = anjuta_shell_get_interface (ANJUTA_PLUGIN (sdb_plugin)->shell,
IAnjutaProjectManager, NULL);
if (phase == ANJUTA_SESSION_PHASE_START)
{
sdb_plugin->session_packages = anjuta_session_get_string_list (session,
SESSION_SECTION,
SESSION_KEY);
DEBUG_PRINT ("SymbolDB: session_loading started. Getting info from %s",
anjuta_session_get_session_directory (session));
sdb_plugin->session_loading = TRUE;
if (sdb_plugin->session_packages == NULL)
{
/* hey, does user want to import system sources for this project? */
gboolean automatic_scan = anjuta_preferences_get_int (sdb_plugin->prefs,
PROJECT_AUTOSCAN);
if (automatic_scan == TRUE)
{
sdb_plugin->session_packages = ianjuta_project_manager_get_packages (pm, NULL);
}
}
/* get preferences about the parallel scan */
gboolean parallel_scan = anjuta_preferences_get_int (sdb_plugin->prefs,
PARALLEL_SCAN);
if (parallel_scan == TRUE)
{
/* we simulate a project-import-end signal received */
do_import_system_sources (sdb_plugin);
}
}
else if (phase == ANJUTA_SESSION_PHASE_END)
{
IAnjutaDocumentManager* docman;
sdb_plugin->session_loading = FALSE;
DEBUG_PRINT ("SymbolDB: session_loading finished");
/* Show the symbols for the current editor */
docman = anjuta_shell_get_interface (shell, IAnjutaDocumentManager, NULL);
if (docman)
{
IAnjutaDocument* cur_doc =
ianjuta_document_manager_get_current_document (docman, NULL);
if (cur_doc)
{
GValue value = {0, };
g_value_init (&value, G_TYPE_OBJECT);
g_value_set_object (&value, cur_doc);
value_added_current_editor (ANJUTA_PLUGIN (sdb_plugin),
"document_manager_current_document",
&value, NULL);
g_value_unset(&value);
}
}
if (sdb_plugin->project_opened == NULL)
{
gtk_widget_hide (sdb_plugin->progress_bar_project);
gtk_widget_hide (sdb_plugin->progress_bar_system);
}
}
}
/* add a new project */ /* add a new project */
static void static void
on_project_root_added (AnjutaPlugin *plugin, const gchar *name, on_project_root_added (AnjutaPlugin *plugin, const gchar *name,
...@@ -1760,7 +1781,6 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name, ...@@ -1760,7 +1781,6 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name,
sdb_plugin->sdbe_globals); sdb_plugin->sdbe_globals);
} }
/* Hide the progress bar. Default system tags thing: we'll import after abort even /* Hide the progress bar. Default system tags thing: we'll import after abort even
* if the preferences says not to automatically scan the packages. * if the preferences says not to automatically scan the packages.
*/ */
...@@ -1769,30 +1789,6 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name, ...@@ -1769,30 +1789,6 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name,
pm = anjuta_shell_get_interface (ANJUTA_PLUGIN (sdb_plugin)->shell, pm = anjuta_shell_get_interface (ANJUTA_PLUGIN (sdb_plugin)->shell,
IAnjutaProjectManager, NULL); IAnjutaProjectManager, NULL);
if (sdb_plugin->session_packages == NULL)
{
/* hey, does user want to import system sources for this project? */
gboolean automatic_scan = anjuta_preferences_get_int (sdb_plugin->prefs,
PROJECT_AUTOSCAN);
if (automatic_scan == TRUE)
{
sdb_plugin->session_packages = ianjuta_project_manager_get_packages (pm, NULL);
}
}
/* get preferences about the parallel scan */
gboolean parallel_scan = anjuta_preferences_get_int (sdb_plugin->prefs,
PARALLEL_SCAN);
if (parallel_scan == TRUE)
{
/* we simulate a project-import-end signal received */
do_import_system_sources (sdb_plugin);
}
/* /*
* The Project thing * The Project thing
*/ */
......
...@@ -547,6 +547,7 @@ sdb_system_do_engine_scan (SymbolDBSystem *sdbs, EngineScanData *es_data) ...@@ -547,6 +547,7 @@ sdb_system_do_engine_scan (SymbolDBSystem *sdbs, EngineScanData *es_data)
/* if no scan has started destroy the engine data here */ /* if no scan has started destroy the engine data here */
else if (proc_id <= 0) else if (proc_id <= 0)
{ {
g_queue_remove (priv->engine_queue, es_data);
destroy_engine_scan_data (es_data); destroy_engine_scan_data (es_data);
es_data = NULL; es_data = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment