From 5e63f9afc96bf7f4f4f7b71416f3a201f85f1625 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 21 Mar 2023 20:21:49 +0200 Subject: [PATCH] Drop Qt::Network dependency We used it primarily for QHostInfo, but as QHostInfo::localHostName() docs indicate, QSysInfo::machineHostName() returns the same info. --- src/xwayland/lib/CMakeLists.txt | 2 +- src/xwayland/lib/xauthority.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xwayland/lib/CMakeLists.txt b/src/xwayland/lib/CMakeLists.txt index dff9a60e40..64d4b71949 100644 --- a/src/xwayland/lib/CMakeLists.txt +++ b/src/xwayland/lib/CMakeLists.txt @@ -17,4 +17,4 @@ ecm_qt_declare_logging_category(KWinXwaylandCommon set_property(TARGET KWinXwaylandCommon PROPERTY POSITION_INDEPENDENT_CODE ON) target_include_directories(KWinXwaylandCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(KWinXwaylandCommon Qt::Core Qt::Network) +target_link_libraries(KWinXwaylandCommon Qt::Core) diff --git a/src/xwayland/lib/xauthority.cpp b/src/xwayland/lib/xauthority.cpp index bef5560e5b..cf5c573897 100644 --- a/src/xwayland/lib/xauthority.cpp +++ b/src/xwayland/lib/xauthority.cpp @@ -11,9 +11,9 @@ #include "xauthority.h" #include -#include #include #include +#include #include static void writeXauthorityEntry(QDataStream &stream, quint16 family, @@ -54,7 +54,7 @@ bool generateXauthorityFile(int display, QTemporaryFile *authorityFile) return false; } - const QByteArray hostname = QHostInfo::localHostName().toUtf8(); + const QByteArray hostname = QSysInfo::machineHostName().toUtf8(); const QByteArray displayName = QByteArray::number(display); const QByteArray name = QByteArrayLiteral("MIT-MAGIC-COOKIE-1"); const QByteArray cookie = generateXauthorityCookie();