Merge two ifndef blocks in main_window_linux

This commit is contained in:
Ilya Fedin 2021-01-04 14:18:48 +04:00 committed by John Preston
parent b3892f49fa
commit d4d688d494

View file

@ -402,10 +402,8 @@ bool UseUnityCounter() {
return Result; return Result;
} }
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
bool IsSNIAvailable() { bool IsSNIAvailable() {
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
auto message = QDBusMessage::createMethodCall( auto message = QDBusMessage::createMethodCall(
kSNIWatcherService.utf16(), kSNIWatcherService.utf16(),
kSNIWatcherObjectPath.utf16(), kSNIWatcherObjectPath.utf16(),
@ -425,7 +423,6 @@ bool IsSNIAvailable() {
} else if (reply.error().type() != QDBusError::ServiceUnknown) { } else if (reply.error().type() != QDBusError::ServiceUnknown) {
LOG(("SNI Error: %1").arg(reply.error().message())); LOG(("SNI Error: %1").arg(reply.error().message()));
} }
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
return false; return false;
} }
@ -439,7 +436,6 @@ quint32 djbStringHash(QString string) {
return hash; return hash;
} }
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
bool IsAppMenuSupported() { bool IsAppMenuSupported() {
const auto interface = QDBusConnection::sessionBus().interface(); const auto interface = QDBusConnection::sessionBus().interface();
@ -512,10 +508,9 @@ MainWindow::MainWindow(not_null<Window::Controller*> controller)
} }
void MainWindow::initHook() { void MainWindow::initHook() {
_sniAvailable = IsSNIAvailable();
LOG(("System tray available: %1").arg(Logs::b(trayAvailable())));
#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION
_sniAvailable = IsSNIAvailable();
_sniDBusProxy = g_dbus_proxy_new_for_bus_sync( _sniDBusProxy = g_dbus_proxy_new_for_bus_sync(
G_BUS_TYPE_SESSION, G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE, G_DBUS_PROXY_FLAGS_NONE,
@ -581,8 +576,9 @@ void MainWindow::initHook() {
} }
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
updateWaylandDecorationColors(); LOG(("System tray available: %1").arg(Logs::b(trayAvailable())));
updateWaylandDecorationColors();
style::PaletteChanged( style::PaletteChanged(
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
updateWaylandDecorationColors(); updateWaylandDecorationColors();