ringmainwindow: do not open first conversation when not necessary

Actually when we select the second conversation and click enter when
the focus is on the search_entry or click on the add button, it opens
the first conversation. With this patch, this behavior is removed.

Change-Id: If3c4bb1e302da1ecdf1df0ef3fe0c86cedc024a3
parent 59514edd
......@@ -384,7 +384,10 @@ on_search_entry_activated(RingMainWindow* self)
// Select the first conversation of the list
auto& conversationModel = priv->cpp->accountContainer_->info.conversationModel;
auto conversations = conversationModel->allFilteredConversations();
if (!conversations.empty())
const gchar *text = gtk_entry_get_text(GTK_ENTRY(priv->search_entry));
if (!conversations.empty() && text && !std::string(text).empty())
conversationModel->selectConversation(conversations[0].uid);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment