mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
7a443423bc
The goal here is to remove a dependency on displayed_dive. While doing so, make the model more general and display any dc. Pass in the dc of the current dive instead of displayed dive, since all other tabs are already converted to show data of the current dive. The QStrings are cached since we generate them anyway, so we may just keep them. Thus, there is no danger of the dc becoming invalid. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
29 lines
593 B
C++
29 lines
593 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "TabDiveExtraInfo.h"
|
|
#include "ui_TabDiveExtraInfo.h"
|
|
#include "core/dive.h"
|
|
#include "qt-models/divecomputerextradatamodel.h"
|
|
|
|
TabDiveExtraInfo::TabDiveExtraInfo(QWidget *parent) :
|
|
TabBase(parent),
|
|
ui(new Ui::TabDiveExtraInfo()),
|
|
extraDataModel(new ExtraDataModel(this))
|
|
{
|
|
ui->setupUi(this);
|
|
ui->extraData->setModel(extraDataModel);
|
|
}
|
|
|
|
TabDiveExtraInfo::~TabDiveExtraInfo()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void TabDiveExtraInfo::updateData()
|
|
{
|
|
extraDataModel->updateDiveComputer(current_dc);
|
|
}
|
|
|
|
void TabDiveExtraInfo::clear()
|
|
{
|
|
extraDataModel->clear();
|
|
}
|