##// END OF EJS Templates
Initializes plugin
Alexandre Leroux -
r352:b2a47c61d04d
parent child
Show More
@@ -0,0 +1,25
1 #ifndef SCIQLOP_AMDAPLUGIN_H
2 #define SCIQLOP_AMDAPLUGIN_H
3
4 #include "AmdaGlobal.h"
5
6 #include <Plugin/IPlugin.h>
7
8 #include <QLoggingCategory>
9
10 #include <memory>
11
12 Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaPlugin)
13
14 class DataSourceItem;
15
16 class SCIQLOP_AMDA_EXPORT AmdaPlugin : public QObject, public IPlugin {
17 Q_OBJECT
18 Q_INTERFACES(IPlugin)
19 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE "amda.json")
20 public:
21 /// @sa IPlugin::initialize()
22 void initialize() override;
23 };
24
25 #endif // SCIQLOP_AMDAPLUGIN_H
@@ -0,0 +1,3
1 {
2 "name" : "Amda"
3 }
@@ -0,0 +1,29
1 #include "AmdaPlugin.h"
2
3 #include <DataSource/DataSourceController.h>
4
5 #include <SqpApplication.h>
6
7 Q_LOGGING_CATEGORY(LOG_AmdaPlugin, "AmdaPlugin")
8
9 namespace {
10
11 /// Name of the data source
12 const auto DATA_SOURCE_NAME = QStringLiteral("AMDA");
13
14 } // namespace
15
16 void AmdaPlugin::initialize()
17 {
18 if (auto app = sqpApp) {
19 // Registers to the data source controller
20 auto &dataSourceController = app->dataSourceController();
21 auto dataSourceUid = dataSourceController.registerDataSource(DATA_SOURCE_NAME);
22
23 // Sets data source tree
24 /// @todo ALX
25 }
26 else {
27 qCWarning(LOG_AmdaPlugin()) << tr("Can't access to SciQlop application");
28 }
29 }
General Comments 0
You need to be logged in to leave comments. Login now