@@ -1,38 +1,59 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the QLop Software |
|
2 | -- This file is a part of the QLop Software | |
3 | -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS |
|
3 | -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 2 of the License, or |
|
7 | -- the Free Software Foundation; either version 2 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | -------------------------------------------------------------------------------*/ |
|
18 | -------------------------------------------------------------------------------*/ | |
19 | /*-- Author : Alexis Jeandet |
|
19 | /*-- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@member.fsf.org |
|
20 | -- Mail : alexis.jeandet@member.fsf.org | |
21 | ----------------------------------------------------------------------------*/ |
|
21 | ----------------------------------------------------------------------------*/ | |
22 | #include "MainWindow.h" |
|
22 | #include "MainWindow.h" | |
23 | #include <QProcessEnvironment> |
|
23 | #include <QProcessEnvironment> | |
24 | #include <QThread> |
|
24 | #include <QThread> | |
25 | #include <SqpApplication.h> |
|
25 | #include <SqpApplication.h> | |
26 | #include <qglobal.h> |
|
26 | #include <qglobal.h> | |
27 |
|
27 | |||
|
28 | #include <Plugin/PluginManager.h> | |||
|
29 | #include <QDir> | |||
|
30 | ||||
|
31 | namespace { | |||
|
32 | ||||
|
33 | /// Name of the directory containing the plugins | |||
|
34 | const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins"); | |||
|
35 | ||||
|
36 | } // namespace | |||
|
37 | ||||
28 | int main(int argc, char *argv[]) |
|
38 | int main(int argc, char *argv[]) | |
29 | { |
|
39 | { | |
30 | SqpApplication a{argc, argv}; |
|
40 | SqpApplication a{argc, argv}; | |
31 | SqpApplication::setOrganizationName("LPP"); |
|
41 | SqpApplication::setOrganizationName("LPP"); | |
32 | SqpApplication::setOrganizationDomain("lpp.fr"); |
|
42 | SqpApplication::setOrganizationDomain("lpp.fr"); | |
33 | SqpApplication::setApplicationName("SciQLop"); |
|
43 | SqpApplication::setApplicationName("SciQLop"); | |
34 | MainWindow w; |
|
44 | MainWindow w; | |
35 | w.show(); |
|
45 | w.show(); | |
36 |
|
46 | |||
|
47 | // Loads plugins | |||
|
48 | auto pluginDir = QDir{sqpApp->applicationDirPath()}; | |||
|
49 | pluginDir.mkdir(PLUGIN_DIRECTORY_NAME); | |||
|
50 | pluginDir.cd(PLUGIN_DIRECTORY_NAME); | |||
|
51 | ||||
|
52 | qCDebug(LOG_PluginManager()) | |||
|
53 | << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath()); | |||
|
54 | ||||
|
55 | PluginManager pluginManager{}; | |||
|
56 | pluginManager.loadPlugins(pluginDir); | |||
|
57 | ||||
37 | return a.exec(); |
|
58 | return a.exec(); | |
38 | } |
|
59 | } |
General Comments 0
You need to be logged in to leave comments.
Login now