X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Fplugins%2FSdiWindow%2Fsdiwindow.cpp;h=25a86acab2639b0505ebf10fc35f6b938b5a4ca1;hb=4c0329c5c2690bde28212c89029015a5da4c7e34;hp=c6e1de294320c5b6797bb1424dca1ae99dc6364a;hpb=36bd93cf4263b118366b3db2d26e8efb1ac1b690;p=evaf
diff --git a/src/plugins/SdiWindow/sdiwindow.cpp b/src/plugins/SdiWindow/sdiwindow.cpp
index c6e1de2..25a86ac 100644
--- a/src/plugins/SdiWindow/sdiwindow.cpp
+++ b/src/plugins/SdiWindow/sdiwindow.cpp
@@ -3,7 +3,7 @@
* @brief SdiWindow module's implementation
* @author Enar Vaikene
*
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
@@ -32,7 +32,7 @@ namespace eVaf {
namespace SdiWindow {
namespace Internal {
/// iSdiWindow interface instance singleton
- static iSdiWindow * mSdiWindow = 0;
+ static iSdiWindow * mSdiWindow = nullptr;
} // namespace eVaf::SdiWindow::Internal
} // namespace eVaf::SdiWindow
} // namespace eVaf
@@ -53,7 +53,7 @@ SdiWindow::iSdiWindow * SdiWindow::iSdiWindow::instance()
SdiWindow::Internal::MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags flags)
: QWidget(parent, flags)
, mReady(false)
- , mMainPanel(0)
+ , mMainPanel(nullptr)
{
setObjectName(QString("%1-%2").arg(VER_MODULE_NAME_STR).arg(__FUNCTION__));
@@ -74,7 +74,7 @@ SdiWindow::Internal::MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags fl
SdiWindow::Internal::MainWindow::~MainWindow()
{
- mSdiWindow = 0;
+ mSdiWindow = nullptr;
// Save geometry
saveSettings();
@@ -126,7 +126,7 @@ void SdiWindow::Internal::MainWindow::done()
mPanels.clear();
mMinimizedPanels.clear();
mPanelNames.clear();
- mMainPanel = 0;
+ mMainPanel = nullptr;
mMainPanelName.clear();
EVAF_INFO("%s finalized", qPrintable(objectName()));
@@ -160,7 +160,7 @@ Gui::Panel * SdiWindow::Internal::MainWindow::panel(QString const & name) const
QHash::const_iterator it = mPanelNames.constFind(name);
if (it != mPanelNames.constEnd())
return it.value();
- return 0;
+ return nullptr;
}
bool SdiWindow::Internal::MainWindow::showPanel(QString const & name)
@@ -322,7 +322,7 @@ void SdiWindow::Internal::MainWindow::panelDestroyed(QObject * obj)
// If it was the main panel, set the main panel to NULL
if (mMainPanel == obj) {
- mMainPanel = 0;
+ mMainPanel = nullptr;
}
}
@@ -331,17 +331,16 @@ void SdiWindow::Internal::MainWindow::panelDestroyed(QObject * obj)
SdiWindow::Internal::SdiWindowPlugin::SdiWindowPlugin()
: Plugins::iPlugin()
+ , mWindow(new MainWindow)
{
setObjectName(VER_MODULE_NAME_STR);
- mWindow = new MainWindow;
-
EVAF_INFO("%s created", qPrintable(objectName()));
}
SdiWindow::Internal::SdiWindowPlugin::~SdiWindowPlugin()
{
- delete mWindow;
+ mWindow.reset();
EVAF_INFO("%s destroyed", qPrintable(objectName()));
}