Commit 689866fe authored by Massimo Cora's avatar Massimo Cora

fixed #568119 – Automatic scanning of system-packages doesn't work

	* plugins/symbol-db/plugin.c (on_session_load), (on_project_root_added):
	fixed #568119 – Automatic scanning of system-packages doesn't work

	* plugins/symbol-db/images/Makefile.am:
	* (added) plugins/symbol-db/images/element-interface-24.png
	* (added) plugins/symbol-db/images/element-method-24.png
	* plugins/symbol-db/plugin.c (register_stock_icons):
	added some icons for popup menu.	

svn path=/trunk/; revision=4627
parent 62a5391d
2009-01-23 Massimo Cora' <mcora@svn.gnome.org>
* plugins/symbol-db/images/Makefile.am:
* (added) plugins/symbol-db/images/element-interface-24.png
* (added) plugins/symbol-db/images/element-method-24.png
* plugins/symbol-db/plugin.c (register_stock_icons):
added some icons for popup menu.
2009-01-23 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
reviewed by: Massimo Cora' <mcora@svn.gnome.org>
* plugins/symbol-db/plugin.c (on_session_load), (on_project_root_added):
fixed #568119 – Automatic scanning of system-packages doesn't work
2009-01-20 Sébastien Granjoux <seb.sfo@free.fr> 2009-01-20 Sébastien Granjoux <seb.sfo@free.fr>
* manuals/anjuta-manual/C/debugger.xml: * manuals/anjuta-manual/C/debugger.xml:
...@@ -56,7 +56,7 @@ libanjuta_symbol_db_la_SOURCES = plugin.c plugin.h \ ...@@ -56,7 +56,7 @@ libanjuta_symbol_db_la_SOURCES = plugin.c plugin.h \
symbol-db-view-locals.h \ symbol-db-view-locals.h \
symbol-db-view-search.h \ symbol-db-view-search.h \
symbol-db-view-search.c \ symbol-db-view-search.c \
symbol-db-engine-iterator-node.h \ symbol-db-engine-iterator-node.h \
symbol-db-engine-iterator-node.c \ symbol-db-engine-iterator-node.c \
symbol-db-system.h \ symbol-db-system.h \
symbol-db-system.c symbol-db-prefs.h \ symbol-db-system.c symbol-db-prefs.h \
......
...@@ -8,7 +8,9 @@ symbol_browser_icons_DATA = \ ...@@ -8,7 +8,9 @@ symbol_browser_icons_DATA = \
element-event-16.png \ element-event-16.png \
element-field-16.png \ element-field-16.png \
element-interface-16.png \ element-interface-16.png \
element-interface-24.png \
element-method-16.png \ element-method-16.png \
element-method-24.png \
element-namespace-16.png \ element-namespace-16.png \
element-property-16.png \ element-property-16.png \
element-structure-16.png element-structure-16.png
......
...@@ -57,6 +57,12 @@ ...@@ -57,6 +57,12 @@
#define SESSION_SECTION "SymbolDB" #define SESSION_SECTION "SymbolDB"
#define SESSION_KEY "SystemPackages" #define SESSION_KEY "SystemPackages"
#define ANJUTA_PIXMAP_GOTO_DECLARATION "element-interface"
#define ANJUTA_PIXMAP_GOTO_IMPLEMENTATION "element-method"
#define ANJUTA_STOCK_GOTO_DECLARATION "element-interface"
#define ANJUTA_STOCK_GOTO_IMPLEMENTATION "element-method"
static gpointer parent_class; static gpointer parent_class;
/* signals */ /* signals */
...@@ -92,6 +98,8 @@ register_stock_icons (AnjutaPlugin *plugin) ...@@ -92,6 +98,8 @@ register_stock_icons (AnjutaPlugin *plugin)
/* Register stock icons */ /* Register stock icons */
BEGIN_REGISTER_ICON (plugin); BEGIN_REGISTER_ICON (plugin);
REGISTER_ICON (ICON_FILE, "symbol-db-plugin-icon"); REGISTER_ICON (ICON_FILE, "symbol-db-plugin-icon");
REGISTER_ICON_FULL (ANJUTA_PIXMAP_GOTO_DECLARATION, ANJUTA_STOCK_GOTO_DECLARATION);
REGISTER_ICON_FULL (ANJUTA_PIXMAP_GOTO_IMPLEMENTATION, ANJUTA_STOCK_GOTO_IMPLEMENTATION);
END_REGISTER_ICON; END_REGISTER_ICON;
} }
...@@ -266,7 +274,7 @@ static GtkActionEntry actions[] = ...@@ -266,7 +274,7 @@ static GtkActionEntry actions[] =
{ "ActionMenuGoto", NULL, N_("_Goto"), NULL, NULL, NULL}, { "ActionMenuGoto", NULL, N_("_Goto"), NULL, NULL, NULL},
{ {
"ActionSymbolDBGotoDecl", "ActionSymbolDBGotoDecl",
NULL, ANJUTA_STOCK_GOTO_DECLARATION,
N_("Tag De_claration"), N_("Tag De_claration"),
"<shift><control>d", "<shift><control>d",
N_("Goto symbol declaration"), N_("Goto symbol declaration"),
...@@ -274,7 +282,7 @@ static GtkActionEntry actions[] = ...@@ -274,7 +282,7 @@ static GtkActionEntry actions[] =
}, },
{ {
"ActionSymbolDBGotoImpl", "ActionSymbolDBGotoImpl",
NULL, ANJUTA_STOCK_GOTO_IMPLEMENTATION,
N_("Tag _Implementation"), N_("Tag _Implementation"),
"<control>d", "<control>d",
N_("Goto symbol definition"), N_("Goto symbol definition"),
...@@ -642,41 +650,15 @@ on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase, ...@@ -642,41 +650,15 @@ on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase,
if (phase == ANJUTA_SESSION_PHASE_START) if (phase == ANJUTA_SESSION_PHASE_START)
{ {
GList *session_packages = anjuta_session_get_string_list (session, sdb_plugin->session_packages = anjuta_session_get_string_list (session,
SESSION_SECTION, SESSION_SECTION,
SESSION_KEY); SESSION_KEY);
GList *to_scan_packages = NULL;
DEBUG_PRINT ("SymbolDB: session_loading started. Getting info from %s", DEBUG_PRINT ("SymbolDB: session_loading started. Getting info from %s",
anjuta_session_get_session_directory (session)); anjuta_session_get_session_directory (session));
sdb_plugin->session_loading = TRUE; sdb_plugin->session_loading = TRUE;
if (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);
/* letting session_packages to NULL won't start the population */
if (automatic_scan == TRUE)
{
GList *project_default_packages =
ianjuta_project_manager_get_packages (pm, NULL);
/* take the project's defaults */
to_scan_packages = project_default_packages;
}
}
else
{
to_scan_packages = session_packages;
}
sdb_plugin->session_packages = to_scan_packages;
/* no need to free the GList(s) */
} }
else if (phase == ANJUTA_SESSION_PHASE_END) else if (phase == ANJUTA_SESSION_PHASE_END)
{ {
IAnjutaDocumentManager* docman; IAnjutaDocumentManager* docman;
...@@ -1756,6 +1738,21 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name, ...@@ -1756,6 +1738,21 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name,
*/ */
gtk_widget_hide (sdb_plugin->progress_bar_system); gtk_widget_hide (sdb_plugin->progress_bar_system);
pm = anjuta_shell_get_interface (ANJUTA_PLUGIN (sdb_plugin)->shell,
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 */ /* get preferences about the parallel scan */
gboolean parallel_scan = anjuta_preferences_get_int (sdb_plugin->prefs, gboolean parallel_scan = anjuta_preferences_get_int (sdb_plugin->prefs,
PARALLEL_SCAN); PARALLEL_SCAN);
...@@ -1770,9 +1767,7 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name, ...@@ -1770,9 +1767,7 @@ on_project_root_added (AnjutaPlugin *plugin, const gchar *name,
/* /*
* The Project thing * The Project thing
*/ */
pm = anjuta_shell_get_interface (ANJUTA_PLUGIN (sdb_plugin)->shell,
IAnjutaProjectManager, NULL);
g_free (sdb_plugin->project_root_uri); g_free (sdb_plugin->project_root_uri);
sdb_plugin->project_root_uri = NULL; sdb_plugin->project_root_uri = 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