mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: use QScopedPointer for DiveComputerManagementDialog::model
Not necessary to do own memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0bc9edf855
commit
f54764cdbc
2 changed files with 5 additions and 7 deletions
|
@ -6,8 +6,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QShortcut>
|
||||
|
||||
DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f),
|
||||
model(0)
|
||||
DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
init();
|
||||
|
@ -20,9 +19,8 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::
|
|||
|
||||
void DiveComputerManagementDialog::init()
|
||||
{
|
||||
delete model;
|
||||
model = new DiveComputerModel(dcList.dcMap);
|
||||
ui.tableView->setModel(model);
|
||||
model.reset(new DiveComputerModel(dcList.dcMap));
|
||||
ui.tableView->setModel(model.data());
|
||||
}
|
||||
|
||||
DiveComputerManagementDialog *DiveComputerManagementDialog::instance()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue