anjuta r4369 - in trunk: . plugins/cvs-plugin
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4369 - in trunk: . plugins/cvs-plugin
- Date: Sun, 2 Nov 2008 18:01:53 +0000 (UTC)
Author: jhs
Date: Sun Nov 2 18:01:53 2008
New Revision: 4369
URL: http://svn.gnome.org/viewvc/anjuta?rev=4369&view=rev
Log:
2008-11-02 Jens Georg <mail jensge org>
* plugins/cvs-plugin/cvs-callbacks.c (on_cvs_remove_response)
* plugins/cvs-plugin/cvs-actions.c
* plugins/cvs-plugin/cvs-interface.c (is_directory)
* plugins/cvs-plugin/cvs-execute.c (on_cvs_mesg_parse)
* plugins/cvs-plugin/plugin.c (value_added_fm_current_file),
(value_added_project_root_uri)
#511589 â Anjuta uses GNOME-VFS
Modified:
trunk/ChangeLog
trunk/plugins/cvs-plugin/cvs-actions.c
trunk/plugins/cvs-plugin/cvs-callbacks.c
trunk/plugins/cvs-plugin/cvs-execute.c
trunk/plugins/cvs-plugin/cvs-interface.c
trunk/plugins/cvs-plugin/plugin.c
Modified: trunk/plugins/cvs-plugin/cvs-actions.c
==============================================================================
--- trunk/plugins/cvs-plugin/cvs-actions.c (original)
+++ trunk/plugins/cvs-plugin/cvs-actions.c Sun Nov 2 18:01:53 2008
@@ -24,7 +24,6 @@
#include "cvs-callbacks.h"
#include "glade/glade.h"
-#include <libgnomevfs/gnome-vfs.h>
#include "libgen.h"
#include <libanjuta/anjuta-preferences.h>
Modified: trunk/plugins/cvs-plugin/cvs-callbacks.c
==============================================================================
--- trunk/plugins/cvs-plugin/cvs-callbacks.c (original)
+++ trunk/plugins/cvs-plugin/cvs-callbacks.c Sun Nov 2 18:01:53 2008
@@ -19,7 +19,6 @@
#include "cvs-execute.h"
#include "cvs-interface.h"
#include "glade/glade.h"
-#include <libgnomevfs/gnome-vfs.h>
static gchar* get_log_from_textview(GtkWidget* textview)
{
@@ -133,6 +132,8 @@
void
on_cvs_remove_response(GtkDialog* dialog, gint response, CVSData* data)
{
+ GFile* file;
+
if (is_busy(data->plugin, dialog))
return;
@@ -145,9 +146,9 @@
if (!check_filename(dialog, filename))
break;
-
- if (gnome_vfs_unlink(gtk_entry_get_text(GTK_ENTRY(fileentry)))
- != GNOME_VFS_OK)
+
+ file = g_file_new_for_uri(gtk_entry_get_text(GTK_ENTRY(fileentry)));
+ if (!g_file_delete(file, NULL, NULL))
{
anjuta_util_dialog_error
(GTK_WINDOW(dialog),_("Unable to delete file"), NULL);
@@ -155,6 +156,7 @@
cvs_data_free(data);
break;
}
+ g_object_unref(G_OBJECT(file));
anjuta_cvs_remove(ANJUTA_PLUGIN(data->plugin), filename, NULL);
gtk_widget_destroy (GTK_WIDGET(dialog));
Modified: trunk/plugins/cvs-plugin/cvs-execute.c
==============================================================================
--- trunk/plugins/cvs-plugin/cvs-execute.c (original)
+++ trunk/plugins/cvs-plugin/cvs-execute.c Sun Nov 2 18:01:53 2008
@@ -95,7 +95,7 @@
if ((filename = parse_filename (line)))
{
- gchar *uri;
+ GFile *file;
IAnjutaFileLoader *loader;
/* Go to file and line number */
@@ -103,9 +103,9 @@
NULL);
/* FIXME: Determine full file path */
- uri = gnome_vfs_get_uri_from_local_path(filename);
+ file = g_file_new_for_path (filename);
ianjuta_file_loader_load (loader, uri, FALSE, NULL);
- g_free (uri);
+ g_object_unref (file);
g_free (filename);
}
#endif
Modified: trunk/plugins/cvs-plugin/cvs-interface.c
==============================================================================
--- trunk/plugins/cvs-plugin/cvs-interface.c (original)
+++ trunk/plugins/cvs-plugin/cvs-interface.c Sun Nov 2 18:01:53 2008
@@ -18,7 +18,6 @@
#include <libanjuta/anjuta-debug.h>
-#include <libgnomevfs/gnome-vfs.h>
#include "cvs-execute.h"
#include "cvs-callbacks.h"
#include "cvs-interface.h"
@@ -87,19 +86,15 @@
static gboolean is_directory(const gchar* filename)
{
- GnomeVFSFileInfo info;
- GnomeVFSResult result;
+ GFile* file;
+ GFileType type;
- result = gnome_vfs_get_file_info(filename, &info, GNOME_VFS_FILE_INFO_DEFAULT);
- if (result == GNOME_VFS_OK)
- {
- if (info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
- return TRUE;
- else
- return FALSE;
- }
- else
- return FALSE;
+ // FIXME check if filename can only be local file here
+ file = g_file_new_for_path(filename);
+ type = g_file_query_file_type(file, G_FILE_QUERY_INFO_NONE, NULL);
+ g_object_unref(G_OBJECT(file));
+
+ return type == G_FILE_TYPE_DIRECTORY ? TRUE : FALSE;
}
void anjuta_cvs_add (AnjutaPlugin *obj, const gchar* filename,
Modified: trunk/plugins/cvs-plugin/plugin.c
==============================================================================
--- trunk/plugins/cvs-plugin/plugin.c (original)
+++ trunk/plugins/cvs-plugin/plugin.c Sun Nov 2 18:01:53 2008
@@ -18,9 +18,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs.h>
-
#include <libanjuta/anjuta-shell.h>
#include <libanjuta/anjuta-preferences.h>
#include <libanjuta/anjuta-debug.h>
@@ -172,18 +169,12 @@
{
AnjutaUI *ui;
GtkAction *cvs_menu_action;
- gchar *uri;
- GnomeVFSURI *cvs_uri = NULL;
- gchar *cvs_text_uri = NULL;
- gchar *cvs_dir;
gchar *filename;
- GnomeVFSDirectoryHandle* handle;
- GnomeVFSFileInfo info;
- GnomeVFSResult result;
+ GFileType type;
+ GFile *cvs_dir;
GFile* file = G_FILE (g_value_get_object (value));
- uri = g_file_get_uri (file);
- filename = gnome_vfs_get_local_path_from_uri (uri);
+ filename = g_file_get_path (file);
g_return_if_fail (filename != NULL);
CVSPlugin *cvs_plugin = ANJUTA_PLUGIN_CVS (plugin);
@@ -198,38 +189,39 @@
/* If a directory is selected we check if it contains a "CVS" directory,
if it is a file we check if it's directory contains a "CVS" directory */
- result = gnome_vfs_get_file_info(uri, &info,
- GNOME_VFS_FILE_INFO_DEFAULT);
- if (result == GNOME_VFS_OK)
+
+ type = g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL);
+ if (type == GNOME_VFS_FILE_TYPE_DIRECTORY)
{
- if (info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
+ cvs_dir = g_file_get_child (file, "CVS");
+ }
+
+ else
+ {
+ GFile *parent;
+
+ parent = g_file_get_parent (file);
+ if (parent != NULL)
{
- cvs_dir = g_strconcat(uri, "/CVS", NULL);
+ cvs_dir = g_file_get_child (parent, "CVS");
+ g_object_unref (G_OBJECT (parent));
}
-
else
{
- cvs_uri = gnome_vfs_uri_new (uri);
- cvs_text_uri = gnome_vfs_uri_extract_dirname(cvs_uri);
- cvs_dir = g_strconcat(cvs_text_uri, "/CVS", NULL);
- g_free(cvs_text_uri);
- gnome_vfs_uri_unref(cvs_uri);
- }
- }
- else
- return; /* Strange... */
- if (gnome_vfs_directory_open(&handle, cvs_dir,
- GNOME_VFS_FILE_INFO_DEFAULT) == GNOME_VFS_OK)
+ cvs_dir = g_file_new_for_path ("/CVS");
+ }
+ }
+
+ type = g_file_query_file_type (cvs_dir, G_FILE_QUERY_INFO_NONE, NULL);
+ if (type == G_FILE_TYPE_DIRECTORY)
{
-
g_object_set (G_OBJECT (cvs_menu_action), "sensitive", TRUE, NULL);
}
else
{
g_object_set (G_OBJECT (cvs_menu_action), "sensitive", FALSE, NULL);
}
- g_free (cvs_dir);
- g_free (uri);
+ g_object_unref (cvs_dir);
}
static void
@@ -270,7 +262,7 @@
if (root_uri)
{
bb_plugin->project_root_dir =
- gnome_vfs_get_local_path_from_uri (root_uri);
+ anjuta_util_get_local_path_from_uri (root_uri);
if (bb_plugin->project_root_dir)
{
// update_project_ui (bb_plugin);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]