From 3e93073bfbdc96b066711f92b0b68504df55d749 Mon Sep 17 00:00:00 2001 From: sgranjoux Date: Sat, 26 Jan 2008 10:54:45 +0000 Subject: [PATCH] * plugins/symbol-browser/plugin.c, plugins/symbol-browser/an_symbol_view.c: use gnome_vfs_get_uri_from_local_path to get local path from uri This takes care of escaping some characters git-svn-id: http://svn.gnome.org/svn/anjuta/trunk@3522 1dbfb86a-d425-0410-a06b-cb591aac69f6 --- ChangeLog | 7 +++++++ plugins/symbol-browser/an_symbol_view.c | 18 ++++++++---------- plugins/symbol-browser/plugin.c | 8 ++++---- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12606d03..6dec3164 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-01-26 Sébastien Granjoux + + * plugins/symbol-browser/plugin.c, + plugins/symbol-browser/an_symbol_view.c: + use gnome_vfs_get_uri_from_local_path to get local path from uri + This takes care of escaping some characters + 2008-01-25 Sébastien Granjoux * plugins/debug-manager/stack_trace.c: diff --git a/plugins/symbol-browser/an_symbol_view.c b/plugins/symbol-browser/an_symbol_view.c index 83c2aa18..c0ee59fb 100644 --- a/plugins/symbol-browser/an_symbol_view.c +++ b/plugins/symbol-browser/an_symbol_view.c @@ -1237,17 +1237,15 @@ void anjuta_symbol_view_workspace_add_file (AnjutaSymbolView * sv, const gchar * file_uri) { - const gchar *uri; + gchar *uri; TMWorkObject *tm_file; GtkTreeModel *store = NULL; g_return_if_fail (ANJUTA_IS_SYMBOL_VIEW (sv)); g_return_if_fail (file_uri != NULL); - if (strncmp (file_uri, "file://", 7) == 0) - uri = &file_uri[7]; - else - return; + uri = gnome_vfs_get_local_path_from_uri (file_uri); + if (uri == NULL) return; /* Not a local path */ store = g_hash_table_lookup (sv->priv->tm_files, uri); if (!store) @@ -1286,6 +1284,7 @@ anjuta_symbol_view_workspace_add_file (AnjutaSymbolView * sv, g_strdup (uri), store); } } + g_free (uri); sv->priv->file_symbol_model = store; } @@ -1293,19 +1292,18 @@ void anjuta_symbol_view_workspace_remove_file (AnjutaSymbolView * sv, const gchar * file_uri) { - const gchar *uri; + gchar *uri; g_return_if_fail (ANJUTA_IS_SYMBOL_VIEW (sv)); g_return_if_fail (file_uri != NULL); DEBUG_PRINT ("Removing Symbol URI: %s", file_uri); - if (strncmp (file_uri, "file://", 7) == 0) - uri = &file_uri[7]; - else - uri = file_uri; + uri = gnome_vfs_get_local_path_from_uri (file_uri); + if (uri == NULL) return; /* Not a local path */ if (g_hash_table_lookup (sv->priv->tm_files, uri)) g_hash_table_remove (sv->priv->tm_files, uri); + g_free (uri); } diff --git a/plugins/symbol-browser/plugin.c b/plugins/symbol-browser/plugin.c index 8a49f470..e9c7c67f 100644 --- a/plugins/symbol-browser/plugin.c +++ b/plugins/symbol-browser/plugin.c @@ -87,16 +87,16 @@ static void goto_file_line (AnjutaPlugin *plugin, const gchar *filename, gint lineno) { gchar *uri; - IAnjutaFileLoader *loader; + IAnjutaDocumentManager *docman; g_return_if_fail (filename != NULL); /* Go to file and line number */ - loader = anjuta_shell_get_interface (plugin->shell, IAnjutaFileLoader, + docman = anjuta_shell_get_interface (plugin->shell, IAnjutaDocumentManager, NULL); - uri = g_strdup_printf ("file:///%s#%d", filename, lineno); - ianjuta_file_loader_load (loader, uri, FALSE, NULL); + uri = gnome_vfs_get_uri_from_local_path (filename); + ianjuta_document_manager_goto_file_line (docman, uri, lineno, NULL); g_free (uri); } -- 2.11.4.GIT