Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
d016f481
Commit
d016f481
authored
Jun 14, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/app/App): do not parse args twice
parent
42a84298
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
App.cpp
linphone-desktop/src/app/App.cpp
+4
-5
App.hpp
linphone-desktop/src/app/App.hpp
+1
-1
No files found.
linphone-desktop/src/app/App.cpp
View file @
d016f481
...
@@ -73,7 +73,8 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
...
@@ -73,7 +73,8 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
setApplicationVersion
(
LINPHONE_QT_GIT_VERSION
);
setApplicationVersion
(
LINPHONE_QT_GIT_VERSION
);
setWindowIcon
(
QIcon
(
WINDOW_ICON_PATH
));
setWindowIcon
(
QIcon
(
WINDOW_ICON_PATH
));
parseArgs
();
createParser
();
mParser
->
process
(
*
this
);
// Initialize logger. (Do not do this before this point because the
// 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
// 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) {
...
@@ -91,7 +92,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
initLocale
();
initLocale
();
if
(
mParser
->
isSet
(
"help"
))
{
if
(
mParser
->
isSet
(
"help"
))
{
parseArgs
();
createParser
();
mParser
->
showHelp
();
mParser
->
showHelp
();
}
}
...
@@ -272,7 +273,7 @@ bool App::hasFocus () const {
...
@@ -272,7 +273,7 @@ bool App::hasFocus () const {
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void
App
::
parseArgs
()
{
void
App
::
createParser
()
{
if
(
mParser
)
if
(
mParser
)
delete
mParser
;
delete
mParser
;
...
@@ -290,8 +291,6 @@ void App::parseArgs () {
...
@@ -290,8 +291,6 @@ void App::parseArgs () {
{
{
"V"
,
"verbose"
},
tr
(
"commandLineOptionVerbose"
)
},
{
{
"V"
,
"verbose"
},
tr
(
"commandLineOptionVerbose"
)
},
{
{
"c"
,
"cmd"
},
tr
(
"commandLineOptionCmd"
),
tr
(
"commandLineOptionCmdArg"
)
}
{
{
"c"
,
"cmd"
},
tr
(
"commandLineOptionCmd"
),
tr
(
"commandLineOptionCmdArg"
)
}
});
});
mParser
->
process
(
*
this
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
linphone-desktop/src/app/App.hpp
View file @
d016f481
...
@@ -87,7 +87,7 @@ signals:
...
@@ -87,7 +87,7 @@ signals:
void
configLocaleChanged
(
const
QString
&
locale
);
void
configLocaleChanged
(
const
QString
&
locale
);
private:
private:
void
parseArgs
();
void
createParser
();
void
registerTypes
();
void
registerTypes
();
void
registerSharedTypes
();
void
registerSharedTypes
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment