Main.cpp (ssr-0.4.0) | : | Main.cpp (ssr-0.4.1) | ||
---|---|---|---|---|
skipping to change at line 90 | skipping to change at line 90 | |||
command_line_options.Parse(); | command_line_options.Parse(); | |||
} catch(const CommandLineException&) { | } catch(const CommandLineException&) { | |||
return 1; | return 1; | |||
} | } | |||
// do we need to continue? | // do we need to continue? | |||
if(!CommandLineOptions::GetBenchmark() && !CommandLineOptions::GetGui()) { | if(!CommandLineOptions::GetBenchmark() && !CommandLineOptions::GetGui()) { | |||
return 0; | return 0; | |||
} | } | |||
// redirect stdout and stderr to a log file | // open the log file | |||
if(!CommandLineOptions::GetLogFile().isEmpty()) { | if(!CommandLineOptions::GetLogFile().isEmpty()) { | |||
FILE *f = fopen(CommandLineOptions::GetLogFile().toLocal8Bit().co | logger.SetLogFile(CommandLineOptions::GetLogFile()); | |||
nstData(), "a"); | ||||
dup2(fileno(f), 1); // redirect stdout | ||||
dup2(fileno(f), 2); // redirect stderr | ||||
} | } | |||
// start logging | // start main program | |||
Logger::LogInfo("==================== " + Logger::tr("SSR started") + " = ==================="); | Logger::LogInfo("==================== " + Logger::tr("SSR started") + " = ==================="); | |||
Logger::LogInfo(GetVersionInfo()); | Logger::LogInfo(GetVersionInfo()); | |||
#if SSR_USE_X86_ASM | #if SSR_USE_X86_ASM | |||
// detect CPU features | // detect CPU features | |||
CPUFeatures::Detect(); | CPUFeatures::Detect(); | |||
#endif | #endif | |||
// load icons | // load icons | |||
LoadIcons(); | LoadIcons(); | |||
skipping to change at line 128 | skipping to change at line 126 | |||
Q_UNUSED(hotkey_listener); | Q_UNUSED(hotkey_listener); | |||
// create main window | // create main window | |||
MainWindow mainwindow; | MainWindow mainwindow; | |||
// run application | // run application | |||
ret = application.exec(); | ret = application.exec(); | |||
} | } | |||
// stop logging | // stop main program | |||
Logger::LogInfo("==================== " + Logger::tr("SSR stopped") + " = ==================="); | Logger::LogInfo("==================== " + Logger::tr("SSR stopped") + " = ==================="); | |||
return ret; | return ret; | |||
} | } | |||
End of changes. 4 change blocks. | ||||
7 lines changed or deleted | 4 lines changed or added |