Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lidaobing committed May 24, 2024
1 parent 60c986d commit 6d63251
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/iptux/DialogBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,10 @@ GtkWidget* DialogBase::CreateHistoryArea() {
G_CALLBACK(textview_motion_notify_event), NULL);
g_signal_connect(chat_history_widget, "visibility-notify-event",
G_CALLBACK(textview_visibility_notify_event), NULL);
g_signal_connect_swapped(
grpinf->buffer, "insert-child-anchor",
G_CALLBACK(DialogBase::OnChatHistoryInsertChildAnchor), this);
g_signal_connect_data(grpinf->buffer, "insert-child-anchor",
G_CALLBACK(DialogBase::OnChatHistoryInsertChildAnchor),
this, NULL,
(GConnectFlags)(G_CONNECT_AFTER | G_CONNECT_SWAPPED));

/* 滚动消息到最末位置 */
ScrollHistoryTextview();
Expand Down
5 changes: 3 additions & 2 deletions src/iptux/UiModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,12 @@ static void InsertPixbufToBuffer(GtkTextBuffer* buffer, const gchar* path) {
GtkTextIter iter;

gtk_text_buffer_get_end_iter(buffer, &iter);
GtkTextChildAnchor* anchor =
gtk_text_buffer_create_child_anchor(buffer, &iter);
GtkTextChildAnchor* anchor = gtk_text_child_anchor_new();
g_object_set_data_full(G_OBJECT(anchor), kObjectKeyImagePath, g_strdup(path),
GDestroyNotify(g_free));
gtk_text_buffer_insert_child_anchor(buffer, &iter, anchor);
gtk_text_buffer_get_end_iter(buffer, &iter);
gtk_text_buffer_insert(buffer, &iter, "\n", -1);
}

void GroupInfo::addMsgPara(const MsgPara& para) {
Expand Down
2 changes: 1 addition & 1 deletion src/iptux/UiModelsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ TEST(GroupInfo, addMsgPara) {
ChipData(MessageContentType::PICTURE, testDataPath("iptux.png")));
gi.addMsgPara(msg);
ASSERT_EQ(igtk_text_get_all_text(gi.buffer).substr(10),
" palname:\nhelloworld\n\xEF\xBF\xBC");
" palname:\nhelloworld\n\xEF\xBF\xBC\n");
}

0 comments on commit 6d63251

Please sign in to comment.