From 10b169f9f6a43557f04fd0f61a1c93d7b813faa8 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 1 Jun 2020 14:22:22 +0400 Subject: [PATCH] Make not supported errors static --- .../platform/linux/notifications_manager_linux.cpp | 4 ++-- Telegram/SourceFiles/platform/linux/specific_linux.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index e383cc99ed..f169bf2f49 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -148,14 +148,14 @@ bool Inhibited() { const QDBusReply reply = QDBusConnection::sessionBus().call( message); - const auto notSupportedErrors = { + static const auto NotSupportedErrors = { QDBusError::ServiceUnknown, QDBusError::InvalidArgs, }; if (reply.isValid()) { return reply.value().toBool(); - } else if (ranges::contains(notSupportedErrors, reply.error().type())) { + } else if (ranges::contains(NotSupportedErrors, reply.error().type())) { InhibitedNotSupported = true; } else { if (reply.error().type() == QDBusError::AccessDenied) { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 001d657ef8..946c0693a5 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -488,22 +488,22 @@ std::optional LastUserInputTime() { const QDBusReply reply = QDBusConnection::sessionBus().call( Message); - const auto notSupportedErrors = { + static const auto NotSupportedErrors = { QDBusError::ServiceUnknown, QDBusError::NotSupported, }; - const auto notSupportedErrorsToLog = { + static const auto NotSupportedErrorsToLog = { QDBusError::Disconnected, QDBusError::AccessDenied, }; if (reply.isValid()) { return (crl::now() - static_cast(reply.value())); - } else if (ranges::contains(notSupportedErrors, reply.error().type())) { + } else if (ranges::contains(NotSupportedErrors, reply.error().type())) { NotSupported = true; } else { - if (ranges::contains(notSupportedErrorsToLog, reply.error().type())) { + if (ranges::contains(NotSupportedErrorsToLog, reply.error().type())) { NotSupported = true; }