mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 16:29:44 -05:00
Reorder startup sequence to display debug information early
This commit is contained in:
parent
80809ace67
commit
ed0ece304d
33
src/main.cpp
33
src/main.cpp
@ -96,6 +96,14 @@ int main(int argc, char** argv)
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show debug information and then exit
|
||||||
|
if (parser.isSet(debugInfoOption)) {
|
||||||
|
QTextStream out(stdout, QIODevice::WriteOnly);
|
||||||
|
QString debugInfo = Tools::debugInfo().append("\n").append(Crypto::debugInfo());
|
||||||
|
out << debugInfo << endl;
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
// Process config file options early
|
// Process config file options early
|
||||||
if (parser.isSet(configOption) || parser.isSet(localConfigOption)) {
|
if (parser.isSet(configOption) || parser.isSet(localConfigOption)) {
|
||||||
Config::createConfigFromFile(parser.value(configOption), parser.value(localConfigOption));
|
Config::createConfigFromFile(parser.value(configOption), parser.value(localConfigOption));
|
||||||
@ -111,15 +119,6 @@ int main(int argc, char** argv)
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the configured theme before creating any GUI elements
|
|
||||||
app.applyTheme();
|
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
|
||||||
QGuiApplication::setDesktopFileName(app.property("KPXC_QUALIFIED_APPNAME").toString() + QStringLiteral(".desktop"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Application::bootstrap();
|
|
||||||
|
|
||||||
if (!Crypto::init()) {
|
if (!Crypto::init()) {
|
||||||
QString error = QObject::tr("Fatal error while testing the cryptographic functions.");
|
QString error = QObject::tr("Fatal error while testing the cryptographic functions.");
|
||||||
error.append("\n");
|
error.append("\n");
|
||||||
@ -128,14 +127,14 @@ int main(int argc, char** argv)
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Displaying the debugging informations must be done after Crypto::init,
|
// Apply the configured theme before creating any GUI elements
|
||||||
// to make sure we know which libgcrypt version is used.
|
app.applyTheme();
|
||||||
if (parser.isSet(debugInfoOption)) {
|
|
||||||
QTextStream out(stdout, QIODevice::WriteOnly);
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
QString debugInfo = Tools::debugInfo().append("\n").append(Crypto::debugInfo());
|
QGuiApplication::setDesktopFileName(app.property("KPXC_QUALIFIED_APPNAME").toString() + QStringLiteral(".desktop"));
|
||||||
out << debugInfo << endl;
|
#endif
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
Application::bootstrap();
|
||||||
|
|
||||||
MainWindow mainWindow;
|
MainWindow mainWindow;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user