mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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()
|
void DiveComputerManagementDialog::init()
|
||||||
{
|
{
|
||||||
model.reset(new DiveComputerModel(dcList.dcMap));
|
model.reset(new DiveComputerModel(dcList.dcMap));
|
||||||
|
model->update();
|
||||||
ui.tableView->setModel(model.data());
|
ui.tableView->setModel(model.data());
|
||||||
|
ui.tableView->resizeColumnsToContents();
|
||||||
|
ui.tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
|
||||||
|
layout()->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
DiveComputerManagementDialog *DiveComputerManagementDialog::instance()
|
DiveComputerManagementDialog *DiveComputerManagementDialog::instance()
|
||||||
|
@ -29,14 +33,6 @@ DiveComputerManagementDialog *DiveComputerManagementDialog::instance()
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveComputerManagementDialog::update()
|
|
||||||
{
|
|
||||||
model->update();
|
|
||||||
ui.tableView->resizeColumnsToContents();
|
|
||||||
ui.tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
|
|
||||||
layout()->activate();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DiveComputerManagementDialog::tryRemove(const QModelIndex &index)
|
void DiveComputerManagementDialog::tryRemove(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (index.column() != DiveComputerModel::REMOVE)
|
if (index.column() != DiveComputerModel::REMOVE)
|
||||||
|
|
|
@ -12,7 +12,6 @@ class DiveComputerManagementDialog : public QDialog {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DiveComputerManagementDialog *instance();
|
static DiveComputerManagementDialog *instance();
|
||||||
void update();
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
public
|
public
|
||||||
|
|
|
@ -892,7 +892,6 @@ void MainWindow::on_actionDivelogs_de_triggered()
|
||||||
void MainWindow::on_actionEditDeviceNames_triggered()
|
void MainWindow::on_actionEditDeviceNames_triggered()
|
||||||
{
|
{
|
||||||
DiveComputerManagementDialog::instance()->init();
|
DiveComputerManagementDialog::instance()->init();
|
||||||
DiveComputerManagementDialog::instance()->update();
|
|
||||||
DiveComputerManagementDialog::instance()->show();
|
DiveComputerManagementDialog::instance()->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue