SF.net SVN: geany:[3236] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Nov 16 17:53:33 UTC 2008


Revision: 3236
          http://geany.svn.sourceforge.net/geany/?rev=3236&view=rev
Author:   eht16
Date:     2008-11-16 17:53:33 +0000 (Sun, 16 Nov 2008)

Log Message:
-----------
Add the project's base_path to the directory list in the Find in Files dialog if a project is open.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/search.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-11-16 17:53:13 UTC (rev 3235)
+++ trunk/ChangeLog	2008-11-16 17:53:33 UTC (rev 3236)
@@ -5,6 +5,8 @@
  * src/search.c:
    Capture command's stderr and log it into the Debug messages window
    when a Find in Files search fails.
+   Add the project's base_path to the directory list in the Find in
+   Files dialog if a project is open.
 
 
 2008-11-15  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c	2008-11-16 17:53:13 UTC (rev 3235)
+++ trunk/src/search.c	2008-11-16 17:53:33 UTC (rev 3236)
@@ -39,6 +39,7 @@
 #include "ui_utils.h"
 #include "editor.h"
 #include "encodings.h"
+#include "project.h"
 
 #include <unistd.h>
 #include <string.h>
@@ -743,6 +744,7 @@
 	gchar *sel = NULL;
 	gchar *cur_dir = NULL;
 	GeanyEncodingIndex enc_idx = GEANY_ENCODING_UTF_8;
+	static gboolean project_basepath_added = FALSE;
 
 	if (widgets.find_in_files_dialog == NULL)
 	{
@@ -758,6 +760,15 @@
 		gtk_entry_set_text(GTK_ENTRY(entry), sel);
 	g_free(sel);
 
+	/* add project's base path directory to the dir list, we do this here once
+	 * (in create_fif_dialog() it would fail if a project is opened after dialog creation) */
+	if (app->project != NULL && NZV(app->project->base_path) && ! project_basepath_added)
+	{
+		gtk_combo_box_prepend_text(GTK_COMBO_BOX(find_in_files.dir_combo),
+			app->project->base_path);
+		project_basepath_added = TRUE;
+	}
+
 	entry = GTK_BIN(find_in_files.dir_combo)->child;
 	if (NZV(dir))
 		cur_dir = g_strdup(dir);	/* custom directory argument passed */


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