dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
plugin1.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 "plugin1.h"
29 
31 
32 #include <QtCore/qplugin.h>
33 #include <QtCore/QObject>
34 
35 using namespace Plugin1;
36 
38  : initializeCalled(false)
39 {
40 }
41 
42 bool MyPlugin1::initialize(const QStringList & /*arguments*/, QString *errorString)
43 {
44  initializeCalled = true;
45  QObject *obj = new QObject;
46  obj->setObjectName("MyPlugin1");
48 
49  bool found2 = false;
50  bool found3 = false;
51  foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) {
52  if (object->objectName() == "MyPlugin2")
53  found2 = true;
54  else if (object->objectName() == "MyPlugin3")
55  found3 = true;
56  }
57  if (found2 && found3)
58  return true;
59  if (errorString) {
60  QString error = "object(s) missing from plugin(s):";
61  if (!found2)
62  error.append(" plugin2");
63  if (!found3)
64  error.append(" plugin3");
65  *errorString = error;
66  }
67  return false;
68 }
69 
71 {
72  if (!initializeCalled)
73  return;
74  // don't do this at home, it's just done here for the test
75  QObject *obj = new QObject;
76  obj->setObjectName("MyPlugin1_running");
78 }
79 
80 Q_EXPORT_PLUGIN(MyPlugin1)
81 
bool initialize(const QStringList &arguments, QString *errorString)
Definition: plugin1.cpp:38
void addAutoReleasedObject(QObject *obj)
Definition: iplugin.cpp:306
else error('Your technical computing program does not support file choosers.Please input the file name in the argument. ') end elseif nargin >0 logfile
void extensionsInitialized()
Definition: plugin1.cpp:45