gnome: add contact/history sorting
Refs #73115
Change-Id: I7fee71c7ef330c705a010ed1aa75ff1ec1b6d426
diff --git a/src/utils/models.cpp b/src/utils/models.cpp
index 59da48e..f6d6d31 100644
--- a/src/utils/models.cpp
+++ b/src/utils/models.cpp
@@ -181,11 +181,14 @@
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(box), renderer,
"text", 0, NULL);
+ /* sync the initial selection */
+ gtk_combo_box_set_active_index(box, selection_model->currentIndex());
+
/* connect signals to and from the selection model */
connection = QObject::connect(
selection_model,
&QItemSelectionModel::currentChanged,
- [=](const QModelIndex & current, G_GNUC_UNUSED const QModelIndex & previous) {
+ [=](const QModelIndex current, G_GNUC_UNUSED const QModelIndex & previous) {
gtk_combo_box_set_active_index(box, current);
}
);
@@ -194,8 +197,5 @@
G_CALLBACK(update_selection),
selection_model);
- /* sync the initial selection */
- gtk_combo_box_set_active_index(box, selection_model->currentIndex());
-
return connection;
-}
\ No newline at end of file
+}