dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
iplugin.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 "iplugin.h"
29 #include "iplugin_p.h"
30 #include "pluginmanager.h"
31 #include "pluginspec.h"
32 
250 using namespace ExtensionSystem;
251 
257  : d(new Internal::IPluginPrivate())
258 {
259 }
260 
266 {
267  PluginManager *pm = PluginManager::instance();
268  foreach (QObject *obj, d->addedObjectsInReverseOrder)
269  pm->removeObject(obj);
270  qDeleteAll(d->addedObjectsInReverseOrder);
271  d->addedObjectsInReverseOrder.clear();
272  delete d;
273  d = nullptr;
274 }
275 
282 {
283  return d->pluginSpec;
284 }
285 
291 void IPlugin::addObject(QObject *obj)
292 {
293  PluginManager::instance()->addObject(obj);
294 }
295 
307 {
308  d->addedObjectsInReverseOrder.prepend(obj);
309  PluginManager::instance()->addObject(obj);
310 }
311 
317 void IPlugin::removeObject(QObject *obj)
318 {
319  PluginManager::instance()->removeObject(obj);
320 }
321 
void addObject(QObject *obj)
Definition: iplugin.cpp:291
Core plugin system that manages the plugins, their life cycle and their registered objects...
Definition: pluginmanager.h:53
void removeObject(QObject *obj)
Definition: iplugin.cpp:317
Contains the information of the plugins xml description file and information about the plugin's curre...
Definition: pluginspec.h:63
void addAutoReleasedObject(QObject *obj)
Definition: iplugin.cpp:306
PluginSpec * pluginSpec() const
Definition: iplugin.cpp:281
QList< QObject * > addedObjectsInReverseOrder
Definition: iplugin_p.h:47