Kaydet (Commit) 0d5614a2 authored tarafından Enrico Tröger's avatar Enrico Tröger

Use the default values for various tools if they don't exist in the config file…

Use the default values for various tools if they don't exist in the config file instead of using g_find_program_in_path(), patch by Yura Siamashka (thanks).
Fix executable check for grep command.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2331 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 055b9b56
......@@ -5,6 +5,11 @@
a notice how to change the used font (#1907117).
* src/plugins.c: Don't load all available plugins on startup, it's only
necessary opening the plugin manager.
* src/keyfile.c, src/search.c:
Use the default values for various tools if they don't exist in the
config file instead of using g_find_program_in_path(), patch by
Yura Siamashka (thanks).
Fix executable check for grep command.
2008-03-12 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
......
......@@ -638,21 +638,10 @@ static void load_dialog_prefs(GKeyFile *config)
g_free(tmp_string2);
/* tools */
tmp_string = g_find_program_in_path(GEANY_DEFAULT_TOOLS_MAKE);
prefs.tools_make_cmd = utils_get_setting_string(config, "tools", "make_cmd", tmp_string);
g_free(tmp_string);
tmp_string = g_find_program_in_path(GEANY_DEFAULT_TOOLS_TERMINAL);
prefs.tools_term_cmd = utils_get_setting_string(config, "tools", "term_cmd", tmp_string);
g_free(tmp_string);
tmp_string = g_find_program_in_path(GEANY_DEFAULT_TOOLS_BROWSER);
prefs.tools_browser_cmd = utils_get_setting_string(config, "tools", "browser_cmd", tmp_string);
g_free(tmp_string);
tmp_string = g_find_program_in_path(GEANY_DEFAULT_TOOLS_GREP);
prefs.tools_grep_cmd = utils_get_setting_string(config, "tools", "grep_cmd", tmp_string);
g_free(tmp_string);
prefs.tools_make_cmd = utils_get_setting_string(config, "tools", "make_cmd", GEANY_DEFAULT_TOOLS_MAKE);
prefs.tools_term_cmd = utils_get_setting_string(config, "tools", "term_cmd", GEANY_DEFAULT_TOOLS_TERMINAL);
prefs.tools_browser_cmd = utils_get_setting_string(config, "tools", "browser_cmd", GEANY_DEFAULT_TOOLS_BROWSER);
prefs.tools_grep_cmd = utils_get_setting_string(config, "tools", "grep_cmd", GEANY_DEFAULT_TOOLS_GREP);
prefs.context_action_cmd = utils_get_setting_string(config, PACKAGE, "context_action_cmd", "");
......
......@@ -1150,6 +1150,7 @@ static gboolean
search_find_in_files(const gchar *search_text, const gchar *dir, const gchar *opts)
{
gchar **argv_prefix, **argv, **opts_argv;
gchar *command_grep;
guint opts_argv_len, i;
GPid child_pid;
gint stdout_fd;
......@@ -1158,7 +1159,8 @@ search_find_in_files(const gchar *search_text, const gchar *dir, const gchar *op
if (! search_text || ! *search_text || ! dir) return TRUE;
if (! g_file_test(prefs.tools_grep_cmd, G_FILE_TEST_IS_EXECUTABLE))
command_grep = g_find_program_in_path(prefs.tools_grep_cmd);
if (command_grep == NULL)
{
ui_set_statusbar(TRUE, _("Cannot execute grep tool '%s';"
" check the path setting in Preferences."), prefs.tools_grep_cmd);
......@@ -1171,7 +1173,7 @@ search_find_in_files(const gchar *search_text, const gchar *dir, const gchar *op
/* set grep command and options */
argv_prefix = g_new0(gchar*, 1 + opts_argv_len + 3 + 1); /* last +1 for recursive arg */
argv_prefix[0] = g_strdup(prefs.tools_grep_cmd);
argv_prefix[0] = command_grep;
for (i = 0; i < opts_argv_len; i++)
{
argv_prefix[i + 1] = g_strdup(opts_argv[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment