dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
plugin3.cpp
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #include "plugin3.h"
29 
31 
32 #include <QtCore/qplugin.h>
33 #include <QtCore/QObject>
34 
35 using namespace Plugin3;
36 
38  : initializeCalled(false)
39 {
40 }
41 
42 bool MyPlugin3::initialize(const QStringList & /*arguments*/, QString *errorString)
43 {
44  initializeCalled = true;
45  QObject *obj = new QObject(this);
46  obj->setObjectName("MyPlugin3");
48 
49  bool found2 = false;
50  foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) {
51  if (object->objectName() == "MyPlugin2")
52  found2 = true;
53  }
54  if (found2)
55  return true;
56  if (errorString)
57  *errorString = "object from plugin2 could not be found";
58  return false;
59 }
60 
62 {
63  if (!initializeCalled)
64  return;
65  // don't do this at home, it's just done here for the test
66  QObject *obj = new QObject(this);
67  obj->setObjectName("MyPlugin3_running");
69 }
70 
71 Q_EXPORT_PLUGIN(MyPlugin3)
bool initialize(const QStringList &arguments, QString *errorString)
Definition: plugin3.cpp:37
void extensionsInitialized()
Definition: plugin3.cpp:42
void addAutoReleasedObject(QObject *obj)
Definition: iplugin.cpp:306