mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
import: initialize DiveSiteImportModel in constructor
The old code would construct and then initialize the object in a separate function, which added lots of complication. Just initialize the thing in the constructor, store a reference, not a pointer to the table. And do a few other code cleanups. The result is distinctly more pleasing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
512eada468
commit
858a0aecba
3 changed files with 23 additions and 35 deletions
|
@ -13,7 +13,7 @@
|
|||
DivesiteImportDialog::DivesiteImportDialog(dive_site_table imported, QString source, QWidget *parent) : QDialog(parent),
|
||||
importedSites(std::move(imported)),
|
||||
importedSource(std::move(source)),
|
||||
divesiteImportedModel(std::make_unique<DivesiteImportedModel>())
|
||||
divesiteImportedModel(std::make_unique<DivesiteImportedModel>(importedSites))
|
||||
{
|
||||
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
|
||||
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
|
||||
|
@ -40,8 +40,6 @@ DivesiteImportDialog::DivesiteImportDialog(dive_site_table imported, QString sou
|
|||
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
|
||||
|
||||
ui.ok->setEnabled(true);
|
||||
|
||||
divesiteImportedModel->repopulate(&importedSites);
|
||||
}
|
||||
|
||||
DivesiteImportDialog::~DivesiteImportDialog()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue