forked from alphaonex86/Ultracopier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
executable file
·55 lines (49 loc) · 1.84 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/** \file main.cpp
\brief Define the main() for the point entry
\author alpha_one_x86
\licence GPL3, see the file COPYING */
#include <QApplication>
#include <QtPlugin>
#include "Environment.h"
#include "EventDispatcher.h"
#include "LanguagesManager.h"
#include "ThemesManager.h"
#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE
Q_IMPORT_PLUGIN(CopyEngineFactory)
Q_IMPORT_PLUGIN(ThemesFactory)
Q_IMPORT_PLUGIN(Listener)
#ifdef Q_OS_WIN32
Q_IMPORT_PLUGIN(WindowsExplorerLoader)
#if !defined(ULTRACOPIER_VERSION_PORTABLE)
Q_IMPORT_PLUGIN(WindowsSessionLoader)
#endif
#endif
#endif
DebugModel DebugModel::debugModel;
DebugEngine DebugEngine::debugEngine;
ResourcesManager ResourcesManager::resourcesManager;
OptionEngine OptionEngine::optionEngine;
PluginsManager PluginsManager::pluginsManager;
LanguagesManager LanguagesManager::languagesManager;
ThemesManager ThemesManager::themesManager;
/// \brief Define the main() for the point entry
int main(int argc, char *argv[])
{
int returnCode;
QApplication ultracopierApplication(argc, argv);
ultracopierApplication.setApplicationVersion(ULTRACOPIER_VERSION);
ultracopierApplication.setQuitOnLastWindowClosed(false);
qRegisterMetaType<PluginsAvailable>("PluginsAvailable");
qRegisterMetaType<Ultracopier::DebugLevel>("Ultracopier::DebugLevel");
qRegisterMetaType<Ultracopier::CopyMode>("Ultracopier::CopyMode");
qRegisterMetaType<Ultracopier::ItemOfCopyList>("Ultracopier::ItemOfCopyList");
//the main code, event loop of Qt and event dispatcher of ultracopier
{
EventDispatcher backgroundRunningInstance;
if(backgroundRunningInstance.shouldBeClosed())
returnCode=0;
else
returnCode=ultracopierApplication.exec();
}
return returnCode;
}