4 #include <QApplication>
5 #include <QCommandLineParser>
30 if (!ts.isValid() || ts < QDateTime::currentDateTimeUtc().addYears(-2))
36 int main(
int argc,
char *argv[])
39 QApplication qa(argc, argv);
41 CGuiApplication a(CApplicationInfo::swiftLauncher(), CApplicationInfo::Launcher, CIcons::swiftLauncher1024());
44 const QCommandLineOption installerOption { {
"i",
"installer" },
45 QCoreApplication::translate(
"main",
"Installer setup.") };
49 CDatabaseReaderConfigList::forLauncher());
52 if (installMode) initDbCacheFromResourceFileIfRequired(a);
62 const int res = a.
exec();
63 if (res != EXIT_SUCCESS || !launcher.shouldStartAppDetached()) {
return res; }
65 const bool s = launcher.startDetached();
66 return s ? EXIT_SUCCESS : EXIT_FAILURE;
swift::misc::CStatusMessageList startCoreFacadeWithoutContexts()
Starts the core facade without any contexts.
void addNetworkOptions()
Add the network options.
bool isParserOptionSet(const QString &option) const
Delegates to QCommandLineParser::isSet.
swift::misc::CStatusMessageList initAndStartWebDataServices(CWebReaderFlags::WebReader webReader, const db::CDatabaseReaderConfigList &dbReaderConfig)
Init web data services and start them.
bool parseCommandLineArgsAndLoadSetup()
Combined function that does a startup check, parses the command line arguments and loads the setup.
void addDBusAddressOption()
CMD line argument for DBus address.
bool hasWebDataServices() const
Web data services available?
bool addParserOption(const QCommandLineOption &option)
virtual bool start()
Start services, if not yet parsed call CApplication::parse.
CWebDataServices * getWebDataServices() const
Get the web data services.
int exec()
Finishes initialization and executes the event loop.
Encapsulates reading data from web sources.
QDateTime getLatestDbEntityCacheTimestamp() const
Latest DB object timestamp, or null if there is no such timestamp.
swift::misc::CStatusMessageList initDbCachesFromLocalResourceFiles(bool inBackground)
Init caches from local DB files.
@ AllSwiftDbReaders
all swift data
GUI application, a specialized version of swift::core::CApplication for GUI applications.
static QString scaleFactor(int argc, char *argv[])
Get the scale factor.
void gracefulShutdown()
Graceful shutdown.
static void highDpiScreenSupport(const QString &scaleFactor={})
Support for high DPI screens.
Classes interacting with the swift database (aka "datastore").
Backend services of the swift project, like dealing with the network or the simulators.
Free functions in swift::misc.
int main(int argc, char *argv[])
main