aboutsummaryrefslogtreecommitdiff
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
parent4d1b1fe41d8bb280cb39b39f996fe8922cc60164 (diff)
fix invalid iterator warnings of action.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@209 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/action.c19
3 files changed, 21 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 18851645..b717ba28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-04-11
+ * src/action.c: catch_output(): correctly select the insert text
+ (fix invalid iterator warnings).
+
+2005-04-11
+
* src/gtkutils.[ch]
src/folderview.[ch]: implemented message-to-folder DnD.
Auto-expand and auto-scroll are also implemented.
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 4bd6c235..f02c3cb3 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,10 @@
2005-04-11
+ * src/action.c: catch_output(): 挿入されたテキストを正しく選択する
+ ようにした(不正なイテレータの警告を修正)。
+
+2005-04-11
+
* src/gtkutils.[ch]
src/folderview.[ch]: メッセージからフォルダへの DnD を実装。
自動展開と自動スクロールも実装。
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);