pmaports/main/ofono-qt/07-simplify_code_logic.patch
Bhushan Shah ff29f3a7db aports/main: Introduce ofono-qt aport (#1512)
This is basically too old stuff from meego times, and is added only
because telepathy-ofono needs it for now, I will talk with ubports
people to get telepathy-ofono ported to libqofono so we can dump this 6
year old unmaintained library.

(patches to make it build with qt5 and modern compiler are taken from
ubuntu packaging)
2018-06-01 21:19:43 +02:00

93 lines
2.8 KiB
Diff

Description: Simplify code logic
Author: Tiago Salem Herrmann <tiago.herrmann@canonical.com>
Forwarded: no
diff:
=== modified file 'a/lib/ofonoconnman.cpp'
--- a/lib/ofonoconnman.cpp 2013-05-14 16:19:47 +0000
+++ b/lib/ofonoconnman.cpp 2013-05-14 21:43:39 +0000
@@ -150,7 +150,6 @@
{
QDBusMessage request;
QDBusReply<QDBusObjectPath> reply;
- QDBusObjectPath objpath;
request = QDBusMessage::createMethodCall("org.ofono",
path(), m_if->ifname(),
@@ -161,14 +160,11 @@
request.setArguments(arg);
reply = QDBusConnection::systemBus().call(request);
- if (reply.isValid()) {
- objpath = reply;
- success = true;
- } else {
+ success = reply.isValid();
+ if (!success) {
m_if->setError(reply.error().name(), reply.error().message());
- success = false;
}
- return objpath;
+ return reply;
}
void OfonoConnMan::addContextResp(const QDBusObjectPath &path)
=== modified file 'a/lib/ofonomessagemanager.cpp'
--- a/lib/ofonomessagemanager.cpp 2013-05-13 18:02:33 +0000
+++ b/lib/ofonomessagemanager.cpp 2013-05-14 21:43:39 +0000
@@ -179,21 +179,17 @@
{
QDBusMessage request;
QDBusReply<QDBusObjectPath> reply;
- QDBusObjectPath objpath;
request = QDBusMessage::createMethodCall("org.ofono",
path(), m_if->ifname(),
"SendMessage");
request << to << message;
reply = QDBusConnection::systemBus().call(request);
- if (reply.isValid()) {
- objpath = reply;
- success = true;
- } else {
+ success = reply.isValid();
+ if (!success) {
m_if->setError(reply.error().name(), reply.error().message());
- success = false;
}
- return objpath;
+ return reply;
}
void OfonoMessageManager::requestPropertyComplete(bool success, const QString& property, const QVariant& value)
=== modified file 'a/lib/ofonovoicecallmanager.cpp'
--- a/lib/ofonovoicecallmanager.cpp 2013-05-13 18:02:33 +0000
+++ b/lib/ofonovoicecallmanager.cpp 2013-05-14 21:43:39 +0000
@@ -143,7 +143,6 @@
{
QDBusMessage request;
QDBusReply<QDBusObjectPath> reply;
- QDBusObjectPath objpath;
request = QDBusMessage::createMethodCall("org.ofono",
path(), m_if->ifname(),
"Dial");
@@ -153,14 +152,11 @@
request.setArguments(arg);
reply = QDBusConnection::systemBus().call(request);
- if (reply.isValid()) {
- objpath = reply;
- success = true;
- } else {
+ success = reply.isValid();
+ if (!success) {
m_if->setError(reply.error().name(), reply.error().message());
- success = false;
}
- return objpath;
+ return reply;
}
void OfonoVoiceCallManager::hangupAll()