diff options
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 217c66dbb..8795b93df 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -36,12 +36,7 @@ #include "printdialog.h" #include "divelogimportdialog.h" -static MainWindow* instance = 0; - -MainWindow* mainWindow() -{ - return instance; -} +MainWindow *MainWindow::m_Instance = NULL; MainWindow::MainWindow() : QMainWindow(), actionNextDive(0), @@ -49,7 +44,7 @@ MainWindow::MainWindow() : QMainWindow(), helpView(0), state(VIEWALL) { - instance = this; + m_Instance = this; ui.setupUi(this); setWindowIcon(QIcon(":subsurface-icon")); connect(ui.ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int))); @@ -79,6 +74,16 @@ MainWindow::MainWindow() : QMainWindow(), #endif } +MainWindow::~MainWindow() +{ + m_Instance = NULL; +} + +MainWindow *MainWindow::instance() +{ + return m_Instance; +} + // this gets called after we download dives from a divecomputer void MainWindow::refreshDisplay(bool recreateDiveList) { |