mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
feat(src/app/App): do not parse args twice
This commit is contained in:
parent
42a84298d5
commit
d016f4812a
2 changed files with 5 additions and 6 deletions
|
|
@ -73,7 +73,8 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
|
|||
setApplicationVersion(LINPHONE_QT_GIT_VERSION);
|
||||
setWindowIcon(QIcon(WINDOW_ICON_PATH));
|
||||
|
||||
parseArgs();
|
||||
createParser();
|
||||
mParser->process(*this);
|
||||
|
||||
// Initialize logger. (Do not do this before this point because the
|
||||
// application has to be created for the logs to be put in the correct
|
||||
|
|
@ -91,7 +92,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
|
|||
initLocale();
|
||||
|
||||
if (mParser->isSet("help")) {
|
||||
parseArgs();
|
||||
createParser();
|
||||
mParser->showHelp();
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +273,7 @@ bool App::hasFocus () const {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void App::parseArgs () {
|
||||
void App::createParser () {
|
||||
if (mParser)
|
||||
delete mParser;
|
||||
|
||||
|
|
@ -290,8 +291,6 @@ void App::parseArgs () {
|
|||
{ { "V", "verbose" }, tr("commandLineOptionVerbose") },
|
||||
{ { "c", "cmd" }, tr("commandLineOptionCmd"), tr("commandLineOptionCmdArg") }
|
||||
});
|
||||
|
||||
mParser->process(*this);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ signals:
|
|||
void configLocaleChanged (const QString &locale);
|
||||
|
||||
private:
|
||||
void parseArgs ();
|
||||
void createParser ();
|
||||
|
||||
void registerTypes ();
|
||||
void registerSharedTypes ();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue