Minor improvements at startup

Found due to expiry date
This commit is contained in:
Klaus Basan
2017-01-01 04:37:29 +01:00
committed by Mathew Sutcliffe
parent 683cffd42b
commit 2821cd5213
6 changed files with 15 additions and 6 deletions

View File

@@ -873,14 +873,15 @@ namespace BlackCore
// help/version
if (this->m_parser.isSet(this->m_cmdHelp))
{
// Important parser help will already stop application
// Important: parser help will already stop application
this->cmdLineHelpMessage();
return true;
return false;
}
if (this->m_parser.isSet(this->m_cmdVersion))
{
// Important: version will already stop application
this->cmdLineVersionMessage();
return true;
return false;
}
// dev.

View File

@@ -244,6 +244,7 @@ namespace BlackCore
//! Parses and handles the standard options such as help, version, parse error
//! \note in some cases (error, version, help) application is terminated during this step
//! \sa parsingHookIn
//! \return true means to continue, false to stop
bool parse();
//! @}

View File

@@ -50,6 +50,7 @@ int main(int argc, char *argv[])
if (!QSystemTrayIcon::isSystemTrayAvailable())
{
a.cmdLineErrorMessage("I could not detect any system tray on this system.");
a.gracefulShutdown();
return EXIT_FAILURE;
}

View File

@@ -29,9 +29,13 @@ int main(int argc, char *argv[])
CGuiApplication a("swift mapping tool", CApplicationInfo::MappingTool, CIcons::swiftDatabase48());
a.setSignalStartupAutomatically(false); // application will signal startup on its own
a.splashScreen(CIcons::swiftDatabase256());
a.parse();
if (!a.parse()) { return EXIT_FAILURE; }
a.useWebDataServices(BlackCore::CWebReaderFlags::AllSwiftDbReaders, CDatabaseReaderConfigList::forMappingTool());
if (!a.start()) { return EXIT_FAILURE; }
if (!a.start())
{
a.gracefulShutdown();
return EXIT_FAILURE;
}
CSwiftData w;
w.show();
int r = a.exec();

View File

@@ -24,9 +24,11 @@ int main(int argc, char *argv[])
//! [SwiftApplicationDemo]
CGuiApplication::highDpiScreenSupport();
QApplication qa(argc, argv);
Q_UNUSED(qa); // application init needed
CSwiftGuiStdApplication a;
a.setSignalStartupAutomatically(false); // application will signal startup on its own
a.splashScreen(CIcons::swift256());
if (!a.parse()) { return EXIT_FAILURE; }
if (!a.start())
{
a.gracefulShutdown();

View File

@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
CGuiApplication a("swift launcher", CApplicationInfo::Laucher, CIcons::swiftLauncher1024());
a.useWebDataServices(BlackCore::CWebReaderFlags::AllSwiftDbReaders, CDatabaseReaderConfigList::forLauncher());
a.addParserOption({{"i", "installer"}, QCoreApplication::translate("main", "Installer setup."), "installer"});
a.parse();
if (!a.parse()) { return EXIT_FAILURE; }
if (!a.start()) { return EXIT_FAILURE; }
//! [SwiftApplicationDemo]