if (len == 0) {
LOGD ("update, wsc_ctx->surrounding_cursor = %d\n", wsc_ctx->surrounding_cursor);
g_info_manager->socket_update_surrounding_text (wsc_ctx->surrounding_text ? wsc_ctx->surrounding_text : "", wsc_ctx->surrounding_cursor);
+ g_info_manager->socket_update_cursor_position (wsc_ctx->surrounding_cursor);
} else if (len < 0) {
LOGW ("failed");
} else {
if (len == 0) {
LOGD ("update");
g_info_manager->socket_update_selection (wsc_ctx->selection_text ? wsc_ctx->selection_text : "");
+ g_info_manager->socket_update_cursor_position (wsc_ctx->surrounding_cursor);
} else if (len < 0) {
LOGW ("failed");
} else {
MessageItem* ret = NULL;
if (!m_list_messages.empty()) {
ret = m_list_messages.front();
+ m_list_messages.pop_front();
}
return ret;
}
!ret && iter != m_list_messages.end(); advance(iter, 1)) {
if ((*iter)->get_command_ref() == cmd) {
ret = (*iter);
+ m_list_messages.erase(iter);
}
}
return ret;
}
+ bool has_pending_message_by_cmd(int cmd)
+ {
+ for (MESSAGE_LIST::iterator iter = m_list_messages.begin();
+ iter != m_list_messages.end(); advance(iter, 1)) {
+ if ((*iter)->get_command_ref() == cmd) {
+ return true;
+ }
+ }
+ return false;
+ }
+
void remove_message(MessageItem *message)
{
if (message) {
return false;
message_queue.read_from_transaction(m_impl->recv);
- if (message_queue.get_pending_message_by_cmd(cmd)) {
+ if (message_queue.has_pending_message_by_cmd(cmd)) {
return true;
}