mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Cleanup: fold DiveComputerManagementDialog::update() into init()
update() was only called in conjunction with init(). No point in having two functions. The separation between both functions seemed arbitrary anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f54764cdbc
commit
b0cc416954
3 changed files with 4 additions and 10 deletions
|
@ -20,7 +20,11 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::
|
|||
void DiveComputerManagementDialog::init()
|
||||
{
|
||||
model.reset(new DiveComputerModel(dcList.dcMap));
|
||||
model->update();
|
||||
ui.tableView->setModel(model.data());
|
||||
ui.tableView->resizeColumnsToContents();
|
||||
ui.tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
|
||||
layout()->activate();
|
||||
}
|
||||
|
||||
DiveComputerManagementDialog *DiveComputerManagementDialog::instance()
|
||||
|
@ -29,14 +33,6 @@ DiveComputerManagementDialog *DiveComputerManagementDialog::instance()
|
|||
return self;
|
||||
}
|
||||
|
||||
void DiveComputerManagementDialog::update()
|
||||
{
|
||||
model->update();
|
||||
ui.tableView->resizeColumnsToContents();
|
||||
ui.tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
|
||||
layout()->activate();
|
||||
}
|
||||
|
||||
void DiveComputerManagementDialog::tryRemove(const QModelIndex &index)
|
||||
{
|
||||
if (index.column() != DiveComputerModel::REMOVE)
|
||||
|
|
|
@ -12,7 +12,6 @@ class DiveComputerManagementDialog : public QDialog {
|
|||
|
||||
public:
|
||||
static DiveComputerManagementDialog *instance();
|
||||
void update();
|
||||
void init();
|
||||
|
||||
public
|
||||
|
|
|
@ -892,7 +892,6 @@ void MainWindow::on_actionDivelogs_de_triggered()
|
|||
void MainWindow::on_actionEditDeviceNames_triggered()
|
||||
{
|
||||
DiveComputerManagementDialog::instance()->init();
|
||||
DiveComputerManagementDialog::instance()->update();
|
||||
DiveComputerManagementDialog::instance()->show();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue