Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akonadi Console
Commits
1a814125
Commit
1a814125
authored
Aug 02, 2022
by
Laurent Montel
Browse files
Use QCommandLineOption directly => avoid potential bug with QString value
parent
ee6df9ce
Pipeline
#212021
passed with stage
in 1 minute and 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main.cpp
View file @
1a814125
...
...
@@ -52,9 +52,10 @@ int main(int argc, char **argv)
KCrash
::
initialize
();
QCommandLineParser
parser
;
aboutData
.
setupCommandLine
(
&
parser
);
parser
.
addOption
(
QCommandLineOption
(
QStringList
()
<<
QStringLiteral
(
"remote"
),
QStringLiteral
(
"Connect to an Akonadi remote debugging server"
),
QStringLiteral
(
"server"
)));
const
QCommandLineOption
remoteOption
=
QCommandLineOption
(
QStringList
()
<<
QStringLiteral
(
"remote"
),
QStringLiteral
(
"Connect to an Akonadi remote debugging server"
),
QStringLiteral
(
"server"
));
parser
.
addOption
(
remoteOption
);
parser
.
process
(
app
);
aboutData
.
processCommandLine
(
&
parser
);
...
...
@@ -65,14 +66,14 @@ int main(int argc, char **argv)
qDBusRegisterMetaType
<
QVector
<
qint64
>>
();
qDBusRegisterMetaType
<
QVector
<
QByteArray
>>
();
if
(
parser
.
isSet
(
QStringLiteral
(
"remote"
)
))
{
if
(
parser
.
isSet
(
remoteOption
))
{
const
QString
akonadiAddr
=
QStringLiteral
(
"tcp:host=%1,port=31415"
).
arg
(
parser
.
value
(
QStringLiteral
(
"remote"
)));
const
QString
dbusAddr
=
QStringLiteral
(
"tcp:host=%1,port=31416"
).
arg
(
parser
.
value
(
QStringLiteral
(
"remote"
)));
qputenv
(
"AKONADI_SERVER_ADDRESS"
,
akonadiAddr
.
toLatin1
());
qputenv
(
"DBUS_SESSION_BUS_ADDRESS"
,
dbusAddr
.
toLatin1
());
}
InstanceSelector
instanceSelector
(
parser
.
isSet
(
QStringLiteral
(
"remote"
))
?
parser
.
value
(
QStringLiteral
(
"remote"
)
)
:
QString
());
InstanceSelector
instanceSelector
(
parser
.
isSet
(
remoteOption
)
?
parser
.
value
(
remoteOption
)
:
QString
());
return
app
.
exec
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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