SF.net SVN: geany: [774] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Wed Aug 30 18:53:55 UTC 2006


Revision: 774
          http://svn.sourceforge.net/geany/?rev=774&view=rev
Author:   eht16
Date:     2006-08-30 11:53:45 -0700 (Wed, 30 Aug 2006)

Log Message:
-----------
Change the current working directory within the VTE also when a new file is saved.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/callbacks.c
    trunk/src/document.c
    trunk/src/vte.c
    trunk/src/vte.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-08-30 18:36:17 UTC (rev 773)
+++ trunk/ChangeLog	2006-08-30 18:53:45 UTC (rev 774)
@@ -3,6 +3,9 @@
  * configure.in, src/callbacks.c, src/geany.h, src/main.c:
    Removed the whole FIFO code and replaced it with support for
    (Unix Domain) Sockets(including Windows support, but not yet done).
+ * src/vte.c, src/callbacks.c, src/document.c:
+   Change the current working directory within the VTE also when a new
+   file is saved.
 
 
 2006-08-29  Enrico Tröger  <enrico.troeger at uvena.de>

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2006-08-30 18:36:17 UTC (rev 773)
+++ trunk/src/callbacks.c	2006-08-30 18:53:45 UTC (rev 774)
@@ -770,21 +770,7 @@
 		utils_check_disk_status(idx);
 
 #ifdef HAVE_VTE
-		if (vte_info.have_vte && vc->follow_path && doc_list[idx].file_name != NULL)
-		{
-			gchar *path;
-			gchar *cmd;
-
-			path = g_path_get_dirname(doc_list[idx].file_name);
-			vte_get_working_directory();	// refresh vte_info.dir
-			if (! g_str_equal(path, vte_info.dir))
-			{
-				cmd = g_strconcat("cd ", path, "\n", NULL);
-				vte_send_cmd(cmd);
-				g_free(cmd);
-			}
-			g_free(path);
-		}
+	vte_cwd(doc_list[idx].file_name);
 #endif
 	}
 }

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2006-08-30 18:36:17 UTC (rev 773)
+++ trunk/src/document.c	2006-08-30 18:53:45 UTC (rev 774)
@@ -788,6 +788,10 @@
 		utils_update_statusbar(idx, -1);
 		treeviews_openfiles_update(doc_list[idx].iter, basename);
 		g_free(basename);
+#ifdef HAVE_VTE
+		vte_cwd(doc_list[idx].file_name);
+#endif
+
 	}
 }
 

Modified: trunk/src/vte.c
===================================================================
--- trunk/src/vte.c	2006-08-30 18:36:17 UTC (rev 773)
+++ trunk/src/vte.c	2006-08-30 18:53:45 UTC (rev 774)
@@ -422,6 +422,25 @@
 }
 
 
+void vte_cwd(const gchar *filename)
+{
+	if (vte_info.have_vte && vc->follow_path && filename != NULL)
+	{
+		gchar *path;
+		gchar *cmd;
+
+		path = g_path_get_dirname(filename);
+		vte_get_working_directory();	// refresh vte_info.dir
+		if (! g_str_equal(path, vte_info.dir))
+		{
+			cmd = g_strconcat("cd ", path, "\n", NULL);
+			vte_send_cmd(cmd);
+			g_free(cmd);
+		}
+		g_free(path);
+	}
+}
+
 /*
 void vte_drag_data_received(GtkWidget *widget, GdkDragContext  *drag_context, gint x, gint y,
 							GtkSelectionData *data, guint info, guint time)

Modified: trunk/src/vte.h
===================================================================
--- trunk/src/vte.h	2006-08-30 18:36:17 UTC (rev 773)
+++ trunk/src/vte.h	2006-08-30 18:53:45 UTC (rev 774)
@@ -70,8 +70,10 @@
 
 void vte_send_cmd(const gchar *cmd);
 
-const gchar* vte_get_working_directory();
+const gchar* vte_get_working_directory(void);
 
+void vte_cwd(const gchar *filename);
+
 /*
 void vte_drag_data_received(GtkWidget *widget, GdkDragContext  *drag_context, gint x, gint y,
 							GtkSelectionData *data, guint info, guint time);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list