Fix wrong call being displayed
RecentModel QModelIndex was being used to query the CallModel.
Change-Id: Ief608f1d94a101db715ed6cd031a1011bce3de6f
Tuleap: #203
diff --git a/src/ringmainwindow.cpp b/src/ringmainwindow.cpp
index 829626b..c7ef228 100644
--- a/src/ringmainwindow.cpp
+++ b/src/ringmainwindow.cpp
@@ -280,10 +280,10 @@
if(auto call = RecentModel::instance().getActiveCall(idx_selected)) {
/* check if we need to change the view */
auto current_view = gtk_bin_get_child(GTK_BIN(priv->frame_call));
- QVariant state = CallModel::instance().data(idx_selected, static_cast<int>(Call::Role::LifeCycleState));
+ auto state = call->lifeCycleState();
/* check what the current state is vs what is displayed */
- switch(state.value<Call::LifeCycleState>()) {
+ switch(state) {
case Call::LifeCycleState::CREATION:
case Call::LifeCycleState::FINISHED:
/* go back to incoming call view;