mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
d5fafc0e44
There were only three users of that. For now do it inline, but we may think about a separate function, which is only available on desktop. Moreover, add nullptr-checks, even if they are not strictly necessary. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
31 lines
687 B
C++
31 lines
687 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()
|
|
{
|
|
const struct divecomputer *currentdc = get_dive_dc(current_dive, dc_number);
|
|
if (currentdc)
|
|
extraDataModel->updateDiveComputer(currentdc);
|
|
}
|
|
|
|
void TabDiveExtraInfo::clear()
|
|
{
|
|
extraDataModel->clear();
|
|
}
|