diff options
Diffstat (limited to 'desktop-widgets/divecomputermanagementdialog.cpp')
-rw-r--r-- | desktop-widgets/divecomputermanagementdialog.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/desktop-widgets/divecomputermanagementdialog.cpp b/desktop-widgets/divecomputermanagementdialog.cpp index 5a54bc953..0ff358c22 100644 --- a/desktop-widgets/divecomputermanagementdialog.cpp +++ b/desktop-widgets/divecomputermanagementdialog.cpp @@ -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() |