anjuta r4532 - in trunk: . plugins/run-program plugins/subversion
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4532 - in trunk: . plugins/run-program plugins/subversion
- Date: Mon, 5 Jan 2009 11:02:52 +0000 (UTC)
Author: jhs
Date: Mon Jan 5 11:02:52 2009
New Revision: 4532
URL: http://svn.gnome.org/viewvc/anjuta?rev=4532&view=rev
Log:
2008-01-04 Jens Georg <mail jensge org>
reviewed by: Johannes Schmid <jhs gnome org>
* plugins/run-program/execute.c (get_local_executable),
(get_local_directory):
* plugins/run-program/parameters.c (on_add_uri_in_model),
(on_add_directory_in_chooser), (save_dialog_data),
(run_dialog_init):
* plugins/run-program/plugin.c:
2008-01-04 Jens Georg <mail jensge org>
* plugins/subversion/plugin.c:
#511589 â Anjuta uses GNOME-VFS
Modified:
trunk/ChangeLog
trunk/plugins/run-program/execute.c
trunk/plugins/run-program/parameters.c
trunk/plugins/run-program/plugin.c
trunk/plugins/subversion/plugin.c
Modified: trunk/plugins/run-program/execute.c
==============================================================================
--- trunk/plugins/run-program/execute.c (original)
+++ trunk/plugins/run-program/execute.c Mon Jan 5 11:02:52 2009
@@ -30,8 +30,6 @@
#include <libanjuta/interfaces/ianjuta-terminal.h>
#include <libanjuta/interfaces/ianjuta-builder.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
#include <signal.h>
/* Constants
@@ -65,7 +63,7 @@
if (uri != NULL)
{
- local = gnome_vfs_get_local_path_from_uri (uri);
+ local = anjuta_util_get_local_path_from_uri (uri);
if (local == NULL)
{
/* Only local program are supported */
@@ -102,7 +100,7 @@
if (uri != NULL)
{
- local = gnome_vfs_get_local_path_from_uri (uri);
+ local = anjuta_util_get_local_path_from_uri (uri);
if (local == NULL)
{
/* Only local directory are supported */
Modified: trunk/plugins/run-program/parameters.c
==============================================================================
--- trunk/plugins/run-program/parameters.c (original)
+++ trunk/plugins/run-program/parameters.c Mon Jan 5 11:02:52 2009
@@ -31,8 +31,6 @@
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-project-manager.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
/*---------------------------------------------------------------------------*/
#define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-run-program.ui"
@@ -103,7 +101,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, ENV_NAME_COLUMN, local, -1);
g_free (local);
@@ -115,7 +113,7 @@
GtkFileChooser* chooser = (GtkFileChooser *)user_data;
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_file_chooser_add_shortcut_folder (chooser, (const gchar *)local, NULL);
g_free (local);
}
@@ -255,21 +253,12 @@
filename = gtk_entry_get_text (GTK_ENTRY (GTK_BIN (dlg->target)->child));
if ((filename != NULL) && (*filename != '\0'))
{
- if (!g_path_is_absolute (filename))
- {
- gchar *abs_filename;
- gchar *current_dir;
-
- current_dir = g_get_current_dir ();
- abs_filename = g_build_filename (current_dir, filename, NULL);
- g_free (current_dir);
- uri = gnome_vfs_get_uri_from_local_path (abs_filename);
- g_free (abs_filename);
- }
- else
- {
- uri = gnome_vfs_get_uri_from_local_path (filename);
- }
+ GFile *file;
+
+ file = g_file_new_for_path (filename);
+ uri = g_file_get_uri (file);
+ g_free (file);
+
if (uri != NULL)
{
find = g_list_find_custom (plugin->recent_target, uri, (GCompareFunc)strcmp);
@@ -700,7 +689,7 @@
{
gchar *local;
- local = gnome_vfs_get_local_path_from_uri ((const char *)plugin->recent_target->data);
+ local = anjuta_util_get_local_path_from_uri ((const char *)plugin->recent_target->data);
gtk_entry_set_text (GTK_ENTRY (GTK_BIN (dlg->target)->child), local);
g_free (local);
}
Modified: trunk/plugins/run-program/plugin.c
==============================================================================
--- trunk/plugins/run-program/plugin.c (original)
+++ trunk/plugins/run-program/plugin.c Mon Jan 5 11:02:52 2009
@@ -33,8 +33,6 @@
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/interfaces/ianjuta-project-manager.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
#include <signal.h>
/*---------------------------------------------------------------------------*/
Modified: trunk/plugins/subversion/plugin.c
==============================================================================
--- trunk/plugins/subversion/plugin.c (original)
+++ trunk/plugins/subversion/plugin.c Mon Jan 5 11:02:52 2009
@@ -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>
@@ -211,18 +208,13 @@
{
AnjutaUI *ui;
GtkAction *subversion_menu_action;
- gchar *uri;
- GnomeVFSURI *subversion_uri = NULL;
- gchar *subversion_text_uri = NULL;
- gchar *subversion_dir;
gchar *filename;
- GnomeVFSDirectoryHandle* handle;
- GnomeVFSFileInfo info;
- GnomeVFSResult result;
GFile* file;
+ GFile* svn_dir;
+ GFileType type;
+ GFileEnumerator *en;
file = G_FILE(g_value_get_object (value));
- uri = g_file_get_uri (file);
filename = g_file_get_path (file);
g_return_if_fail (filename != NULL);
@@ -238,43 +230,40 @@
/* If a directory is selected we check if it contains a "Subversion" directory,
if it is a file we check if it's directory contains a "Subversion" 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 == G_FILE_TYPE_DIRECTORY)
+ {
+ svn_dir = g_file_get_child (file, ".svn");
+ }
+ else
{
- if (info.type == GNOME_VFS_FILE_TYPE_DIRECTORY)
+ GFile *parent;
+
+ parent = g_file_get_parent (file);
+ if (parent != NULL)
{
- /* Is "Subversion" a valid svn directory in a local checkout,
- * If yes, we should check for both .svn and Subversion.
- */
- /* subversion_dir = g_build_filename (uri, "Subversion", NULL); */
- subversion_dir = g_build_filename (uri, ".svn", NULL);
+ svn_dir = g_file_get_child (parent, ".svn");
+ g_object_unref (G_OBJECT (parent));
}
-
else
{
- subversion_uri = gnome_vfs_uri_new (uri);
- subversion_text_uri = gnome_vfs_uri_extract_dirname(subversion_uri);
- /* subversion_dir = g_strconcat(subversion_text_uri, "/Subversion", NULL); */
- subversion_dir = g_build_filename(subversion_text_uri, ".svn", NULL);
- g_free(subversion_text_uri);
- gnome_vfs_uri_unref(subversion_uri);
- }
+ svn_dir = g_file_new_for_path("/.svn");
+ }
}
- else
- return; /* Strange... */
- if (gnome_vfs_directory_open(&handle, subversion_dir,
- GNOME_VFS_FILE_INFO_DEFAULT) == GNOME_VFS_OK)
+
+ en = g_file_enumerate_children (svn_dir, "", G_FILE_QUERY_INFO_NONE,
+ NULL, NULL);
+ if (en != NULL)
{
-
+ g_object_unref (en);
g_object_set (G_OBJECT (subversion_menu_action), "sensitive", TRUE, NULL);
}
else
{
g_object_set (G_OBJECT (subversion_menu_action), "sensitive", FALSE, NULL);
}
- g_free (subversion_dir);
- g_free (uri);
+
+ g_object_unref (svn_dir);
}
static void
@@ -328,8 +317,8 @@
root_uri = g_value_get_string (value);
if (root_uri)
{
- bb_plugin->project_root_dir =
- gnome_vfs_get_local_path_from_uri (root_uri);
+ bb_plugin->project_root_dir =
+ 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]