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
55153d72
Commit
55153d72
authored
Aug 09, 2017
by
nicolas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(Cli): no longer displays the main view when calling cli
parent
f3152119
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
10 deletions
+32
-10
App.cpp
src/app/App.cpp
+15
-7
App.hpp
src/app/App.hpp
+1
-1
Cli.cpp
src/app/cli/Cli.cpp
+9
-1
Cli.hpp
src/app/cli/Cli.hpp
+7
-1
No files found.
src/app/App.cpp
View file @
55153d72
...
...
@@ -141,6 +141,7 @@ inline void activeSplashScreen (QQmlApplicationEngine *engine) {
void
App
::
initContentApp
()
{
shared_ptr
<
linphone
::
Config
>
config
=
::
getConfigIfExists
(
*
mParser
);
bool
mustBeIconified
=
false
;
// Destroy qml components and linphone core if necessary.
if
(
mEngine
)
{
...
...
@@ -168,6 +169,8 @@ void App::initContentApp () {
// Add plugins directory.
addLibraryPath
(
::
Utils
::
coreStringToAppString
(
Paths
::
getPluginsDirPath
()));
qInfo
()
<<
QStringLiteral
(
"Library paths:"
)
<<
libraryPaths
();
mustBeIconified
=
mParser
->
isSet
(
"iconified"
);
}
// Init core.
...
...
@@ -176,8 +179,12 @@ void App::initContentApp () {
// Execute command argument if needed.
if
(
!
mEngine
)
{
const
QString
commandArgument
=
getCommandArgument
();
if
(
!
commandArgument
.
isEmpty
())
mCli
->
executeCommand
(
commandArgument
);
if
(
!
commandArgument
.
isEmpty
())
{
Cli
::
CommandFormat
format
;
mCli
->
executeCommand
(
commandArgument
,
&
format
);
if
(
format
==
Cli
::
UriFormat
)
mustBeIconified
=
true
;
}
}
// Init engine content.
...
...
@@ -212,7 +219,7 @@ void App::initContentApp () {
#ifdef Q_OS_MACOS
::
activeSplashScreen
(
mEngine
);
#else
if
(
!
m
Parser
->
isSet
(
"iconified"
)
)
if
(
!
m
ustBeIconified
)
::
activeSplashScreen
(
mEngine
);
#endif // ifdef Q_OS_MACOS
...
...
@@ -224,8 +231,9 @@ void App::initContentApp () {
QObject
::
connect
(
CoreManager
::
getInstance
()
->
getHandlers
().
get
(),
&
CoreHandlers
::
coreStarted
,
this
,
&
App
::
openAppAfterInit
&
CoreHandlers
::
coreStarted
,
[
this
,
mustBeIconified
]
()
{
openAppAfterInit
(
mustBeIconified
);
}
);
}
...
...
@@ -526,7 +534,7 @@ QString App::getLocale () const {
// -----------------------------------------------------------------------------
void
App
::
openAppAfterInit
()
{
void
App
::
openAppAfterInit
(
bool
mustBeIconified
)
{
qInfo
()
<<
QStringLiteral
(
"Open linphone app."
);
QQuickWindow
*
mainWindow
=
getMainWindow
();
...
...
@@ -538,7 +546,7 @@ void App::openAppAfterInit () {
else
setTrayIcon
();
if
(
!
m
Parser
->
isSet
(
"iconified"
)
)
if
(
!
m
ustBeIconified
)
smartShowWindow
(
mainWindow
);
#else
smartShowWindow
(
mainWindow
);
...
...
src/app/App.hpp
View file @
55153d72
...
...
@@ -119,7 +119,7 @@ private:
return
mAvailableLocales
;
}
void
openAppAfterInit
();
void
openAppAfterInit
(
bool
mustBeIconified
=
false
);
static
void
checkForUpdate
();
...
...
src/app/cli/Cli.cpp
View file @
55153d72
...
...
@@ -189,7 +189,7 @@ void Cli::addCommand (
// -----------------------------------------------------------------------------
void
Cli
::
executeCommand
(
const
QString
&
command
)
const
{
void
Cli
::
executeCommand
(
const
QString
&
command
,
CommandFormat
*
format
)
const
{
shared_ptr
<
linphone
::
Address
>
address
=
linphone
::
Factory
::
get
()
->
createAddress
(
::
Utils
::
appStringToCoreString
(
command
)
);
...
...
@@ -202,10 +202,18 @@ void Cli::executeCommand (const QString &command) const {
mCommands
[
functionName
].
execute
(
args
);
}
if
(
format
)
*
format
=
CliFormat
;
return
;
}
if
(
format
)
*
format
=
UriFormat
;
// Execute uri command.
qInfo
()
<<
QStringLiteral
(
"Execute uri command: `%1`."
).
arg
(
command
);
string
scheme
=
address
->
getScheme
();
if
(
address
->
getUsername
().
empty
()
||
(
scheme
!=
"sip"
&&
scheme
!=
"sip-linphone"
))
{
qWarning
()
<<
QStringLiteral
(
"Not a valid uri: `%1`."
).
arg
(
command
);
...
...
src/app/cli/Cli.hpp
View file @
55153d72
...
...
@@ -77,7 +77,13 @@ public:
Cli
(
QObject
*
parent
=
Q_NULLPTR
);
~
Cli
()
=
default
;
void
executeCommand
(
const
QString
&
command
)
const
;
enum
CommandFormat
{
UnknownFormat
,
CliFormat
,
UriFormat
};
void
executeCommand
(
const
QString
&
command
,
CommandFormat
*
format
=
nullptr
)
const
;
private:
void
addCommand
(
...
...
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