Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Nate Graham
Kid3
Commits
e14269ab
Commit
e14269ab
authored
Aug 23, 2019
by
Urs Fleisch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build with Qt 5.5.
parent
90721580
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
src/app/cli/jsoncliformatter.cpp
src/app/cli/jsoncliformatter.cpp
+5
-0
src/app/cli/kid3cli.cpp
src/app/cli/kid3cli.cpp
+8
-0
src/app/cli/textcliformatter.cpp
src/app/cli/textcliformatter.cpp
+5
-0
No files found.
src/app/cli/jsoncliformatter.cpp
View file @
e14269ab
...
...
@@ -184,8 +184,13 @@ void JsonCliFormatter::writeError(CliError errorCode)
{
QString
msg
;
if
(
errorCode
==
CliError
::
MethodNotFound
)
{
#if QT_VERSION >= 0x050600
msg
=
tr
(
"Unknown command '%1'"
)
.
arg
(
m_args
.
isEmpty
()
?
QLatin1String
(
""
)
:
m_args
.
constFirst
());
#else
msg
=
tr
(
"Unknown command '%1'"
)
.
arg
(
m_args
.
isEmpty
()
?
QLatin1String
(
""
)
:
m_args
.
first
());
#endif
}
writeErrorMessage
(
msg
,
jsonRpcErrorCode
(
errorCode
));
}
...
...
src/app/cli/kid3cli.cpp
View file @
e14269ab
...
...
@@ -180,7 +180,11 @@ Kid3Cli::Kid3Cli(Kid3Application* app,
{
m_formatters
<<
new
JsonCliFormatter
(
io
)
<<
new
TextCliFormatter
(
io
);
#if QT_VERSION >= 0x050600
m_formatter
=
m_formatters
.
constLast
();
#else
m_formatter
=
m_formatters
.
last
();
#endif
m_cmds
<<
new
HelpCommand
(
this
)
<<
new
TimeoutCommand
(
this
)
...
...
@@ -244,7 +248,11 @@ CliCommand* Kid3Cli::commandForArgs(const QString& line)
return
nullptr
;
// Default to the last formatter
#if QT_VERSION >= 0x050600
m_formatter
=
m_formatters
.
constLast
();
#else
m_formatter
=
m_formatters
.
last
();
#endif
QStringList
args
;
for
(
auto
fmt
:
m_formatters
)
{
...
...
src/app/cli/textcliformatter.cpp
View file @
e14269ab
...
...
@@ -177,8 +177,13 @@ void TextCliFormatter::writeError(CliError errorCode)
QString
errorMsg
;
switch
(
errorCode
)
{
case
CliError
::
MethodNotFound
:
#if QT_VERSION >= 0x050600
errorMsg
=
tr
(
"Unknown command '%1'. Type 'help' for help."
)
.
arg
(
m_args
.
isEmpty
()
?
QLatin1String
(
""
)
:
m_args
.
constFirst
());
#else
errorMsg
=
tr
(
"Unknown command '%1'. Type 'help' for help."
)
.
arg
(
m_args
.
isEmpty
()
?
QLatin1String
(
""
)
:
m_args
.
first
());
#endif
break
;
default:
;
...
...
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