Revision: 650 Author: ntrel Date: 2006-07-29 05:06:00 -0700 (Sat, 29 Jul 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=650&view=rev
Log Message: ----------- Remember Find in files directory for opening grep results
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c trunk/src/msgwindow.c trunk/src/msgwindow.h trunk/src/search.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-07-29 08:45:37 UTC (rev 649) +++ trunk/ChangeLog 2006-07-29 12:06:00 UTC (rev 650) @@ -1,3 +1,9 @@ +2006-07-29 Nick Treleaven nick.treleaven@btinternet.com + + * src/msgwindow.c, src/msgwindow.h, src/callbacks.c, src/search.c: + Remember Find in files directory for opening grep results. + + 2006-07-28 Enrico Tröger enrico.troeger@uvena.de
* src/search.c, src/callbacks.c, src/dialogs.c:
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-07-29 08:45:37 UTC (rev 649) +++ trunk/src/callbacks.c 2006-07-29 12:06:00 UTC (rev 650) @@ -2086,14 +2086,15 @@ locale_dir = g_locale_from_utf8(utf8_dir, -1, NULL, NULL, NULL); if (locale_dir == NULL) locale_dir = g_strdup(utf8_dir);
- gtk_combo_box_prepend_text(GTK_COMBO_BOX(user_data), search_text); - search_find_in_files(search_text, locale_dir, opts); + if (search_find_in_files(search_text, locale_dir, opts)) + { + gtk_combo_box_prepend_text(GTK_COMBO_BOX(user_data), search_text); + gtk_widget_hide(app->find_in_files_dialog); + } g_free(locale_dir); - gtk_widget_hide(app->find_in_files_dialog); } else msgwin_status_add(_("No text to find.")); - } else gtk_widget_hide(app->find_in_files_dialog);
Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2006-07-29 08:45:37 UTC (rev 649) +++ trunk/src/msgwindow.c 2006-07-29 12:06:00 UTC (rev 650) @@ -29,7 +29,6 @@ #include "callbacks.h" #include "msgwindow.h" #include "utils.h" -#include "search.h" #include "document.h"
#include <string.h> @@ -39,6 +38,9 @@ static GdkColor dark = {0, 58832, 58832, 58832}; static GdkColor white = {0, 65535, 65535, 65535};
+gchar *find_in_files_dir = NULL; + + static void msgwin_parse_grep_line(const gchar *string, gchar **filename, gint *line);
@@ -323,7 +325,6 @@ static void msgwin_parse_grep_line(const gchar *string, gchar **filename, gint *line) { gchar *end = NULL; - gchar *path; gchar **fields; gchar *pattern; // pattern to split the error message into some fields guint field_min_len; // used to detect errors after parsing @@ -369,10 +370,8 @@ cur_idx = document_get_cur_idx(); if (cur_idx >= 0 && doc_list[cur_idx].is_valid) { - path = g_path_get_dirname(doc_list[cur_idx].file_name); - *filename = g_strconcat(path, G_DIR_SEPARATOR_S, + *filename = g_strconcat(find_in_files_dir, G_DIR_SEPARATOR_S, fields[field_idx_file] + skip_dot_slash, NULL); - g_free(path); }
g_strfreev(fields);
Modified: trunk/src/msgwindow.h =================================================================== --- trunk/src/msgwindow.h 2006-07-29 08:45:37 UTC (rev 649) +++ trunk/src/msgwindow.h 2006-07-29 12:06:00 UTC (rev 650) @@ -58,7 +58,9 @@
msgwin msgwindow;
+extern gchar *find_in_files_dir;
+ void msgwin_prepare_msg_tree_view(void);
void msgwin_prepare_status_tree_view(void);
Modified: trunk/src/search.c =================================================================== --- trunk/src/search.c 2006-07-29 08:45:37 UTC (rev 649) +++ trunk/src/search.c 2006-07-29 12:06:00 UTC (rev 650) @@ -110,6 +110,8 @@ } else { + g_free(find_in_files_dir); + find_in_files_dir = g_strdup(dir); utils_set_up_io_channel(stdout_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL, search_read_io, NULL); g_child_watch_add(child_pid, search_close_pid, NULL); @@ -167,7 +169,7 @@ dir = g_dir_open(path, 0, &error); if (error) { - geany_debug("Could not open directory (%s)", error->message); + msgwin_status_add(_("Could not open directory (%s)"), error->message); g_error_free(error); *length = 0; return NULL; @@ -197,12 +199,10 @@ { if (condition & (G_IO_IN | G_IO_PRI)) { - //GIOStatus s; gchar *msg;
while (g_io_channel_read_line(source, &msg, NULL, NULL, NULL) && msg) { - //if (s != G_IO_STATUS_NORMAL && s != G_IO_STATUS_EOF) break; msgwin_msg_add(-1, -1, g_strstrip(msg)); g_free(msg); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.