X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;ds=inline;f=src%2Fmain%2FCLI%2Fmain.cpp;h=c795bbaa9603390a4ecb75b285e61a14e7f0debf;hb=de270ece1b764b19968e14420f538321f1c06b15;hp=3c1ec3b2e032a4608d56c4314d79a411f9c1c160;hpb=2ab8cd3d68a55773240c9424aa0e14d678fd2dbb;p=evaf
diff --git a/src/main/CLI/main.cpp b/src/main/CLI/main.cpp
index 3c1ec3b..c795bba 100644
--- a/src/main/CLI/main.cpp
+++ b/src/main/CLI/main.cpp
@@ -23,7 +23,6 @@
#include
#include
-#include
#include
#include
@@ -50,7 +49,7 @@ namespace Internal {
*
* This function outputs messages to the console and to the log file.
*/
-static void messageOutput(QtMsgType type, char const * const msg)
+static void messageOutput(QtMsgType type, QMessageLogContext const &, QString const & msg)
{
static bool inHandler = false;
@@ -93,13 +92,12 @@ static void messageOutput(QtMsgType type, char const * const msg)
* If the critical error message is shown, then the user has an option to ignore the error. In this
* case the application is not terminated.
*/
-static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where)
+[[noreturn]] static void fatalMsgHandler(QString const & msg, QString const & source, QString const & where)
{
-#ifdef Q_OS_LINUX
- abort();
-#else
+ Q_UNUSED(msg);
+ Q_UNUSED(source);
+ Q_UNUSED(where);
exit(1);
-#endif
}
} // namespace eVaf::CLI::Internal
@@ -179,7 +177,7 @@ bool Application::processCommandLine(int argc, char ** argv)
case Common::iLogger::Info:
consoleSeverityLevel = Common::iLogger::Debug;
break;
- case Common::iLogger::Debug:
+ default:
break;
}
}
@@ -209,7 +207,6 @@ void Application::printHelp()
" -lang[uage]=xx[_CC] Specifies the language, where xx is the ISO 639\n"
" language code followed by an optional ISO 3166 country\n"
" code.\n"
- // Handled by the iEnv interface implementation
" -root[dir]=DIR Specifies the application's root directory.\n"
" -dataroot[dir]=DIR Specifies the data root directory.\n"
" -etc[dir]=DIR Specifies the configuration files directory.\n"
@@ -240,7 +237,7 @@ int main(int argc, char ** argv)
// Install our onw message handlers
Common::iLogger::instance()->installFatalMsgHandler(Internal::fatalMsgHandler);
- qInstallMsgHandler(Internal::messageOutput);
+ qInstallMessageHandler(Internal::messageOutput);
// Process command-line arguments
if (!Application::processCommandLine(argc, argv))
@@ -283,7 +280,7 @@ int main(int argc, char ** argv)
// Run the application
EVAF_INFO("Running %s", VER_MODULE_NAME_STR);
- rval = app.exec();
+ rval = Common::iApp::instance()->exec();
quit = rval != Common::iApp::RC_Restart;