Dive site: introduce proxy model DiveSiteSortedModel

The LocationInformationModel used to sort its entries and was completely
rebuilt after every change. This makes it rather complex to support
incremental changes.

Instead, keep LocationInformationModel sorted by UUID so that indexes
are consistent with indices in the core dive site table.

Implement sorting by other columns than name and enable sorting in the
dive site view.

Finally, don't cache the list of dive site names for the mobile app,
since that would also need some rather convoluted methods of keeping
the list up to date. Calculate it on the fly.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-03-12 17:28:43 +01:00 committed by Dirk Hohndel
parent 59f1191d0c
commit e99c4c9059
6 changed files with 71 additions and 19 deletions

View file

@ -209,7 +209,7 @@ private:
BuddyCompletionModel buddyModel;
SuitCompletionModel suitModel;
DiveMasterCompletionModel divemasterModel;
LocationInformationModel locationModel;
DiveSiteSortedModel locationModel;
QString m_startPageText;
QString m_logText;
QString m_lastError;