anjuta r4609 - in trunk: . libanjuta plugins/document-manager plugins/gbf-am plugins/gbf-mkfile plugins/glade plugins/gtodo plugins/indent plugins/patch plugins/project-manager plugins/search plugins/sourceview plugins/valgrind src
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4609 - in trunk: . libanjuta plugins/document-manager plugins/gbf-am plugins/gbf-mkfile plugins/glade plugins/gtodo plugins/indent plugins/patch plugins/project-manager plugins/search plugins/sourceview plugins/valgrind src
- Date: Mon, 19 Jan 2009 14:18:45 +0000 (UTC)
Author: jhs
Date: Mon Jan 19 14:18:45 2009
New Revision: 4609
URL: http://svn.gnome.org/viewvc/anjuta?rev=4609&view=rev
Log:
2009-01-19 Jens Georg <mail jensge org>
* configure.in
* src/main.c
* plugins/glade/plugin.c
* src/anjuta.c
* libanjuta/anjuta-utils.c
* libanjuta/anjuta-preferences.c
* libanjuta/anjuta-plugin-manager.c:
#511589 - port to gio - removing everything that remains
2009-01-19 Jens Georg <mail jensge org>
* plugins/gbf-mkfile/Makefile.am:
* plugins/gbf-mkfile/gbf-mkfile-project.c (uri_is_equal),
(uri_is_parent), (uri_normalize), (uri_get_chrooted_path),
(xml_new_change_doc), (monitor_cb), (monitor_add),
(monitors_setup), (sax_start_element), (spawn_shutdown),
(spawn_kill_child), (spawn_script), (project_reload),
(project_update), (gbf_mkfile_project_set_config),
(gbf_mkfile_project_set_group_config),
(gbf_mkfile_project_set_target_config), (impl_load), (impl_probe),
(impl_add_group), (impl_remove_group), (impl_add_target),
(impl_remove_target), (impl_add_source), (impl_remove_source):
#511589 - port to gio. Removed resolution of "~" in uris; also
fixes a bug creating uris like "file:///a/b/c/a/b/c.c" for file
entries
2009-01-19 Jens Georg <mail jensge org>
reviewed by: <delete if not using a buddy>
* plugins/gbf-am/Makefile.am:
* plugins/gbf-am/gbf-am-project.c (uri_is_equal), (uri_is_parent),
(uri_normalize), (uri_get_chrooted_path), (xml_new_change_doc),
(monitor_cb), (monitor_add), (monitors_setup), (spawn_shutdown),
(spawn_write_child), (spawn_kill_child), (spawn_script),
(project_reload), (project_update), (gbf_am_project_set_config),
(gbf_am_project_set_group_config),
(gbf_am_project_set_target_config), (impl_load), (impl_probe),
(impl_add_group), (impl_remove_group), (impl_add_target),
(impl_remove_target), (impl_add_source), (impl_remove_source):
#511589 - port to gio. Removed resolution of "~" in uris
2009-01-19 Jens Georg <mail jensge org>
* plugins/project-manager/gbf-project-util.c
(browse_button_clicked_cb):
* plugins/project-manager/gbf-tree-data.c
(gbf_tree_data_new_source):
* plugins/project-manager/plugin.c (update_title),
(on_popup_add_to_project), (project_manager_load_gbf),
(get_uri_vfs_type), (get_element_id_from_uri),
(iproject_manager_get_element_type), (ifile_open):
#511589 - Fix port to GIO of project manager
2009-01-19 Jens Georg <mail jensge org>
* plugins/document-manager/Makefile.am:
* plugins/glade/anjuta-design-document.c:
* plugins/gtodo/Makefile.am:
* plugins/indent/indent-util.c (indent_get_buffer):
* plugins/patch/plugin.c:
* plugins/search/search-replace_backend.c (create_search_entries):
* plugins/sourceview/Makefile.am:
* plugins/valgrind/preferences.c:
* plugins/valgrind/vgdefaultview.c:
* plugins/valgrind/vggeneralprefs.c:
#511589 - mostly cosmetical changes like removing #include directives,
makefile references etc.
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/libanjuta/anjuta-plugin-manager.c
trunk/libanjuta/anjuta-preferences.c
trunk/libanjuta/anjuta-utils.c
trunk/plugins/document-manager/Makefile.am
trunk/plugins/gbf-am/Makefile.am
trunk/plugins/gbf-am/gbf-am-project.c
trunk/plugins/gbf-mkfile/Makefile.am
trunk/plugins/gbf-mkfile/gbf-mkfile-project.c
trunk/plugins/glade/anjuta-design-document.c
trunk/plugins/glade/plugin.c
trunk/plugins/gtodo/Makefile.am
trunk/plugins/indent/indent-util.c
trunk/plugins/patch/plugin.c
trunk/plugins/project-manager/gbf-project-model.c
trunk/plugins/project-manager/gbf-project-util.c
trunk/plugins/project-manager/gbf-tree-data.c
trunk/plugins/project-manager/plugin.c
trunk/plugins/search/search-replace_backend.c
trunk/plugins/sourceview/Makefile.am
trunk/plugins/valgrind/preferences.c
trunk/plugins/valgrind/vgdefaultview.c
trunk/plugins/valgrind/vggeneralprefs.c
trunk/src/anjuta.c
trunk/src/main.c
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Mon Jan 19 14:18:45 2009
@@ -158,7 +158,7 @@
PKG_CHECK_MODULES(GLADE, libglade-2.0 >= $LIBGLADE_REQUIRED)
-PKG_CHECK_MODULES(GNOME, libgnome-2.0 >= $GNOME_REQUIRED libgnomeui-2.0 >= $GNOME_REQUIRED gnome-vfs-2.0 >= $GNOME_REQUIRED libgnomecanvas-2.0 >= $GNOME_REQUIRED gnome-vfs-module-2.0 >= $GNOME_REQUIRED libgnomeprint-2.2 >= $GNOME_REQUIRED libgnomeprintui-2.2 >= $GNOME_REQUIRED)
+PKG_CHECK_MODULES(GNOME, libgnome-2.0 >= $GNOME_REQUIRED libgnomeui-2.0 >= $GNOME_REQUIRED libgnomecanvas-2.0 >= $GNOME_REQUIRED libgnomeprint-2.2 >= $GNOME_REQUIRED libgnomeprintui-2.2 >= $GNOME_REQUIRED)
PKG_CHECK_MODULES(GCONF, gconf-2.0 >= $GCONF_REQUIRED)
Modified: trunk/libanjuta/anjuta-plugin-manager.c
==============================================================================
--- trunk/libanjuta/anjuta-plugin-manager.c (original)
+++ trunk/libanjuta/anjuta-plugin-manager.c Mon Jan 19 14:18:45 2009
@@ -30,7 +30,6 @@
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
-#include <libgnomevfs/gnome-vfs.h>
#include <libanjuta/anjuta-plugin-manager.h>
#include <libanjuta/anjuta-marshal.h>
Modified: trunk/libanjuta/anjuta-preferences.c
==============================================================================
--- trunk/libanjuta/anjuta-preferences.c (original)
+++ trunk/libanjuta/anjuta-preferences.c Mon Jan 19 14:18:45 2009
@@ -67,7 +67,6 @@
#include <glade/glade-parser.h>
#include <gconf/gconf-client.h>
-#include <libgnomevfs/gnome-vfs.h>
#include <libanjuta/anjuta-preferences.h>
#include <libanjuta/anjuta-utils.h>
Modified: trunk/libanjuta/anjuta-utils.c
==============================================================================
--- trunk/libanjuta/anjuta-utils.c (original)
+++ trunk/libanjuta/anjuta-utils.c Mon Jan 19 14:18:45 2009
@@ -55,8 +55,6 @@
#include <libanjuta/anjuta-utils.h>
#include <libanjuta/anjuta-debug.h>
-#include <libgnomevfs/gnome-vfs.h>
-
#define FILE_BUFFER_SIZE 1024
static void
Modified: trunk/plugins/document-manager/Makefile.am
==============================================================================
--- trunk/plugins/document-manager/Makefile.am (original)
+++ trunk/plugins/document-manager/Makefile.am Mon Jan 19 14:18:45 2009
@@ -23,7 +23,7 @@
$(DEPRECATED_FLAGS) \
$(GDL_CFLAGS) \
$(GNOME_PRINT_UI_CFLAGS) \
- $(GNOME_VFS_CFLAGS) \
+ $(GIO_CFLAGS) \
$(LIBANJUTA_CFLAGS) \
-DG_LOG_DOMAIN=\"libanjuta-document-manager\"
@@ -32,7 +32,7 @@
libanjuta_document_manager_la_LIBADD = \
$(GDL_LIBS) \
$(GNOME_PRINT_UI_LIBS) \
- $(GNOME_VFS_LIBS) \
+ $(GIO_LIBS) \
$(LIBANJUTA_LIBS)
libanjuta_document_manager_la_SOURCES= \
Modified: trunk/plugins/gbf-am/Makefile.am
==============================================================================
--- trunk/plugins/gbf-am/Makefile.am (original)
+++ trunk/plugins/gbf-am/Makefile.am Mon Jan 19 14:18:45 2009
@@ -24,6 +24,7 @@
AM_CPPFLAGS = \
$(WARN_CFLAGS) \
$(DEPRECATED_FLAGS) \
+ $(GIO_CFLAGS) \
$(LIBANJUTA_CFLAGS) \
-DSCRIPTS_DIR=\"$(scriptsdir)\"
@@ -43,6 +44,7 @@
libgbf_am_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
libgbf_am_la_LIBADD = \
+ $(GIO_LIBS) \
$(LIBANJUTA_LIBS)
# Test program
Modified: trunk/plugins/gbf-am/gbf-am-project.c
==============================================================================
--- trunk/plugins/gbf-am/gbf-am-project.c (original)
+++ trunk/plugins/gbf-am/gbf-am-project.c Mon Jan 19 14:18:45 2009
@@ -37,10 +37,7 @@
#include <libgnome/gnome-macros.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
-#include <libgnomevfs/gnome-vfs-monitor.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-xfer.h>
+#include <libanjuta/anjuta-utils.h>
#include "gbf-am-project.h"
#include "gbf-am-config.h"
#include "gbf-am-properties.h"
@@ -51,9 +48,9 @@
/*#define ENABLE_DEBUG*/
#ifdef ENABLE_DEBUG
-#define DEBUG(x) x
+#define GBF_DEBUG(x) x
#else
-#define DEBUG(x)
+#define GBF_DEBUG(x)
#endif
@@ -193,8 +190,7 @@
static gboolean uri_is_parent (const gchar *parent_uri,
const gchar *child_uri);
static gboolean uri_is_local_path (const gchar *uri);
-static gchar *uri_to_path (const gchar *uri);
-static gchar *uri_normalize (const gchar *uri,
+static gchar *uri_normalize (const gchar *path_or_uri,
const gchar *base_uri);
static gboolean xml_write_add_source (GbfAmProject *project,
@@ -292,14 +288,13 @@
const gchar *uri2)
{
gboolean retval = FALSE;
- GnomeVFSURI *vfs_uri1, *vfs_uri2;
+ GFile *file1, *file2;
- vfs_uri1 = gnome_vfs_uri_new (uri1);
- vfs_uri2 = gnome_vfs_uri_new (uri2);
- if (vfs_uri1 != NULL && vfs_uri2 != NULL)
- retval = gnome_vfs_uri_equal (vfs_uri1, vfs_uri2);
- gnome_vfs_uri_unref (vfs_uri1);
- gnome_vfs_uri_unref (vfs_uri2);
+ file1 = g_file_new_for_commandline_arg (uri1);
+ file2 = g_file_new_for_commandline_arg (uri2);
+ retval = g_file_equal (file1, file2);
+ g_object_unref (file1);
+ g_object_unref (file2);
return retval;
}
@@ -309,18 +304,21 @@
const gchar *child_uri)
{
gboolean retval = FALSE;
- GnomeVFSURI *parent, *child;
+ GFile *parent, *child;
- parent = gnome_vfs_uri_new (parent_uri);
- child = gnome_vfs_uri_new (child_uri);
- if (parent != NULL && child != NULL)
- retval = gnome_vfs_uri_is_parent (parent, child, TRUE);
- gnome_vfs_uri_unref (parent);
- gnome_vfs_uri_unref (child);
+ parent = g_file_new_for_commandline_arg (parent_uri);
+ child = g_file_new_for_commandline_arg (child_uri);
+ retval = g_file_equal (parent, child);
+ g_object_unref (parent);
+ g_object_unref (child);
return retval;
}
+/*
+ * This is very similar to the function that decides in
+ * g_file_new_for_commandline_arg
+ */
static gboolean
uri_is_local_path (const gchar *uri)
{
@@ -337,56 +335,39 @@
return TRUE;
}
+/*
+ * This is basically g_file_get_uri (g_file_new_for_commandline_arg (uri)) with
+ * an option to give a basedir while g_file_new_for_commandline_arg always
+ * uses the current dir.
+ */
static gchar *
-uri_to_path (const gchar *uri)
-{
- return gnome_vfs_get_local_path_from_uri (uri);
-}
-
-static gchar *
-uri_normalize (const gchar *uri, const gchar *base_uri)
+uri_normalize (const gchar *path_or_uri, const gchar *base_uri)
{
gchar *normalized_uri = NULL;
- if (uri_is_local_path (uri)) {
- gchar *absolute_path;
-
- absolute_path = gnome_vfs_expand_initial_tilde (uri);
- if (!g_path_is_absolute (uri)) {
- gchar *tmp = absolute_path;
- gchar *base_dir;
- if (base_uri != NULL)
- base_dir = uri_to_path (base_uri);
- else
- base_dir = g_get_current_dir ();
+ if (base_uri != NULL && uri_is_local_path (path_or_uri))
+ {
+ GFile *base;
+ GFile *resolved;
- absolute_path = g_build_filename (base_dir, tmp, NULL);
- g_free (base_dir);
- g_free (tmp);
- }
- normalized_uri = gnome_vfs_make_uri_canonical (absolute_path);
- g_free (absolute_path);
- } else {
- GnomeVFSURI *vfs_uri;
+ base = g_file_new_for_uri (base_uri);
+ resolved = g_file_resolve_relative_path (base, path_or_uri);
- vfs_uri = gnome_vfs_uri_new (uri);
- /* FIXME: this should probably check that the method is file: */
- if (gnome_vfs_uri_is_local (vfs_uri))
- normalized_uri = gnome_vfs_make_uri_canonical (uri);
- gnome_vfs_uri_unref (vfs_uri);
- }
-
- /* strip trailing slash */
- if (normalized_uri) {
- gint length = strlen (normalized_uri);
- gchar *p;
- if (length > 0) {
- p = normalized_uri + length - 1;
- if (*p == '/')
- *p = '\0';
- }
+ normalized_uri = g_file_get_uri (resolved);
+ g_object_unref (base);
+ g_object_unref (resolved);
}
+ else
+ {
+ GFile *file;
+ file = g_file_new_for_commandline_arg (path_or_uri);
+ normalized_uri = g_file_get_uri (file);
+ g_object_unref (file);
+ }
+
+ GBF_DEBUG (g_debug (G_STRLOC" path_or_uri: %s, base_uri: %s, normalized: %s\n",
+ path_or_uri, base_uri, normalized_uri));
return normalized_uri;
}
@@ -403,29 +384,28 @@
static gchar *
uri_get_chrooted_path (const gchar *root_uri, const gchar *uri)
{
- gchar *root_path, *path;
- gint root_length;
- gchar *retval = NULL;
-
- path = uri_to_path (uri);
+ GFile *root, *file;
+ gchar *path = NULL;
+
if (root_uri == NULL)
- return path;
-
- root_path = uri_to_path (root_uri);
-
- root_length = strlen (root_path);
- if (strncmp (root_path, path, root_length) == 0) {
- /* check for trailing path separator in root... we need it to
- * make the returned path absolute */
- if (root_path [root_length - 1] == '/')
- root_length--;
- retval = g_strdup (path + root_length);
+ {
+ path = anjuta_util_get_local_path_from_uri (uri);
}
+ else
+ {
- g_free (root_path);
- g_free (path);
-
- return retval;
+ root = g_file_new_for_uri (root_uri);
+ file = g_file_new_for_uri (uri);
+
+ path = g_file_get_relative_path (root, file);
+
+ g_object_unref (root);
+ g_object_unref (file);
+ }
+
+ GBF_DEBUG (g_debug (G_STRLOC">>>>>>>>>>>>>>>>>> root_uri: %s, uri: %s, path: %s\n",
+ root_uri, uri, path));
+ return path;
}
/*
@@ -763,7 +743,7 @@
doc = xmlNewDoc (BAD_CAST "1.0");
if (doc != NULL) {
gchar *root_path;
- root_path = uri_to_path (project->project_root_uri);
+ root_path = anjuta_util_get_local_path_from_uri (project->project_root_uri);
doc->children = xmlNewDocNode (doc, NULL, BAD_CAST "project", NULL);
xmlSetProp (doc->children, BAD_CAST "root", BAD_CAST root_path);
g_free (root_path);
@@ -777,23 +757,22 @@
* File monitoring support --------------------------------
* FIXME: review these
*/
-
static void
-monitor_cb (GnomeVFSMonitorHandle *handle,
- const gchar *monitor_uri,
- const gchar *info_uri,
- GnomeVFSMonitorEventType event_type,
- gpointer data)
+monitor_cb (GFileMonitor *monitor,
+ GFile *file,
+ GFile *other_file,
+ GFileMonitorEvent event_type,
+ gpointer data)
{
GbfAmProject *project = data;
g_return_if_fail (project != NULL && GBF_IS_AM_PROJECT (project));
switch (event_type) {
- case GNOME_VFS_MONITOR_EVENT_CHANGED:
- case GNOME_VFS_MONITOR_EVENT_DELETED:
+ case G_FILE_MONITOR_EVENT_CHANGED:
+ case G_FILE_MONITOR_EVENT_DELETED:
/* monitor will be removed here... is this safe? */
- DEBUG (g_message ("File changed"));
+ GBF_DEBUG (g_message ("File changed"));
project_reload (project, NULL);
g_signal_emit_by_name (G_OBJECT (project), "project-updated");
break;
@@ -802,37 +781,41 @@
}
}
+
static void
monitor_add (GbfAmProject *project, const gchar *uri)
{
- GnomeVFSMonitorHandle *handle = NULL;
- GnomeVFSResult result;
-
+ GFileMonitor *monitor = NULL;
+
g_return_if_fail (project != NULL);
g_return_if_fail (project->monitors != NULL);
-
+
if (!uri)
return;
- handle = g_hash_table_lookup (project->monitors, uri);
- if (!handle) {
- GnomeVFSURI *vfs_uri;
+ monitor = g_hash_table_lookup (project->monitors, uri);
+ if (!monitor) {
gboolean exists;
+ GFile *file;
+
+ /* FIXME clarify if uri is uri, path or both */
+ file = g_file_new_for_commandline_arg (uri);
+ exists = g_file_query_exists (file, NULL);
- vfs_uri = gnome_vfs_uri_new (uri);
- exists = gnome_vfs_uri_exists (vfs_uri);
- gnome_vfs_uri_unref (vfs_uri);
-
if (exists) {
- result = gnome_vfs_monitor_add (&handle,
- uri,
- GNOME_VFS_MONITOR_FILE,
- monitor_cb,
- project);
- if (result == GNOME_VFS_OK) {
+ monitor = g_file_monitor_file (file,
+ G_FILE_MONITOR_NONE,
+ NULL,
+ NULL);
+ if (monitor != NULL)
+ {
+ g_signal_connect (G_OBJECT (monitor),
+ "changed",
+ G_CALLBACK (monitor_cb),
+ project);
g_hash_table_insert (project->monitors,
g_strdup (uri),
- handle);
+ monitor);
}
}
}
@@ -868,7 +851,7 @@
/* setup monitors hash */
project->monitors = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
- (GDestroyNotify) gnome_vfs_monitor_cancel);
+ (GDestroyNotify) g_file_monitor_cancel);
monitor_add (project, project->project_file);
g_hash_table_foreach (project->groups, group_hash_foreach_monitor, project);
@@ -973,7 +956,7 @@
#define PARSER_ASSERT(x) G_STMT_START { \
if (!(x)) { \
- DEBUG (g_warning ("Parser assertion at " G_STRLOC " failed: " #x)); \
+ GBF_DEBUG (g_warning ("Parser assertion at " G_STRLOC " failed: " #x)); \
data->state = PARSE_ERROR; return; \
} \
\
@@ -1763,7 +1746,7 @@
g_return_if_fail (data != NULL);
if (data->child_pid) {
- DEBUG (g_message ("Killing child"));
+ GBF_DEBUG (g_message ("Killing child"));
kill (data->child_pid, SIGKILL);
data->child_pid = 0;
}
@@ -1843,7 +1826,7 @@
switch (status) {
case G_IO_STATUS_NORMAL:
- DEBUG (g_message ("wrote %" G_GSIZE_FORMAT " bytes", bytes_written));
+ GBF_DEBUG (g_message ("wrote %" G_GSIZE_FORMAT " bytes", bytes_written));
if (data->input.length < data->input.size) {
/* don't remove the source */
@@ -1979,7 +1962,7 @@
spawn_kill_child (GbfAmSpawnData *data)
{
/* we can't wait longer */
- DEBUG (g_message ("Timeout: sending SIGTERM to child process"));
+ GBF_DEBUG (g_message ("Timeout: sending SIGTERM to child process"));
kill (data->child_pid, SIGTERM);
@@ -2040,7 +2023,7 @@
data->input.length = 0; /* for input buffer length acts as an index */
}
- DEBUG (g_message ("Spawning script"));
+ GBF_DEBUG (g_message ("Spawning script"));
if (!g_spawn_async_with_pipes (NULL, /* working dir */
argv,
@@ -2142,11 +2125,11 @@
gboolean retval;
gint i;
- project_path = uri_to_path (project->project_root_uri);
+ project_path = anjuta_util_get_local_path_from_uri (project->project_root_uri);
i = 0;
argv [i++] = GBF_AM_PARSE;
- DEBUG (argv [i++] = "-d");
+ GBF_DEBUG (argv [i++] = "-d");
argv [i++] = "--get";
argv [i++] = project_path;
argv [i++] = NULL;
@@ -2212,7 +2195,7 @@
i = 0;
argv [i++] = GBF_AM_PARSE;
- DEBUG (argv [i++] = "-d");
+ GBF_DEBUG (argv [i++] = "-d");
argv [i++] = "--set";
argv [i++] = "-";
argv [i++] = NULL;
@@ -2452,7 +2435,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/set-config.xml", doc);
});
@@ -2496,7 +2479,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/set-config.xml", doc);
});
@@ -2539,7 +2522,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/set-config.xml", doc);
});
@@ -2595,7 +2578,7 @@
}
/* some basic checks */
- root_path = uri_to_path (project->project_root_uri);
+ root_path = anjuta_util_get_local_path_from_uri (project->project_root_uri);
if (root_path == NULL || !g_file_test (root_path, G_FILE_TEST_IS_DIR)) {
error_set (error, GBF_PROJECT_ERROR_DOESNT_EXIST,
_("Project doesn't exist or invalid path"));
@@ -2640,7 +2623,7 @@
normalized_uri = uri_normalize (path, NULL);
if (normalized_uri != NULL) {
- root_path = uri_to_path (normalized_uri);
+ root_path = anjuta_util_get_local_path_from_uri (normalized_uri);
if (root_path != NULL && g_file_test (root_path, G_FILE_TEST_IS_DIR)) {
retval = (file_exists (root_path, "Makefile.am") &&
(file_exists (root_path, "configure.in") ||
@@ -2855,7 +2838,7 @@
return NULL;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/add-group.xml", doc);
});
@@ -2871,7 +2854,7 @@
/* get newly created group id */
retval = NULL;
- DEBUG (change_set_debug_print (change_set));
+ GBF_DEBUG (change_set_debug_print (change_set));
change = change_set_find (change_set, GBF_AM_CHANGE_ADDED, GBF_AM_NODE_GROUP);
if (change) {
retval = g_strdup (change->id);
@@ -2915,7 +2898,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/remove-group.xml", doc);
});
@@ -3119,7 +3102,7 @@
return NULL;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/add-target.xml", doc);
});
@@ -3135,7 +3118,7 @@
/* get newly created target id */
retval = NULL;
- DEBUG (change_set_debug_print (change_set));
+ GBF_DEBUG (change_set_debug_print (change_set));
change = change_set_find (change_set, GBF_AM_CHANGE_ADDED,
GBF_AM_NODE_TARGET);
if (change) {
@@ -3180,7 +3163,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/remove-target.xml", doc);
});
@@ -3401,44 +3384,47 @@
/* Check that the source uri is inside the project root */
if (!uri_is_parent (project->project_root_uri, full_uri)) {
- /* If not, copy it to target's group directory */
- GnomeVFSURI *group_vuri, *dest_vuri, *src_vuri;
- GnomeVFSResult res;
-
- src_vuri = gnome_vfs_uri_new (uri);
- group_vuri = gnome_vfs_uri_new (group_uri);
- dest_vuri = gnome_vfs_uri_append_file_name (group_vuri,
- filename);
-
- res = gnome_vfs_xfer_uri (src_vuri, dest_vuri,
- GNOME_VFS_XFER_DEFAULT,
- GNOME_VFS_XFER_ERROR_MODE_ABORT,
- GNOME_VFS_XFER_OVERWRITE_MODE_ABORT,
- NULL, NULL);
- if (res != GNOME_VFS_OK && res != GNOME_VFS_ERROR_FILE_EXISTS) {
- GbfProjectError gbf_err;
- gchar *error_str =
- g_strdup_printf ("Failed to copy source file inside project: %s",
- gnome_vfs_result_to_string (res));
- switch (res) {
- case GNOME_VFS_ERROR_NOT_FOUND:
- gbf_err = GBF_PROJECT_ERROR_DOESNT_EXIST;
- break;
- default:
- gbf_err = GBF_PROJECT_ERROR_GENERAL_FAILURE;
- break;
+ GFile *src_file, *group_file, *dst_file;
+ GError *err = NULL;
+
+ src_file = g_file_new_for_commandline_arg (uri);
+ group_file = g_file_new_for_commandline_arg (group_uri);
+ dst_file = g_file_get_child (group_file, filename);
+ g_object_unref (group_file);
+
+ if (!g_file_copy (src_file, dst_file,
+ G_FILE_COPY_NONE,
+ NULL, NULL,
+ NULL, &err))
+ {
+ if (err->code != G_IO_ERROR_EXISTS)
+ {
+ GbfProjectError gbf_err;
+ gchar *error_str =
+ g_strdup_printf ("Failed to copy source file inside project: %s",
+ err->message);
+ switch (err->code)
+ {
+ case G_IO_ERROR_NOT_FOUND:
+ gbf_err = GBF_PROJECT_ERROR_DOESNT_EXIST;
+ break;
+ default:
+ gbf_err = GBF_PROJECT_ERROR_GENERAL_FAILURE;
+ break;
+ }
+ error_set (error, gbf_err, error_str);
+ g_free (error_str);
+ g_error_free (err);
+ abort_action = TRUE;
}
- error_set (error, gbf_err, error_str);
- g_free (error_str);
- abort_action = TRUE;
- } else {
- g_free (full_uri);
- full_uri = gnome_vfs_uri_to_string (dest_vuri,
- GNOME_VFS_URI_HIDE_NONE);
- }
- gnome_vfs_uri_unref (src_vuri);
- gnome_vfs_uri_unref (group_vuri);
- gnome_vfs_uri_unref (dest_vuri);
+ else
+ {
+ g_free (full_uri);
+ full_uri = g_file_get_uri (dst_file);
+ }
+ }
+ g_object_unref (src_file);
+ g_object_unref (dst_file);
}
g_free (group_uri);
@@ -3479,7 +3465,7 @@
return NULL;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/add-source.xml", doc);
});
@@ -3495,7 +3481,7 @@
/* get newly created source id */
retval = NULL;
- DEBUG (change_set_debug_print (change_set));
+ GBF_DEBUG (change_set_debug_print (change_set));
change = change_set_find (change_set, GBF_AM_CHANGE_ADDED,
GBF_AM_NODE_SOURCE);
if (change) {
@@ -3538,7 +3524,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/remove-source.xml", doc);
});
Modified: trunk/plugins/gbf-mkfile/Makefile.am
==============================================================================
--- trunk/plugins/gbf-mkfile/Makefile.am (original)
+++ trunk/plugins/gbf-mkfile/Makefile.am Mon Jan 19 14:18:45 2009
@@ -24,6 +24,7 @@
AM_CPPFLAGS = \
$(WARN_CFLAGS) \
$(DEPRECATED_FLAGS) \
+ $(GIO_CFLAGS) \
$(LIBANJUTA_CFLAGS) \
-DSCRIPTS_DIR=\"$(scriptsdir)\"
@@ -43,6 +44,7 @@
libgbf_mkfile_la_LDFLAGS = $(ANJUTA_PLUGIN_LDFLAGS)
libgbf_mkfile_la_LIBADD = \
+ $(GIO_LIBS) \
$(LIBANJUTA_LIBS)
EXTRA_DIST = \
Modified: trunk/plugins/gbf-mkfile/gbf-mkfile-project.c
==============================================================================
--- trunk/plugins/gbf-mkfile/gbf-mkfile-project.c (original)
+++ trunk/plugins/gbf-mkfile/gbf-mkfile-project.c Mon Jan 19 14:18:45 2009
@@ -37,13 +37,12 @@
#include <sys/types.h>
#include <signal.h>
#include <glib/gi18n.h>
+#include <gio/gio.h>
#include <libgnome/gnome-macros.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
-#include <libgnomevfs/gnome-vfs-monitor.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
#include <libanjuta/gbf-project.h>
+#include <libanjuta/anjuta-utils.h>
#include "gbf-mkfile-project.h"
#include "gbf-mkfile-config.h"
#include "gbf-mkfile-properties.h"
@@ -51,9 +50,9 @@
#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
-#define DEBUG(x) x
+#define GBF_DEBUG(x) x
#else
-#define DEBUG(x)
+#define GBF_DEBUG(x)
#endif
@@ -191,8 +190,7 @@
static gboolean uri_is_parent (const gchar *parent_uri,
const gchar *child_uri);
static gboolean uri_is_local_path (const gchar *uri);
-static gchar *uri_to_path (const gchar *uri);
-static gchar *uri_normalize (const gchar *uri,
+static gchar *uri_normalize (const gchar *path_or_uri,
const gchar *base_uri);
static gboolean xml_write_add_source (GbfMkfileProject *project,
@@ -282,14 +280,13 @@
const gchar *uri2)
{
gboolean retval = FALSE;
- GnomeVFSURI *vfs_uri1, *vfs_uri2;
+ GFile *file1, *file2;
- vfs_uri1 = gnome_vfs_uri_new (uri1);
- vfs_uri2 = gnome_vfs_uri_new (uri2);
- if (vfs_uri1 != NULL && vfs_uri2 != NULL)
- retval = gnome_vfs_uri_equal (vfs_uri1, vfs_uri2);
- gnome_vfs_uri_unref (vfs_uri1);
- gnome_vfs_uri_unref (vfs_uri2);
+ file1 = g_file_new_for_commandline_arg (uri1);
+ file2 = g_file_new_for_commandline_arg (uri2);
+ retval = g_file_equal (file1, file2);
+ g_object_unref (file1);
+ g_object_unref (file2);
return retval;
}
@@ -299,18 +296,21 @@
const gchar *child_uri)
{
gboolean retval = FALSE;
- GnomeVFSURI *parent, *child;
+ GFile *parent, *child;
- parent = gnome_vfs_uri_new (parent_uri);
- child = gnome_vfs_uri_new (child_uri);
- if (parent != NULL && child != NULL)
- retval = gnome_vfs_uri_is_parent (parent, child, TRUE);
- gnome_vfs_uri_unref (parent);
- gnome_vfs_uri_unref (child);
+ parent = g_file_new_for_commandline_arg (parent_uri);
+ child = g_file_new_for_commandline_arg (child_uri);
+ retval = g_file_equal (parent, child);
+ g_object_unref (parent);
+ g_object_unref (child);
return retval;
}
+/*
+ * This is very similar to the function that decides in
+ * g_file_new_for_commandline_arg
+ */
static gboolean
uri_is_local_path (const gchar *uri)
{
@@ -327,56 +327,39 @@
return TRUE;
}
+/*
+ * This is basically g_file_get_uri (g_file_new_for_commandline_arg (uri)) with
+ * an option to give a basedir while g_file_new_for_commandline_arg always
+ * uses the current dir.
+ */
static gchar *
-uri_to_path (const gchar *uri)
-{
- return gnome_vfs_get_local_path_from_uri (uri);
-}
-
-static gchar *
-uri_normalize (const gchar *uri, const gchar *base_uri)
+uri_normalize (const gchar *path_or_uri, const gchar *base_uri)
{
gchar *normalized_uri = NULL;
- if (uri_is_local_path (uri)) {
- gchar *absolute_path;
-
- absolute_path = gnome_vfs_expand_initial_tilde (uri);
- if (!g_path_is_absolute (uri)) {
- gchar *tmp = absolute_path;
- gchar *base_dir;
- if (base_uri != NULL)
- base_dir = uri_to_path (base_uri);
- else
- base_dir = g_get_current_dir ();
-
- absolute_path = g_build_filename (base_dir, tmp, NULL);
- g_free (base_dir);
- g_free (tmp);
- }
- normalized_uri = gnome_vfs_make_uri_canonical (absolute_path);
- g_free (absolute_path);
- } else {
- GnomeVFSURI *vfs_uri;
+ if (base_uri != NULL && uri_is_local_path (path_or_uri))
+ {
+ GFile *base;
+ GFile *resolved;
+
+ base = g_file_new_for_uri (base_uri);
+ resolved = g_file_resolve_relative_path (base, path_or_uri);
+
+ normalized_uri = g_file_get_uri (resolved);
+ g_object_unref (base);
+ g_object_unref (resolved);
+ }
+ else
+ {
+ GFile *file;
- vfs_uri = gnome_vfs_uri_new (uri);
- /* FIXME: this should probably check that the method is file: */
- if (gnome_vfs_uri_is_local (vfs_uri))
- normalized_uri = gnome_vfs_make_uri_canonical (uri);
- gnome_vfs_uri_unref (vfs_uri);
- }
-
- /* strip trailing slash */
- if (normalized_uri) {
- gint length = strlen (normalized_uri);
- gchar *p;
- if (length > 0) {
- p = normalized_uri + length - 1;
- if (*p == '/')
- *p = '\0';
- }
+ file = g_file_new_for_commandline_arg (path_or_uri);
+ normalized_uri = g_file_get_uri (file);
+ g_object_unref (file);
}
+ GBF_DEBUG (g_debug (G_STRLOC" path_or_uri: %s, base_uri: %s, normalized: %s\n",
+ path_or_uri, base_uri, normalized_uri));
return normalized_uri;
}
@@ -393,29 +376,28 @@
static gchar *
uri_get_chrooted_path (const gchar *root_uri, const gchar *uri)
{
- gchar *root_path, *path;
- gint root_length;
- gchar *retval = NULL;
-
- path = uri_to_path (uri);
+ GFile *root, *file;
+ gchar *path = NULL;
+
if (root_uri == NULL)
- return path;
-
- root_path = uri_to_path (root_uri);
-
- root_length = strlen (root_path);
- if (strncmp (root_path, path, root_length) == 0) {
- /* check for trailing path separator in root... we need it to
- * make the returned path absolute */
- if (root_path [root_length - 1] == '/')
- root_length--;
- retval = g_strdup (path + root_length);
+ {
+ path = anjuta_util_get_local_path_from_uri (uri);
}
+ else
+ {
- g_free (root_path);
- g_free (path);
-
- return retval;
+ root = g_file_new_for_uri (root_uri);
+ file = g_file_new_for_uri (uri);
+
+ path = g_file_get_relative_path (root, file);
+
+ g_object_unref (root);
+ g_object_unref (file);
+ }
+
+ GBF_DEBUG (g_debug (G_STRLOC">>>>>>>>>>>>>>>>>> root_uri: %s, uri: %s, path: %s\n",
+ root_uri, uri, path));
+ return path;
}
/*
@@ -752,7 +734,7 @@
doc = xmlNewDoc (BAD_CAST("1.0"));
if (doc != NULL) {
gchar *root_path;
- root_path = uri_to_path (project->project_root_uri);
+ root_path = anjuta_util_get_local_path_from_uri (project->project_root_uri);
doc->children = xmlNewDocNode (doc, NULL, BAD_CAST("project"), NULL);
xmlSetProp (doc->children, BAD_CAST("root"), BAD_CAST(root_path));
g_free (root_path);
@@ -768,21 +750,21 @@
*/
static void
-monitor_cb (GnomeVFSMonitorHandle *handle,
- const gchar *monitor_uri,
- const gchar *info_uri,
- GnomeVFSMonitorEventType event_type,
- gpointer data)
+monitor_cb (GFileMonitor *monitor,
+ GFile *file,
+ GFile *other_file,
+ GFileMonitorEvent event_type,
+ gpointer data)
{
- GbfMkfileProject *project = data;
+ GbfMkfileProject *project = GBF_MKFILE_PROJECT (data);
g_return_if_fail (project != NULL && GBF_IS_MKFILE_PROJECT (project));
switch (event_type) {
- case GNOME_VFS_MONITOR_EVENT_CHANGED:
- case GNOME_VFS_MONITOR_EVENT_DELETED:
+ case G_FILE_MONITOR_EVENT_CHANGED:
+ case G_FILE_MONITOR_EVENT_DELETED:
/* monitor will be removed here... is this safe? */
- DEBUG (g_message ("File changed"));
+ GBF_DEBUG (g_message ("File changed"));
project_reload (project, NULL);
g_signal_emit_by_name (G_OBJECT (project), "project-updated");
break;
@@ -794,8 +776,7 @@
static void
monitor_add (GbfMkfileProject *project, const gchar *uri)
{
- GnomeVFSMonitorHandle *handle = NULL;
- GnomeVFSResult result;
+ GFileMonitor *monitor = NULL;
g_return_if_fail (project != NULL);
g_return_if_fail (project->monitors != NULL);
@@ -803,25 +784,29 @@
if (!uri)
return;
- handle = g_hash_table_lookup (project->monitors, uri);
- if (!handle) {
- GnomeVFSURI *vfs_uri;
+ monitor = g_hash_table_lookup (project->monitors, uri);
+ if (!monitor) {
gboolean exists;
-
- vfs_uri = gnome_vfs_uri_new (uri);
- exists = gnome_vfs_uri_exists (vfs_uri);
- gnome_vfs_uri_unref (vfs_uri);
+ GFile *file;
+ /* FIXME clarify if uri is uri, path or both */
+ file = g_file_new_for_commandline_arg (uri);
+ exists = g_file_query_exists (file, NULL);
+
if (exists) {
- result = gnome_vfs_monitor_add (&handle,
- uri,
- GNOME_VFS_MONITOR_FILE,
- monitor_cb,
- project);
- if (result == GNOME_VFS_OK) {
+ monitor = g_file_monitor_file (file,
+ G_FILE_MONITOR_NONE,
+ NULL,
+ NULL);
+ if (monitor != NULL)
+ {
+ g_signal_connect (G_OBJECT (monitor),
+ "changed",
+ G_CALLBACK (monitor_cb),
+ project);
g_hash_table_insert (project->monitors,
- g_strdup (uri),
- handle);
+ g_strdup (uri),
+ monitor);
}
}
}
@@ -857,7 +842,7 @@
/* setup monitors hash */
project->monitors = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
- (GDestroyNotify) gnome_vfs_monitor_cancel);
+ (GDestroyNotify) g_file_monitor_cancel);
monitor_add (project, project->project_file);
g_hash_table_foreach (project->groups, group_hash_foreach_monitor, project);
@@ -962,7 +947,7 @@
#define PARSER_ASSERT(x) G_STMT_START { \
if (!(x)) { \
- DEBUG (g_warning ("Parser assertion at " G_STRLOC " failed: " #x)); \
+ GBF_DEBUG (g_warning ("Parser assertion at " G_STRLOC " failed: " #x)); \
data->state = PARSE_ERROR; return; \
} \
\
@@ -1209,7 +1194,7 @@
}
PARSER_ASSERT (uri != NULL);
- source_uri = g_build_filename (project->project_root_uri, uri, NULL);
+ source_uri = uri_normalize ((gchar *)uri, project->project_root_uri);
source_id = g_strdup_printf ("%s:%s",
GBF_MKFILE_NODE (data->current_node)->id,
source_uri);
@@ -1724,7 +1709,7 @@
g_return_if_fail (data != NULL);
if (data->child_pid) {
- DEBUG (g_message ("Killing child"));
+ GBF_DEBUG (g_message ("Killing child"));
kill (data->child_pid, SIGKILL);
data->child_pid = 0;
}
@@ -1938,7 +1923,7 @@
spawn_kill_child (GbfMkfileSpawnData *data)
{
/* we can't wait longer */
- DEBUG (g_message ("Timeout: sending SIGTERM to child process"));
+ GBF_DEBUG (g_message ("Timeout: sending SIGTERM to child process"));
kill (data->child_pid, SIGTERM);
@@ -1999,7 +1984,7 @@
data->input.length = 0; /* for input buffer length acts as an index */
}
- DEBUG (g_message ("Spawning script"));
+ GBF_DEBUG (g_message ("Spawning script"));
if (!g_spawn_async_with_pipes (NULL, /* working dir */
argv,
@@ -2101,11 +2086,11 @@
gboolean retval;
gint i;
- project_path = uri_to_path (project->project_root_uri);
+ project_path = anjuta_util_get_local_path_from_uri (project->project_root_uri);
i = 0;
argv [i++] = GBF_MKFILE_PARSE;
- DEBUG (argv [i++] = "-d");
+ GBF_DEBUG (argv [i++] = "-d");
argv [i++] = "--get";
argv [i++] = project_path;
argv [i++] = NULL;
@@ -2160,7 +2145,7 @@
i = 0;
argv [i++] = GBF_MKFILE_PARSE;
- DEBUG (argv [i++] = "-d");
+ GBF_DEBUG (argv [i++] = "-d");
argv [i++] = "--set";
argv [i++] = "-";
argv [i++] = NULL;
@@ -2388,7 +2373,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/set-config.xml", doc);
});
@@ -2432,7 +2417,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/set-config.xml", doc);
});
@@ -2475,7 +2460,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/set-config.xml", doc);
});
@@ -2501,7 +2486,8 @@
GError **error)
{
GbfMkfileProject *project;
- gchar *root_path;
+ GFile *file;
+ GFileInfo *file_info;
g_return_if_fail (GBF_IS_MKFILE_PROJECT (_project));
@@ -2522,25 +2508,42 @@
if (uri == NULL)
return;
+ file = g_file_new_for_commandline_arg (uri);
/* check that the uri is in the filesystem */
- project->project_root_uri = uri_normalize (uri, NULL);
+ project->project_root_uri = g_file_get_uri (file);
if (project->project_root_uri == NULL) {
error_set (error, GBF_PROJECT_ERROR_DOESNT_EXIST,
_("Invalid or remote path (only local paths supported)"));
return;
}
-
- /* some basic checks */
- root_path = uri_to_path (project->project_root_uri);
- if (root_path == NULL || !g_file_test (root_path, G_FILE_TEST_IS_DIR)) {
+
+ if (!g_file_query_exists (file, NULL))
+ {
+ error_set (error, GBF_PROJECT_ERROR_DOESNT_EXIST,
+ _("Project doesn't exist"));
+ g_object_unref (file);
+ g_free (project->project_root_uri);
+ project->project_root_uri = NULL;
+ return;
+ }
+
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NONE,
+ NULL, NULL);
+ if (file_info == NULL || g_file_info_get_file_type (file_info) != G_FILE_TYPE_DIRECTORY)
+ {
error_set (error, GBF_PROJECT_ERROR_DOESNT_EXIST,
_("Project doesn't exist or invalid path"));
- g_free (root_path);
+ if (file_info != NULL)
+ {
+ g_object_unref (file_info);
+ }
+ g_object_unref (file);
g_free (project->project_root_uri);
project->project_root_uri = NULL;
return;
}
- g_free (root_path);
/* now try loading the project */
if (!project_reload (project, error)) {
@@ -2549,6 +2552,8 @@
g_free (project->project_root_uri);
project->project_root_uri = NULL;
}
+ g_object_unref (file_info);
+ g_object_unref (file);
}
static gboolean
@@ -2569,22 +2574,24 @@
const gchar *path,
GError **error)
{
- gchar *normalized_uri, *root_path;
+ gchar *root_path;
gboolean retval = FALSE;
+ GFile *file;
g_return_val_if_fail (GBF_IS_MKFILE_PROJECT (_project), FALSE);
- normalized_uri = uri_normalize (path, NULL);
- if (normalized_uri != NULL) {
- root_path = uri_to_path (normalized_uri);
- if (root_path != NULL && g_file_test (root_path, G_FILE_TEST_IS_DIR)) {
- retval = ((file_exists (root_path, "Makefile") ||
- file_exists (root_path, "makefile")) &&
- !(file_exists (root_path, "Makefile.am") ||
- file_exists (root_path, "Makefile.in")));
- g_free (root_path);
- }
- g_free (normalized_uri);
+ /* use _for_commandline_arg to resolve eventually relative path against
+ * current directory
+ */
+ file = g_file_new_for_commandline_arg (path);
+ root_path = g_file_get_path (file);
+ g_object_unref (file);
+ if (root_path != NULL && g_file_test (root_path, G_FILE_TEST_IS_DIR)) {
+ retval = ((file_exists (root_path, "Makefile") ||
+ file_exists (root_path, "makefile")) &&
+ !(file_exists (root_path, "Makefile.am") ||
+ file_exists (root_path, "Makefile.in")));
+ g_free (root_path);
}
return retval;
@@ -2765,7 +2772,7 @@
return NULL;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/add-group.xml", doc);
});
@@ -2781,7 +2788,7 @@
/* get newly created group id */
retval = NULL;
- DEBUG (change_set_debug_print (change_set));
+ GBF_DEBUG (change_set_debug_print (change_set));
change = change_set_find (change_set, GBF_MKFILE_CHANGE_ADDED, GBF_MKFILE_NODE_GROUP);
if (change) {
retval = g_strdup (change->id);
@@ -2825,7 +2832,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/remove-group.xml", doc);
});
@@ -2988,7 +2995,7 @@
return NULL;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/add-target.xml", doc);
});
@@ -3004,7 +3011,7 @@
/* get newly created target id */
retval = NULL;
- DEBUG (change_set_debug_print (change_set));
+ GBF_DEBUG (change_set_debug_print (change_set));
change = change_set_find (change_set, GBF_MKFILE_CHANGE_ADDED, GBF_MKFILE_NODE_TARGET);
if (change) {
retval = g_strdup (change->id);
@@ -3048,7 +3055,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/remove-target.xml", doc);
});
@@ -3275,7 +3282,7 @@
return NULL;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/add-source.xml", doc);
});
@@ -3291,7 +3298,7 @@
/* get newly created source id */
retval = NULL;
- DEBUG (change_set_debug_print (change_set));
+ GBF_DEBUG (change_set_debug_print (change_set));
change = change_set_find (change_set, GBF_MKFILE_CHANGE_ADDED, GBF_MKFILE_NODE_SOURCE);
if (change) {
retval = g_strdup (change->id);
@@ -3334,7 +3341,7 @@
return;
}
- DEBUG ({
+ GBF_DEBUG ({
xmlSetDocCompressMode (doc, 0);
xmlSaveFile ("/tmp/remove-source.xml", doc);
});
Modified: trunk/plugins/glade/anjuta-design-document.c
==============================================================================
--- trunk/plugins/glade/anjuta-design-document.c (original)
+++ trunk/plugins/glade/anjuta-design-document.c Mon Jan 19 14:18:45 2009
@@ -29,8 +29,6 @@
#include <libanjuta/interfaces/ianjuta-file-savable.h>
#include <libanjuta/interfaces/ianjuta-document.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
enum
{
PROP_0,
Modified: trunk/plugins/glade/plugin.c
==============================================================================
--- trunk/plugins/glade/plugin.c (original)
+++ trunk/plugins/glade/plugin.c Mon Jan 19 14:18:45 2009
@@ -20,7 +20,6 @@
#include <config.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
#include <libanjuta/anjuta-shell.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-file.h>
@@ -325,12 +324,14 @@
if (project->path)
#endif
{
- uri = gnome_vfs_get_uri_from_local_path (
+ GFile *file = g_file_new_for_path (
#if (GLADEUI_VERSION >= 330)
ppath);
#else
project->path);
#endif
+ uri = g_file_get_uri (file);
+ g_object_unref (file);
if (uri)
{
/ * FIXME only log file if it's still open in docman * /
Modified: trunk/plugins/gtodo/Makefile.am
==============================================================================
--- trunk/plugins/gtodo/Makefile.am (original)
+++ trunk/plugins/gtodo/Makefile.am Mon Jan 19 14:18:45 2009
@@ -28,7 +28,7 @@
$(WARN_CFLAGS) \
$(DEPRECATED_FLAGS) \
$(GTK_CFLAGS) \
- $(GNOME_VFS_CFLAGS) \
+ $(GIO_CFLAGS) \
$(LIBXSLT_CFLAGS) \
$(LIBANJUTA_CFLAGS) \
-DDATADIR="\"$(anjuta_data_dir)\"" \
@@ -38,7 +38,7 @@
libanjuta_gtodo_la_LIBADD = \
$(GTK_LIBS) \
- $(GNOME_VFS_LIBS) \
+ $(GIO_LIBS) \
$(LIBXSLT_LIBS) \
$(LIBANJUTA_LIBS)
Modified: trunk/plugins/indent/indent-util.c
==============================================================================
--- trunk/plugins/indent/indent-util.c (original)
+++ trunk/plugins/indent/indent-util.c Mon Jan 19 14:18:45 2009
@@ -21,7 +21,6 @@
#include <sys/wait.h>
-#include <libgnomevfs/gnome-vfs.h>
#include <gconf/gconf-client.h>
#include <libanjuta/anjuta-utils.h>
@@ -492,37 +491,21 @@
gchar *
indent_get_buffer(void)
{
- GnomeVFSResult result;
- GnomeVFSHandle *handle;
- GnomeVFSFileInfo info;
+ GFile *file;
gchar *read_buf = NULL;
- gchar *text_uri;
+ GError *error = NULL;
+ gsize *size;
- text_uri = gnome_vfs_get_uri_from_local_path(INDENT_FILE_OUTPUT);
- result = gnome_vfs_get_file_info(text_uri, &info,
- GNOME_VFS_FILE_INFO_DEFAULT |
- GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS);
- if(result != GNOME_VFS_OK )
+ file = g_file_new_for_path (INDENT_FILE_OUTPUT);
+ if (!g_file_load_contents (file, NULL,
+ &read_buf, &size,
+ NULL, &error))
{
- DEBUG_PRINT("Cannot get info: %s\n", text_uri);
- return NULL;
+ read_buf = NULL;
+ DEBUG_PRINT ("Error reading file: %s", error->message);
}
- if((result = gnome_vfs_open (&handle, text_uri,
- GNOME_VFS_OPEN_READ)) != GNOME_VFS_OK)
- {
- DEBUG_PRINT("Cannot open: %s\n", text_uri);
- return NULL;
- }
- read_buf = g_new0(char, info.size + 1);
-
- result = gnome_vfs_read (handle, read_buf, info.size, NULL);
- if(!(result == GNOME_VFS_OK || result == GNOME_VFS_ERROR_EOF))
- {
- g_free (read_buf);
- DEBUG_PRINT("No file: %s\n", text_uri);
- return NULL;
- }
- gnome_vfs_close (handle);
+ g_object_unref (file);
+
return read_buf;
}
Modified: trunk/plugins/patch/plugin.c
==============================================================================
--- trunk/plugins/patch/plugin.c (original)
+++ trunk/plugins/patch/plugin.c Mon Jan 19 14:18:45 2009
@@ -16,7 +16,6 @@
*/
#include <config.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
#include <libanjuta/anjuta-shell.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/anjuta-plugin.h>
Modified: trunk/plugins/project-manager/gbf-project-model.c
==============================================================================
--- trunk/plugins/project-manager/gbf-project-model.c (original)
+++ trunk/plugins/project-manager/gbf-project-model.c Mon Jan 19 14:18:45 2009
@@ -29,7 +29,6 @@
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
#include "gbf-project-model.h"
Modified: trunk/plugins/project-manager/gbf-project-util.c
==============================================================================
--- trunk/plugins/project-manager/gbf-project-util.c (original)
+++ trunk/plugins/project-manager/gbf-project-util.c Mon Jan 19 14:18:45 2009
@@ -29,9 +29,7 @@
#include <glade/glade-xml.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <bonobo/bonobo-file-selector-util.h>
+#include <gio/gio.h>
#include "gbf-tree-data.h"
#include "gbf-project-view.h"
@@ -541,7 +539,7 @@
{
GtkTreeView *tree = user_data;
gchar *file, *uri;
- GnomeVFSURI *tmp_uri;
+ GFile *gio_file, *tmp;
GtkFileChooserDialog* dialog;
GtkTreeModel* model;
GtkTreeIter iter;
@@ -564,13 +562,16 @@
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL));
- tmp_uri = gnome_vfs_uri_new (uri);
+ /* FIXME: this is somewhat UGLY */
+ gio_file = g_file_new_for_uri (uri);
+ tmp = g_file_get_parent (gio_file);
g_free (uri);
- uri = NULL;
- if (tmp_uri) {
- uri = gnome_vfs_uri_extract_dirname (tmp_uri);
- gnome_vfs_uri_unref (tmp_uri);
- }
+ uri = NULL;
+ if (g_file_query_exists (tmp, NULL))
+ {
+ uri = g_file_get_uri (tmp);
+ }
+
gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(dialog),
uri ? uri : g_object_get_data (G_OBJECT (widget), "root"));
Modified: trunk/plugins/project-manager/gbf-tree-data.c
==============================================================================
--- trunk/plugins/project-manager/gbf-tree-data.c (original)
+++ trunk/plugins/project-manager/gbf-tree-data.c Mon Jan 19 14:18:45 2009
@@ -25,7 +25,6 @@
#include <config.h>
#endif
-#include <libgnomevfs/gnome-vfs-uri.h>
#include "gbf-tree-data.h"
GType
@@ -81,16 +80,34 @@
gbf_tree_data_new_source (GbfProject *project, const GbfProjectTargetSource *source)
{
GbfTreeData *node = g_new0 (GbfTreeData, 1);
- GnomeVFSURI *uri;
+ GFile *file;
+ GFileInfo *file_info;
node->type = GBF_TREE_NODE_TARGET_SOURCE;
node->id = g_strdup (source->id);
node->uri = g_strdup (source->source_uri);
+ node->name = NULL;
- uri = gnome_vfs_uri_new (source->source_uri);
- node->name = gnome_vfs_uri_extract_short_name (uri);
- gnome_vfs_uri_unref (uri);
-
+ file = g_file_new_for_uri (source->source_uri);
+ node->name = g_file_get_basename (file);
+ if (g_file_query_exists (file, NULL))
+ {
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+ G_FILE_QUERY_INFO_NONE,
+ NULL, NULL);
+ if (file_info)
+ {
+ node->name = g_strdup (g_file_info_get_display_name (file_info));
+ }
+ }
+ g_object_unref (file);
+
+ if (node->name == NULL)
+ {
+ node->name = g_file_get_basename (file);
+ }
+
return node;
}
Modified: trunk/plugins/project-manager/plugin.c
==============================================================================
--- trunk/plugins/project-manager/plugin.c (original)
+++ trunk/plugins/project-manager/plugin.c Mon Jan 19 14:18:45 2009
@@ -19,8 +19,6 @@
*/
#include <config.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
#include <libanjuta/interfaces/ianjuta-file.h>
#include <libanjuta/interfaces/ianjuta-file-savable.h>
#include <libanjuta/interfaces/ianjuta-file-loader.h>
@@ -86,18 +84,31 @@
status = anjuta_shell_get_status (ANJUTA_PLUGIN (plugin)->shell, NULL);
if (project_uri)
{
- gchar* uri_basename;
- gchar* unescape_basename;
- gchar* ext;
-
- uri_basename = g_path_get_basename (project_uri);
- unescape_basename = gnome_vfs_unescape_string (uri_basename, "");
- ext = strrchr (unescape_basename, '.');
- if (ext)
- *ext = '\0';
- anjuta_status_set_title (status, unescape_basename);
- g_free (unescape_basename);
- g_free (uri_basename);
+ GFile *file;
+ GFileInfo *file_info;
+
+ file = g_file_new_for_uri (project_uri);
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
+ G_FILE_QUERY_INFO_NONE,
+ NULL,
+ NULL);
+ if (file_info)
+ {
+ gchar *dispname;
+ gchar *ext;
+
+ dispname = g_strdup (
+ g_file_info_get_display_name (file_info));
+ ext = strrchr (dispname, '.');
+ if (ext)
+ *ext = '\0';
+ anjuta_status_set_title (status, dispname);
+ g_free (dispname);
+ g_object_unref (file_info);
+ }
+
+ g_object_unref (file);
}
else
{
@@ -726,22 +737,27 @@
on_popup_add_to_project (GtkAction *action, ProjectManagerPlugin *plugin)
{
GtkWindow *win;
- GnomeVFSFileInfo info;
- GnomeVFSResult res;
+ GFile *file;
+ GFileInfo *file_info;
gchar *parent_directory, *filename;
+ GError *error = NULL;
win = get_plugin_parent_window (plugin);
- res = gnome_vfs_get_file_info (plugin->fm_current_uri, &info,
- GNOME_VFS_FILE_INFO_DEFAULT |
- GNOME_VFS_FILE_INFO_FOLLOW_LINKS);
- if (res == GNOME_VFS_OK)
+
+ file = g_file_new_for_uri (plugin->fm_current_uri);
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NONE,
+ NULL,
+ &error);
+ if (file_info != NULL)
{
parent_directory = g_path_get_dirname (plugin->fm_current_uri);
if (!parent_directory)
parent_directory = g_strdup ("");
filename = g_path_get_basename (plugin->fm_current_uri);
- if (info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
+ if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
{
gchar *group_id =
ianjuta_project_manager_add_group (IANJUTA_PROJECT_MANAGER (plugin),
@@ -759,20 +775,15 @@
NULL);
g_free(source_id);
}
+ g_object_unref (file_info);
g_free (filename);
g_free (parent_directory);
}
else
{
- const gchar *mesg;
-
- if (res != GNOME_VFS_OK)
- mesg = gnome_vfs_result_to_string (res);
- else
- mesg = _("The file you selected is a link and can't be added to the project");
- anjuta_util_dialog_error (win,
- _("Failed to retrieve URI info of %s: %s"),
- plugin->fm_current_uri, mesg);
+ anjuta_util_dialog_error (win, _("Failed to retrieve URI info of %s: %s"),
+ plugin->fm_current_uri, error->message);
+ g_error_free (error);
}
}
@@ -1179,7 +1190,7 @@
root_uri = pm_plugin->project_root_uri;
- dirname = gnome_vfs_get_local_path_from_uri (root_uri);
+ dirname = anjuta_util_get_local_path_from_uri (root_uri);
g_return_if_fail (dirname != NULL);
@@ -1673,12 +1684,26 @@
/* IAnjutaProjectManager implementation */
-static GnomeVFSFileType
+static GFileType
get_uri_vfs_type (const gchar *uri)
{
- GnomeVFSFileInfo info;
- gnome_vfs_get_file_info (uri, &info, 0);
- return info.type;
+ GFileType retval = G_FILE_TYPE_UNKNOWN;
+ GFile *file;
+ GFileInfo *file_info;
+
+ file = g_file_new_for_uri (uri);
+ file_info = g_file_query_info (file,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ NULL, NULL);
+ if (file_info)
+ {
+ retval = g_file_info_get_file_type (file_info);
+ g_object_unref (file_info);
+ }
+
+ g_object_unref (file);
+ return retval;
}
static gboolean
@@ -1832,7 +1857,7 @@
id = g_strdup (target->id);
gbf_project_target_free (target);
}
- else if (get_uri_vfs_type (uri) | GNOME_VFS_FILE_TYPE_DIRECTORY)
+ else if (get_uri_vfs_type (uri) | G_FILE_TYPE_DIRECTORY)
{
id = g_strconcat (get_element_relative_path (plugin, uri, IANJUTA_PROJECT_MANAGER_PROJECT_ROOT_URI), "/", NULL);
}
@@ -1848,7 +1873,7 @@
const gchar *element_uri,
GError **err)
{
- GnomeVFSFileType ftype;
+ GFileType ftype;
ProjectManagerPlugin *plugin;
g_return_val_if_fail (ANJUTA_IS_PLUGIN (project_manager),
@@ -1861,7 +1886,7 @@
IANJUTA_PROJECT_MANAGER_UNKNOWN);
ftype = get_uri_vfs_type (element_uri);
- if (ftype | GNOME_VFS_FILE_TYPE_DIRECTORY)
+ if (ftype | G_FILE_TYPE_DIRECTORY)
{
return IANJUTA_PROJECT_MANAGER_GROUP;
}
@@ -1871,7 +1896,7 @@
{
return IANJUTA_PROJECT_MANAGER_TARGET;
}
- else if (ftype | GNOME_VFS_FILE_TYPE_REGULAR)
+ else if (ftype | G_FILE_TYPE_REGULAR)
{
return IANJUTA_PROJECT_MANAGER_SOURCE;
}
@@ -2413,19 +2438,20 @@
AnjutaProfileManager *profile_manager;
AnjutaPluginManager *plugin_manager;
AnjutaStatus *status;
- gchar *dirname, *dirname_tmp, *vfs_dir;
gchar *session_profile_path, *profile_name;
GFile *session_profile;
+ GFile *default_profile;
+ GFile *project_root;
+ GFile *tmp;
ProjectManagerPlugin *plugin;
GError *error = NULL;
- gchar* uri = g_file_get_uri (file);
- GnomeVFSURI* vfs_uri;
plugin = ANJUTA_PLUGIN_PROJECT_MANAGER (ifile);
/* If there is already a project loaded, load in separate anjuta window */
if (plugin->project_root_uri)
{
+ gchar *uri = g_file_get_uri (file);
gchar *quoted_uri = g_shell_quote (uri);
gchar *cmd = g_strconcat ("anjuta --no-splash --no-client ", quoted_uri, NULL);
g_free (quoted_uri);
@@ -2447,48 +2473,41 @@
profile = anjuta_profile_new (PROJECT_PROFILE_NAME, plugin_manager);
/* System default profile */
- session_profile = g_file_new_for_uri (DEFAULT_PROFILE);
- anjuta_profile_add_plugins_from_xml (profile, session_profile,
+ default_profile = g_file_new_for_uri (DEFAULT_PROFILE);
+ anjuta_profile_add_plugins_from_xml (profile, default_profile,
TRUE, &error);
- g_object_unref (session_profile);
+ profile_name = g_file_get_basename (default_profile);
+ g_object_unref (default_profile);
if (error)
{
g_propagate_error (e, error);
-
- g_free(uri);
+ g_free (profile_name);
g_object_unref (profile);
return;
}
/* Project default profile */
- session_profile = g_file_new_for_uri (uri);
- anjuta_profile_add_plugins_from_xml (profile, session_profile, TRUE, &error);
- g_object_unref (session_profile);
+ anjuta_profile_add_plugins_from_xml (profile, file, TRUE, &error);
if (error)
{
g_propagate_error (e, error);
-
- g_free(uri);
+
+ g_free (profile_name);
g_object_unref (profile);
return;
}
/* Project session profile */
- vfs_uri = gnome_vfs_uri_new (uri);
-
- dirname_tmp = gnome_vfs_uri_extract_dirname (vfs_uri);
- dirname = gnome_vfs_unescape_string (dirname_tmp, "");
- g_free (dirname_tmp);
-
- profile_name = g_path_get_basename (DEFAULT_PROFILE);
- gnome_vfs_uri_unref (vfs_uri);
+ project_root = g_file_get_parent (file);
+ tmp = g_file_get_child (project_root, ".anjuta");
+ session_profile = g_file_get_child (tmp, profile_name);
+ g_object_unref (tmp);
+ g_free (profile_name);
- session_profile_path = g_build_filename (dirname, ".anjuta",
- profile_name, NULL);
+ session_profile_path = g_file_get_path (session_profile);
DEBUG_PRINT ("Loading project session profile: %s", session_profile_path);
- session_profile = g_file_new_for_path (session_profile_path);
if (g_file_query_exists (session_profile, NULL))
{
anjuta_profile_add_plugins_from_xml (profile, session_profile,
@@ -2496,8 +2515,9 @@
if (error)
{
g_propagate_error (e, error);
-
- g_free(uri);
+
+ g_free (session_profile_path);
+ g_object_unref (project_root);
g_object_unref (profile);
g_object_unref (session_profile);
@@ -2506,16 +2526,14 @@
}
anjuta_profile_set_sync_file (profile, session_profile);
g_free (session_profile_path);
- g_free (profile_name);
/* Set project uri */
g_free (plugin->project_root_uri);
g_free (plugin->project_uri);
- vfs_dir = gnome_vfs_get_uri_from_local_path (dirname);
- plugin->project_uri = g_strdup (uri);
- plugin->project_root_uri = vfs_dir;
- g_free (dirname);
+ plugin->project_uri = g_file_get_uri (file);
+ plugin->project_root_uri = g_file_get_uri (project_root);
+ g_object_unref (project_root);
/* Load profile */
anjuta_profile_manager_push (profile_manager, profile, &error);
@@ -2532,7 +2550,6 @@
update_ui (plugin);
anjuta_status_progress_tick (status, NULL, _("Project Loaded"));
- g_free (uri);
}
static GFile*
Modified: trunk/plugins/search/search-replace_backend.c
==============================================================================
--- trunk/plugins/search/search-replace_backend.c (original)
+++ trunk/plugins/search/search-replace_backend.c Mon Jan 19 14:18:45 2009
@@ -830,7 +830,7 @@
anjuta_shell_get (ANJUTA_PLUGIN(sr->docman)->shell,
"project_root_uri", G_TYPE_STRING,
&dir_uri, NULL);
- // FIXME : Replace Standard UNIX IO functions by gnome-vfs
+ // FIXME : Replace Standard UNIX IO functions by gio
if (dir_uri)
dir = anjuta_util_get_local_path_from_uri(dir_uri);
Modified: trunk/plugins/sourceview/Makefile.am
==============================================================================
--- trunk/plugins/sourceview/Makefile.am (original)
+++ trunk/plugins/sourceview/Makefile.am Mon Jan 19 14:18:45 2009
@@ -25,7 +25,7 @@
$(WARN_CFLAGS) \
$(DEPRECATED_FLAGS) \
$(GNOME_PRINT_UI_CFLAGS) \
- $(GNOME_VFS_CFLAGS) \
+ $(GIO_CFLAGS) \
$(PLUGIN_SOURCEVIEW_CFLAGS) \
$(LIBANJUTA_CFLAGS)
@@ -75,7 +75,7 @@
# Plugin dependencies
libanjuta_sourceview_la_LIBADD = \
$(GNOME_PRINT_UI_LIBS) \
- $(GNOME_VFS_LIBS) \
+ $(GIO_LIBS) \
$(PLUGIN_SOURCEVIEW_LIBS) \
$(GLADE_LIBS) \
$(LIBANJUTA_LIBS)
Modified: trunk/plugins/valgrind/preferences.c
==============================================================================
--- trunk/plugins/valgrind/preferences.c (original)
+++ trunk/plugins/valgrind/preferences.c Mon Jan 19 14:18:45 2009
@@ -30,7 +30,6 @@
#include <string.h>
#include <gconf/gconf-client.h>
-#include <libgnomevfs/gnome-vfs.h>
#include <libanjuta/anjuta-debug.h>
#define EDITOR_KEY "/apps/anjuta/valgrind/editor"
Modified: trunk/plugins/valgrind/vgdefaultview.c
==============================================================================
--- trunk/plugins/valgrind/vgdefaultview.c (original)
+++ trunk/plugins/valgrind/vgdefaultview.c Mon Jan 19 14:18:45 2009
@@ -674,7 +674,7 @@
* We can only load local files. Support to VFS would require to change all the
* I/O [i.e. fopen/fwrite/etc...] calls for this plugin. I hope day somebody
* will write a gnomelib wrapper that supports old I/O methos.
- * Perhaps a solution would be to save the file grabbed by the gnome_vfs to /tmp
+ * Perhaps a solution would be to save the file grabbed by the gvfs to /tmp
* and then open it with the I/O fopen/fwrite.
*/
Modified: trunk/plugins/valgrind/vggeneralprefs.c
==============================================================================
--- trunk/plugins/valgrind/vggeneralprefs.c (original)
+++ trunk/plugins/valgrind/vggeneralprefs.c Mon Jan 19 14:18:45 2009
@@ -36,7 +36,6 @@
#include <gconf/gconf-client.h>
#include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/anjuta-utils.h>
Modified: trunk/src/anjuta.c
==============================================================================
--- trunk/src/anjuta.c (original)
+++ trunk/src/anjuta.c Mon Jan 19 14:18:45 2009
@@ -138,7 +138,7 @@
/*
* We want to be somewhere at last to start, otherwise bonobo-activation
- * and gnome-vfs gets screwed up at start up
+ * gets screwed up at start up
*/
gnome_client_set_priority (client, 80);
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Mon Jan 19 14:18:45 2009
@@ -30,7 +30,6 @@
#include <libgnome/gnome-program.h>
#include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs.h>
#include <libanjuta/resources.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-file-loader.h>
@@ -118,8 +117,9 @@
{
gchar path[PATH_MAX+1];
gchar *uri_scheme;
+ GFile *file = g_file_new_for_commandline_arg (file_name);
- uri_scheme = gnome_vfs_get_uri_scheme (file_name);
+ uri_scheme = g_file_get_uri_scheme (file);
if (!uri_scheme)
{
memset(path, '\0', PATH_MAX+1);
@@ -127,6 +127,7 @@
return g_strdup (path);
}
g_free (uri_scheme);
+ g_object_unref (file);
return g_strdup (file_name);
}
else
@@ -399,7 +400,5 @@
gtk_widget_show (GTK_WIDGET (app));
gtk_main();
- gnome_vfs_shutdown();
-
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]