aboutsummaryrefslogtreecommitdiff
path: root/src/action.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-04-11 10:51:31 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-04-11 10:51:31 +0000
commit2147115dec26c80c0b941f75dc8139be1c653923 (patch)
treec9453f8eebb95821baf7da564272ca5f672b3b95 /src/action.c
parent4d1b1fe41d8bb280cb39b39f996fe8922cc60164 (diff)
fix invalid iterator warnings of action.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@209 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/action.c')
-rw-r--r--src/action.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/action.c b/src/action.c
index 25fe2f26..3949770f 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1213,12 +1213,13 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond)
GtkTextView *text =
GTK_TEXT_VIEW(child_info->children->msg_text);
GtkTextBuffer *textbuf = gtk_text_view_get_buffer(text);
- GtkTextIter iter1, iter2;
+ GtkTextIter iter;
GtkTextMark *mark;
+ gint ins_pos;
mark = gtk_text_buffer_get_insert(textbuf);
- gtk_text_buffer_get_iter_at_mark(textbuf, &iter1, mark);
- gtk_text_buffer_get_iter_at_mark(textbuf, &iter2, mark);
+ gtk_text_buffer_get_iter_at_mark(textbuf, &iter, mark);
+ ins_pos = gtk_text_iter_get_offset(&iter);
while (TRUE) {
gsize bytes_read = 0, bytes_written = 0;
@@ -1232,17 +1233,19 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond)
(buf, c, &bytes_read, &bytes_written, NULL);
if (ret_str && bytes_written > 0) {
gtk_text_buffer_insert
- (textbuf, &iter2, ret_str,
+ (textbuf, &iter, ret_str,
bytes_written);
g_free(ret_str);
} else
- gtk_text_buffer_insert(textbuf, &iter2, buf, c);
+ gtk_text_buffer_insert(textbuf, &iter, buf, c);
}
if (child_info->children->is_selection) {
- gtk_text_buffer_place_cursor(textbuf, &iter1);
- gtk_text_buffer_move_mark_by_name
- (textbuf, "selection_bound", &iter2);
+ GtkTextIter ins;
+
+ gtk_text_buffer_get_iter_at_offset
+ (textbuf, &ins, ins_pos);
+ gtk_text_buffer_select_range(textbuf, &ins, &iter);
}
} else {
c = read(source, buf, sizeof(buf) - 1);