diff src/layout_util.c @ 980:a4a38ea9fbaa

Add an option named layout.home_path which modifies the behavior of the Home button. By default, pressing this button goes to the user's home directory. When this option is set to a path, this path is used instead. One can change the option value through Preferences > Advanced > Navigation or directly in .geeqierc. Feature proposed by Colin Clark.
author zas_
date Fri, 22 Aug 2008 21:52:13 +0000
parents c414002a1f27
children 6ca2c5fd7b13
line wrap: on
line diff
--- a/src/layout_util.c	Thu Aug 21 22:49:30 2008 +0000
+++ b/src/layout_util.c	Fri Aug 22 21:52:13 2008 +0000
@@ -1458,10 +1458,16 @@
 
 static void layout_button_home_cb(GtkWidget *widget, gpointer data)
 {
-	LayoutWindow *lw = data;
-	const gchar *path = homedir();
+	const gchar *path;
+	
+	if (options->layout.home_path && *options->layout.home_path)
+		path = options->layout.home_path;
+	else
+		path = homedir();
+
 	if (path)
 		{
+		LayoutWindow *lw = data;
 		FileData *dir_fd = file_data_new_simple(path);
 		layout_set_fd(lw, dir_fd);
 		file_data_unref(dir_fd);