diff --git a/ChangeLog b/ChangeLog index 9b2ae03c..4fff86a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/search.c b/src/search.c index d4567502..76cb7997 100644 --- a/src/search.c +++ b/src/search.c @@ -39,6 +39,7 @@ #include "ui_utils.h" #include "editor.h" #include "encodings.h" +#include "project.h" #include #include @@ -743,6 +744,7 @@ void search_show_find_in_files_dialog(const gchar *dir) 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 @@ void search_show_find_in_files_dialog(const gchar *dir) 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 */