mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Update DiveLocationModel when thread finishes
This patch updates the DiveLocationModel when the GeoLoockupInformationThread finishes, and also selects the correct index for the displayed dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d6e61b74fc
commit
ac6a7ab24e
5 changed files with 25 additions and 4 deletions
|
@ -1,6 +1,12 @@
|
|||
#include "divelocationmodel.h"
|
||||
#include "dive.h"
|
||||
|
||||
LocationInformationModel *LocationInformationModel::instance()
|
||||
{
|
||||
static LocationInformationModel *self = new LocationInformationModel();
|
||||
return self;
|
||||
}
|
||||
|
||||
LocationInformationModel::LocationInformationModel(QObject *obj) : QAbstractListModel(obj), internalRowCount(0)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
class LocationInformationModel : public QAbstractListModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
LocationInformationModel(QObject *obj = 0);
|
||||
static LocationInformationModel *instance();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
|
||||
public slots:
|
||||
void update();
|
||||
private:
|
||||
LocationInformationModel(QObject *obj = 0);
|
||||
int internalRowCount;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue