Add the project's base_path to the directory list in the Find in Files dialog if a project is open.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3236 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
631da007a4
commit
0bfd8eb893
@ -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>
|
||||
|
11
src/search.c
11
src/search.c
@ -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 @@ 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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user