mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Only create UpdateManager once it is needed
Instead of unconditionally creating the object at program start let's create it the first time we need it. That should avoid adding more and more delays at program start (not to mention the usually unnecessary memory use). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4ee94167f1
commit
59912568d0
1 changed files with 5 additions and 2 deletions
|
@ -54,7 +54,8 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
helpView(0),
|
||||
yearlyStats(0),
|
||||
yearlyStatsModel(0),
|
||||
state(VIEWALL)
|
||||
state(VIEWALL),
|
||||
updateManager(0)
|
||||
{
|
||||
Q_ASSERT_X(m_Instance == NULL, "MainWindow", "MainWindow recreated!");
|
||||
m_Instance = this;
|
||||
|
@ -85,7 +86,6 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
ui.divePlanner->settingsChanged();
|
||||
ui.divePlannerWidget->settingsChanged();
|
||||
|
||||
updateManager = new UpdateManager(this);
|
||||
|
||||
#ifndef ENABLE_PLANNER
|
||||
// ui.menuLog->removeAction(ui.actionDivePlanner);
|
||||
|
@ -580,6 +580,9 @@ void MainWindow::on_actionAboutSubsurface_triggered()
|
|||
|
||||
void MainWindow::on_action_Check_for_Updates_triggered()
|
||||
{
|
||||
if (!updateManager)
|
||||
updateManager = new UpdateManager(this);
|
||||
|
||||
updateManager->checkForUpdates();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue