anjuta r4637 - in trunk: . plugins/debug-manager
- From: sgranjoux svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4637 - in trunk: . plugins/debug-manager
- Date: Sun, 25 Jan 2009 16:18:19 +0000 (UTC)
Author: sgranjoux
Date: Sun Jan 25 16:18:19 2009
New Revision: 4637
URL: http://svn.gnome.org/viewvc/anjuta?rev=4637&view=rev
Log:
* plugins/debug-manager/start.c,
plugins/debug-manager/plugin.c,
plugins/debug-manager/threads.c,
plugins/debug-manager/stack_trace.c,
plugins/debug-manager/breakpoints.c:
fix #511589 for debug-manager plugin
Modified:
trunk/ChangeLog
trunk/plugins/debug-manager/Makefile.am
trunk/plugins/debug-manager/breakpoints.c
trunk/plugins/debug-manager/plugin.c
trunk/plugins/debug-manager/stack_trace.c
trunk/plugins/debug-manager/start.c
trunk/plugins/debug-manager/threads.c
Modified: trunk/plugins/debug-manager/Makefile.am
==============================================================================
--- trunk/plugins/debug-manager/Makefile.am (original)
+++ trunk/plugins/debug-manager/Makefile.am Sun Jan 25 16:18:19 2009
@@ -14,6 +14,7 @@
AM_CPPFLAGS= \
$(WARN_CFLAGS) \
$(DEPRECATED_FLAGS) \
+ $(GIO_CFLAGS) \
$(LIBANJUTA_CFLAGS)
plugindir = $(anjuta_plugin_dir)
@@ -22,8 +23,8 @@
libanjuta_debug_manager_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
libanjuta_debug_manager_la_LIBADD = \
- $(GNOME_UI_LIBS) \
$(GLADE_LIBS) \
+ $(GIO_LIBS) \
$(LIBANJUTA_LIBS)
# Marshallers
Modified: trunk/plugins/debug-manager/breakpoints.c
==============================================================================
--- trunk/plugins/debug-manager/breakpoints.c (original)
+++ trunk/plugins/debug-manager/breakpoints.c Sun Jan 25 16:18:19 2009
@@ -49,8 +49,7 @@
#include <string.h>
#include <ctype.h>
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
+#include <gio/gio.h>
#include <libanjuta/resources.h>
#include <libanjuta/anjuta-debug.h>
@@ -155,7 +154,11 @@
bi->bp.file = g_strdup (bp->file);
bi->bp.line = bp->line;
if ((bi->uri == NULL) && (g_path_is_absolute (bp->file)))
- bi->uri = gnome_vfs_get_uri_from_local_path (bp->file);
+ {
+ GFile *file = g_file_new_for_path (bp->file);
+ bi->uri = g_file_get_uri (file);
+ g_object_unref (file);
+ }
}
if (bp->type & IANJUTA_DEBUGGER_BREAKPOINT_ON_FUNCTION)
{
@@ -259,7 +262,7 @@
if (uri != NULL)
{
bi->uri = g_strdup (uri);
- bi->bp.file = gnome_vfs_get_local_path_from_uri (uri);
+ bi->bp.file = anjuta_util_get_local_path_from_uri (uri);
bi->bp.line = line;
}
bi->bp.enable = enable;
@@ -290,7 +293,7 @@
else if ((uri != NULL) && isdigit (*string))
{
bi->uri = g_strdup (uri);
- bi->bp.file = gnome_vfs_get_local_path_from_uri (uri);
+ bi->bp.file = anjuta_util_get_local_path_from_uri (uri);
bi->bp.line = strtoul (string, NULL, 10);
bi->bp.type = IANJUTA_DEBUGGER_BREAKPOINT_ON_LINE;
}
@@ -321,7 +324,9 @@
bi->bp.file = g_strndup (string, ptr - string);
if (g_path_is_absolute (bi->bp.file))
{
- bi->uri = gnome_vfs_get_uri_from_local_path (bi->bp.file);
+ GFile *file = g_file_new_for_path (bi->bp.file);
+ bi->uri = g_file_get_uri (file);
+ g_object_unref (file);
}
}
}
Modified: trunk/plugins/debug-manager/plugin.c
==============================================================================
--- trunk/plugins/debug-manager/plugin.c (original)
+++ trunk/plugins/debug-manager/plugin.c Sun Jan 25 16:18:19 2009
@@ -50,7 +50,7 @@
#include <libanjuta/interfaces/ianjuta-document-manager.h>
#include <libanjuta/interfaces/ianjuta-message-manager.h>
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
/* Contants defintion
*---------------------------------------------------------------------------*/
Modified: trunk/plugins/debug-manager/stack_trace.c
==============================================================================
--- trunk/plugins/debug-manager/stack_trace.c (original)
+++ trunk/plugins/debug-manager/stack_trace.c Sun Jan 25 16:18:19 2009
@@ -27,14 +27,14 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
-#include <gnome.h>
+
+#include <gio/gio.h>
/*#define DEBUG*/
#include <libanjuta/resources.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-editor.h>
#include <libanjuta/interfaces/ianjuta-document-manager.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
#include "utilities.h"
#include "info.h"
@@ -292,8 +292,10 @@
{
if (g_path_is_absolute (frame->file))
{
- uri = gnome_vfs_get_uri_from_local_path(frame->file);
+ GFile *gio_file = g_file_new_for_path (frame->file);
+ uri = g_file_get_uri (gio_file);
file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
+ g_object_unref (gio_file);
}
else
{
Modified: trunk/plugins/debug-manager/start.c
==============================================================================
--- trunk/plugins/debug-manager/start.c (original)
+++ trunk/plugins/debug-manager/start.c Sun Jan 25 16:18:19 2009
@@ -42,10 +42,8 @@
#include <libanjuta/interfaces/ianjuta-file-savable.h>
#include <libanjuta/anjuta-utils.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
#include <glade/glade-xml.h>
+#include <gio/gio.h>
#include <errno.h>
#include <sys/stat.h>
@@ -181,10 +179,13 @@
GList *slibs_dirs = NULL;
GList *libs_dirs = NULL;
GValue value = {0,};
+ GFile *file;
return NULL;
cwd = g_get_current_dir();
- search_dirs = g_list_prepend (search_dirs, gnome_vfs_get_uri_from_local_path(cwd));
+ file = g_file_new_for_path (cwd);
+ search_dirs = g_list_prepend (search_dirs, g_file_get_uri (file));
+ g_object_unref (file);
g_free (cwd);
/* Check if a project is already open */
@@ -854,7 +855,7 @@
if (dir_uri != NULL)
{
- dir = gnome_vfs_get_local_path_from_uri (dir_uri);
+ dir = anjuta_util_get_local_path_from_uri (dir_uri);
g_free (dir_uri);
}
else
@@ -893,20 +894,45 @@
{
gchar *mime_type;
gchar *filename;
-
- mime_type = gnome_vfs_get_mime_type ((const gchar *)target);
+ GFile *file;
+ GFileInfo *file_info;
+ GError *error = NULL;
+
+ DEBUG_PRINT ("Using target %s", target);
+ file = g_file_new_for_uri (target);
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ G_FILE_QUERY_INFO_NONE,
+ NULL, &error);
+ if (file_info == NULL)
+ {
+ DEBUG_PRINT ("Error getting file info: %s", error->message);
+ g_error_free (error);
+ anjuta_util_dialog_error(GTK_WINDOW (this->plugin->shell),
+ _("Unable to open %s. (file_info) Debugger cannot start."), target);
+ g_object_unref (file);
+ return FALSE;
+ }
+
+ mime_type = g_file_info_get_attribute_as_string (file_info,
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
if (mime_type == NULL)
{
anjuta_util_dialog_error(GTK_WINDOW (this->plugin->shell),
- _("Unable to open %s. Debugger cannot start."), target);
+ _("Unable to open %s. (mime_type) Debugger cannot start."), target);
+ g_object_unref (file_info);
+ g_object_unref (file);
return FALSE;
}
- filename = gnome_vfs_get_local_path_from_uri (target);
+
+ filename = g_file_get_path (file);
dma_queue_load (this->debugger, filename, mime_type, this->source_dirs);
g_free (filename);
g_free (mime_type);
+ g_object_unref (file_info);
+ g_object_unref (file);
return TRUE;
}
@@ -988,14 +1014,16 @@
static gboolean
dma_start_load_and_start_uri (DmaStart *this, const gchar *target)
{
- GnomeVFSURI *vfs_uri;
+ gchar *local_path = NULL;
if (!dma_quit_debugger (this)) return FALSE;
- vfs_uri = gnome_vfs_uri_new (target);
- g_return_val_if_fail (vfs_uri != NULL, TRUE);
- if (!gnome_vfs_uri_is_local (vfs_uri)) return FALSE;
- gnome_vfs_uri_unref (vfs_uri);
+ local_path = anjuta_util_get_local_path_from_uri (target);
+ if (!local_path)
+ {
+ return FALSE;
+ }
+ g_free (local_path);
return check_target (this, target);
}
@@ -1113,7 +1141,7 @@
GtkTreeIter iter;
gchar *local;
- local = gnome_vfs_get_local_path_from_uri ((const char *)data);
+ local = anjuta_util_get_local_path_from_uri ((const char *)data);
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter, 0, local, -1);
g_free (local);
@@ -1125,10 +1153,13 @@
GList** list = (GList **)user_data;
gchar* dir;
gchar* uri;
+ GFile *file;
gtk_tree_model_get (model, iter, 0, &dir, -1);
- uri = gnome_vfs_get_uri_from_local_path (dir);
+ file = g_file_new_for_path (dir);
+ uri = g_file_get_uri (file);
*list = g_list_prepend (*list, uri);
+ g_object_unref (file);
g_free (dir);
return FALSE;
Modified: trunk/plugins/debug-manager/threads.c
==============================================================================
--- trunk/plugins/debug-manager/threads.c (original)
+++ trunk/plugins/debug-manager/threads.c Sun Jan 25 16:18:19 2009
@@ -29,8 +29,7 @@
#include <unistd.h>
#include <string.h>
#include <ctype.h>
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
/*#define DEBUG*/
#include <libanjuta/resources.h>
@@ -223,8 +222,10 @@
{
if (g_path_is_absolute (frame->file))
{
- uri = gnome_vfs_get_uri_from_local_path(frame->file);
+ GFile *gio_file = g_file_new_for_path (frame->file);
+ uri = g_file_get_uri (gio_file);
file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
+ g_object_unref (gio_file);
}
else
{
@@ -325,8 +326,10 @@
{
if (g_path_is_absolute (frame->file))
{
- uri = gnome_vfs_get_uri_from_local_path(frame->file);
+ GFile *gio_file = g_file_new_for_path (frame->file);
+ uri = g_file_get_uri (gio_file);
file = strrchr(frame->file, G_DIR_SEPARATOR) + 1;
+ g_object_unref (gio_file);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]