@@ -1,38 +1,59 | |||
|
1 | 1 | /*------------------------------------------------------------------------------ |
|
2 | 2 | -- This file is a part of the QLop Software |
|
3 | 3 | -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS |
|
4 | 4 | -- |
|
5 | 5 | -- This program is free software; you can redistribute it and/or modify |
|
6 | 6 | -- it under the terms of the GNU General Public License as published by |
|
7 | 7 | -- the Free Software Foundation; either version 2 of the License, or |
|
8 | 8 | -- (at your option) any later version. |
|
9 | 9 | -- |
|
10 | 10 | -- This program is distributed in the hope that it will be useful, |
|
11 | 11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 | 12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 | 13 | -- GNU General Public License for more details. |
|
14 | 14 | -- |
|
15 | 15 | -- You should have received a copy of the GNU General Public License |
|
16 | 16 | -- along with this program; if not, write to the Free Software |
|
17 | 17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
18 | 18 | -------------------------------------------------------------------------------*/ |
|
19 | 19 | /*-- Author : Alexis Jeandet |
|
20 | 20 | -- Mail : alexis.jeandet@member.fsf.org |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #include "MainWindow.h" |
|
23 | 23 | #include <QProcessEnvironment> |
|
24 | 24 | #include <QThread> |
|
25 | 25 | #include <SqpApplication.h> |
|
26 | 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 | 38 | int main(int argc, char *argv[]) |
|
29 | 39 | { |
|
30 | 40 | SqpApplication a{argc, argv}; |
|
31 | 41 | SqpApplication::setOrganizationName("LPP"); |
|
32 | 42 | SqpApplication::setOrganizationDomain("lpp.fr"); |
|
33 | 43 | SqpApplication::setApplicationName("SciQLop"); |
|
34 | 44 | MainWindow w; |
|
35 | 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 | 58 | return a.exec(); |
|
38 | 59 | } |
General Comments 0
You need to be logged in to leave comments.
Login now