amnezia-client/service/server/main.cpp
Mortie 8c20a67cfa migrated the codebase to Qt6 and fixed some compatibility issues
* used a Qt6 ported version of SortFilterProxyModel
* used an updated Qt6 compatible version of QXZing
* added a flag to windows linker to avoid WinMain problem of MSVCRTD
* renamed utils.cpp to utilities.cpp for avoiding confusion with the same file name in SortFilterProxyModel
2022-08-29 12:21:09 +04:30

39 lines
719 B
C++

#include <QDir>
#include "defines.h"
#include "localserver.h"
#include "log.h"
#include "systemservice.h"
#include "utilities.h"
int runApplication(int argc, char** argv)
{
QCoreApplication app(argc,argv);
LocalServer localServer;
return app.exec();
}
int main(int argc, char **argv)
{
Utils::initializePath(Utils::systemLogPath());
Log::init();
if (argc == 2) {
qInfo() << "Started as console application";
return runApplication(argc, argv);
}
else {
qInfo() << "Started as system service";
#ifdef Q_OS_WIN
SystemService systemService(argc, argv);
return systemService.exec();
#else
return runApplication(argc, argv);
#endif
}
}