Decrease some indentation in linux platform code

This commit is contained in:
Ilya Fedin 2021-01-15 11:10:10 +04:00 committed by John Preston
parent 4348ddf938
commit bad888496c
2 changed files with 18 additions and 12 deletions

View File

@ -420,10 +420,17 @@ bool IsSNIAvailable() {
if (reply.isValid()) {
return reply.value().toBool();
} else if (reply.error().type() != QDBusError::ServiceUnknown) {
LOG(("SNI Error: %1").arg(reply.error().message()));
}
switch (reply.error().type()) {
case QDBusError::Disconnected:
case QDBusError::ServiceUnknown:
return false;
default:
break;
}
LOG(("SNI Error: %1").arg(reply.error().message()));
return false;
}

View File

@ -103,7 +103,7 @@ QStringList ListDBusActivatableNames() {
if (reply.isValid()) {
return reply.value();
} else {
} else if (reply.error().type() != QDBusError::Disconnected) {
LOG(("App Error: %1: %2")
.arg(reply.error().name())
.arg(reply.error().message()));
@ -155,13 +155,12 @@ void PortalAutostart(bool autostart, bool silent = false) {
if (silent) {
QDBusConnection::sessionBus().send(message);
} else {
const QDBusReply<void> reply = QDBusConnection::sessionBus().call(
message);
return;
}
if (!reply.isValid()) {
LOG(("Flatpak autostart error: %1").arg(reply.error().message()));
}
const QDBusError error = QDBusConnection::sessionBus().call(message);
if (error.isValid()) {
LOG(("Flatpak autostart error: %1").arg(error.message()));
}
}
@ -217,11 +216,11 @@ uint FileChooserPortalVersion() {
if (reply.isValid()) {
return reply.value().toUInt();
} else {
LOG(("Error getting FileChooser portal version: %1")
.arg(reply.error().message()));
}
LOG(("Error getting FileChooser portal version: %1")
.arg(reply.error().message()));
return 0;
}();