mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Replace mainWindow() with MainWindow::instance()
C++ style of accessing single instance class object. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cc37d2e94a
commit
c86822c2f4
18 changed files with 104 additions and 96 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue