]> vaikene.ee Git - evaf/blob - src/plugins/LogView/factory.cpp
Merge branch 'master' of ssh://vaikene.net/var/gitpub/evaf
[evaf] / src / plugins / LogView / factory.cpp
1 /**
2 * @file LogView/factory.cpp
3 * @brief LogView module's factory class
4 * @author Enar Vaikene
5 *
6 * Copyright (c) 2011 Enar Vaikene
7 *
8 * This file is part of the eVaf C++ cross-platform application development framework.
9 *
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
15 *
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
18 */
19
20 #include "factory.h"
21 #include "logview.h"
22 #include "version.h"
23
24 #include <Common/iLogger>
25
26 #include <QtCore>
27
28 using namespace eVaf::LogView;
29
30 VER_EXPORT_VERSION_INFO()
31 Q_EXPORT_PLUGIN2(VER_MODULE_NAME_STR, Factory)
32
33
34 //-------------------------------------------------------------------
35
36 Factory::Factory()
37 : Plugins::iPluginFactory()
38 , mPlugin(0)
39 {
40 setObjectName(QString("%1-Factory").arg(VER_MODULE_NAME_STR));
41
42 EVAF_INFO("%s created", qPrintable(objectName()));
43 }
44
45 Factory::~Factory()
46 {
47 if (mPlugin)
48 delete mPlugin;
49
50 EVAF_INFO("%s destroyed", qPrintable(objectName()));
51 }
52
53 QObject * Factory::create(QString const & name)
54 {
55 Q_UNUSED(name);
56
57 if (mPlugin == 0)
58 mPlugin = new Internal::Module;
59 return mPlugin;
60 }