]> vaikene.ee Git - evaf/blobdiff - src/plugins/SdiWindow/factory.cpp
Warning fixes and copyright update.
[evaf] / src / plugins / SdiWindow / factory.cpp
index 5ce4d1a90651bbf75960853d8affe13f1a5bfff0..6d5621b9c74969ba7d7dcfa2c0446f5301bdfb7d 100644 (file)
@@ -3,7 +3,7 @@
  * @brief SDI module's factory class
  * @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.
  *
@@ -19,7 +19,6 @@
 
 #include "factory.h"
 #include "sdiwindow.h"
-#include "version.h"
 
 #include <Common/iLogger>
 
 using namespace eVaf::SdiWindow;
 
 VER_EXPORT_VERSION_INFO()
-Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, Factory)
 
 
 //-------------------------------------------------------------------
 
 Factory::Factory()
     : Plugins::iPluginFactory()
-    , mPlugin(0)
 {
     setObjectName(QString("%1-Factory").arg(VER_MODULE_NAME_STR));
 
@@ -44,17 +41,16 @@ Factory::Factory()
 
 Factory::~Factory()
 {
-    if (mPlugin)
-        delete mPlugin;
+    mPlugin.reset();
 
     EVAF_INFO("%s destroyed", qPrintable(objectName()));
 }
 
 QObject * Factory::create(QString const & name)
 {
-    Q_UNUSED(name);
+    Q_UNUSED(name)
 
-    if (mPlugin == 0)
-        mPlugin = new Internal::SdiWindowPlugin;
-    return mPlugin;
+    if (!mPlugin)
+        mPlugin.reset(new Internal::SdiWindowPlugin);
+    return mPlugin.data();
 }