From 48acf672dab806498872021beb717a41b6fbc552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bri=C3=A8re?= Date: Sat, 16 Jan 2016 15:42:43 -0500 Subject: Re-sort local address book after adding/editing (The proper solution is probably to create a filter proxy model, but this nevertheless does the job.) --- src/gui/getaddressform.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gui/getaddressform.cpp b/src/gui/getaddressform.cpp index 2303c38..dd81257 100644 --- a/src/gui/getaddressform.cpp +++ b/src/gui/getaddressform.cpp @@ -216,6 +216,8 @@ void GetAddressForm::addLocalAddress() ab_local->add_address(card); m_model->appendAddress(card); + + localListView->sortByColumn(localListView->horizontalHeader()->sortIndicatorSection(), localListView->horizontalHeader()->sortIndicatorOrder()); string error_msg; if (!ab_local->save(error_msg)) { @@ -254,6 +256,8 @@ void GetAddressForm::editLocalAddress() if (f.exec(newCard)) { if (ab_local->update_address(oldCard, newCard)) { m_model->modifyAddress(sel[0].row(), newCard); + + localListView->sortByColumn(localListView->horizontalHeader()->sortIndicatorSection(), localListView->horizontalHeader()->sortIndicatorOrder()); string error_msg; if (!ab_local->save(error_msg)) { -- cgit v1.2.3