/** * @file SdiWindow/factory.cpp * @brief SDI module's factory class * @author Enar Vaikene * * Copyright (c) 2011 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * * This file can be used under the terms of the GNU General Public License * version 3.0 as published by the Free Software Foundation and appearing in * the file LICENSE included in the packaging of this file. Please review the * the following information to ensure the GNU General Public License version * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. * * Alternatively, this file may be used in accordance with the Commercial License * Agreement provided with the Software. */ #include "factory.h" #include "sdiwindow.h" #include #include using namespace eVaf::SdiWindow; VER_EXPORT_VERSION_INFO() //------------------------------------------------------------------- Factory::Factory() : Plugins::iPluginFactory() , mPlugin(0) { setObjectName(QString("%1-Factory").arg(VER_MODULE_NAME_STR)); EVAF_INFO("%s created", qPrintable(objectName())); } Factory::~Factory() { if (mPlugin) delete mPlugin; EVAF_INFO("%s destroyed", qPrintable(objectName())); } QObject * Factory::create(QString const & name) { Q_UNUSED(name); if (mPlugin == 0) mPlugin = new Internal::SdiWindowPlugin; return mPlugin; }