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()) { if (reply.isValid()) {
return reply.value().toBool(); 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; return false;
} }

View File

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