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
Network
KDE Connect
Commits
a1ebbdfc
Commit
a1ebbdfc
authored
Oct 08, 2020
by
Simon Redman
Committed by
Nicolas Fella
Oct 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLI] Use ConversationsDbusInterface to avoid problems with using raw dbus
parent
be63cea8
Pipeline
#37228
passed with stage
in 9 minutes and 10 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
cli/kdeconnect-cli.cpp
cli/kdeconnect-cli.cpp
+13
-5
No files found.
cli/kdeconnect-cli.cpp
View file @
a1ebbdfc
...
...
@@ -259,12 +259,20 @@ int main(int argc, char** argv)
addresses
<<
QVariant
::
fromValue
(
address
);
}
const
QString
List
urlList
=
parser
.
value
(
QStringLiteral
(
"
attachment"
)).
split
(
QRegularExpression
(
QStringLiteral
(
"
\\
s+"
)
));
const
QString
message
=
parser
.
value
(
QStringLiteral
(
"
send-sms"
));
QDBusMessage
msg
=
QDBusMessage
::
createMethodCall
(
QStringLiteral
(
"org.kde.kdeconnect"
),
QStringLiteral
(
"/modules/kdeconnect/devices/"
)
+
device
+
QStringLiteral
(
"/sms"
),
QStringLiteral
(
"org.kde.kdeconnect.device.sms"
),
QStringLiteral
(
"sendSms"
));
const
QString
text
=
parser
.
value
(
QStringLiteral
(
"send-sms"
));
msg
.
setArguments
(
QVariantList
()
<<
QVariant
::
fromValue
(
addresses
)
<<
text
<<
QVariant
(
urlList
));
blockOnReply
(
DBusHelper
::
sessionBus
().
asyncCall
(
msg
));
const
QStringList
rawAttachmentUrlsList
=
parser
.
value
(
QStringLiteral
(
"attachment"
)).
split
(
QRegularExpression
(
QStringLiteral
(
"
\\
s+"
)));
QVariantList
attachments
;
for
(
const
QString
&
attachmentUrl
:
rawAttachmentUrlsList
)
{
// TODO: Construct attachment objects from the list of Urls
Q_UNUSED
(
attachmentUrl
);
}
DeviceConversationsDbusInterface
conversationDbusInterface
(
device
);
auto
reply
=
conversationDbusInterface
.
sendWithoutConversation
(
addresses
,
message
,
attachments
);
reply
.
waitForFinished
();
}
else
{
QTextStream
(
stderr
)
<<
i18n
(
"error: should specify the SMS's recipient by passing --destination <phone number>"
);
return
1
;
...
...
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