src: Fixed command order at startup
This commit is contained in:
+11
-9
@@ -32,13 +32,6 @@ void init()
|
||||
LogManager::getInstance()->addLogger(fileLogger);
|
||||
}
|
||||
|
||||
void prepare(int argc, char *argv[])
|
||||
{
|
||||
setup(argc, argv);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication::setApplicationName("Coati");
|
||||
@@ -54,9 +47,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (commandLineParser.runWithoutGUI())
|
||||
{
|
||||
setupPlatform(argc, argv);
|
||||
init();
|
||||
|
||||
// headless Coati
|
||||
QtCoreApplication qtApp(argc, argv);
|
||||
prepare(argc,argv);
|
||||
|
||||
setupApp(argc, argv);
|
||||
|
||||
std::shared_ptr<Application> app = Application::create( version );
|
||||
|
||||
@@ -72,8 +69,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
setupPlatform(argc, argv);
|
||||
init();
|
||||
|
||||
QtApplication qtApp(argc, argv);
|
||||
prepare(argc,argv);
|
||||
|
||||
setupApp(argc, argv);
|
||||
|
||||
qtApp.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
QtViewFactory viewFactory;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef INCLUDES_H
|
||||
#define INCLUDES_H
|
||||
|
||||
void setup(int argc, char *argv[]);
|
||||
void setupPlatform(int argc, char *argv[]);
|
||||
void setupApp(int argc, char *argv[]);
|
||||
|
||||
// platform specific include
|
||||
#include "platform_includes/@PLATFORM_INCLUDE@"
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
#include "utility/file/FileSystem.h"
|
||||
#include "isTrial.h"
|
||||
|
||||
void setup(int argc, char *argv[])
|
||||
void setupPlatform(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
|
||||
void setupApp(int argc, char *argv[])
|
||||
{
|
||||
if (AppPath::getAppPath().empty())
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "utility/UserPaths.h"
|
||||
|
||||
void setup(int argc, char *argv[])
|
||||
void setupPlatform(int argc, char *argv[])
|
||||
{
|
||||
// ----------------------------------------------------------------------------
|
||||
// This makes relative paths work in C++ in Xcode by changing directory to the Resources folder inside the .app bundle
|
||||
@@ -65,4 +65,8 @@ void setup(int argc, char *argv[])
|
||||
// ----------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
void setupApp(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
|
||||
#endif // INCLUDES_MAC_H
|
||||
|
||||
@@ -10,7 +10,11 @@
|
||||
|
||||
#include "platform_includes/deploy.h"
|
||||
|
||||
void setup(int argc, char *argv[])
|
||||
void setupPlatform(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
|
||||
void setupApp(int argc, char *argv[])
|
||||
{
|
||||
#ifdef DEPLOY
|
||||
std::string path = std::getenv("APPDATA");
|
||||
|
||||
+5
-4
@@ -26,8 +26,6 @@ void init()
|
||||
fileLogger->setLogLevel(Logger::LOG_ALL);
|
||||
FileLogger::setFilePath(UserPaths::getLogPath());
|
||||
LogManager::getInstance()->addLogger(fileLogger);
|
||||
|
||||
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -37,13 +35,16 @@ int main(int argc, char *argv[])
|
||||
Version version = Version::fromString(GIT_VERSION_NUMBER);
|
||||
QApplication::setApplicationVersion(version.toDisplayString().c_str());
|
||||
|
||||
setupPlatform(argc, argv);
|
||||
init();
|
||||
|
||||
QtApplication qtApp(argc, argv);
|
||||
|
||||
setup(argc, argv);
|
||||
setupApp(argc, argv);
|
||||
|
||||
qtApp.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
|
||||
init();
|
||||
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf");
|
||||
|
||||
QtViewFactory viewFactory;
|
||||
QtNetworkFactory networkFactory;
|
||||
|
||||
Reference in New Issue
Block a user