Drop Qt::Network dependency

We used it primarily for QHostInfo, but as QHostInfo::localHostName()
docs indicate, QSysInfo::machineHostName() returns the same info.
This commit is contained in:
Vlad Zahorodnii 2023-03-21 20:21:49 +02:00
parent 5a024d7e9a
commit 5e63f9afc9
2 changed files with 3 additions and 3 deletions

View file

@ -17,4 +17,4 @@ ecm_qt_declare_logging_category(KWinXwaylandCommon
set_property(TARGET KWinXwaylandCommon PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET KWinXwaylandCommon PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(KWinXwaylandCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(KWinXwaylandCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(KWinXwaylandCommon Qt::Core Qt::Network) target_link_libraries(KWinXwaylandCommon Qt::Core)

View file

@ -11,9 +11,9 @@
#include "xauthority.h" #include "xauthority.h"
#include <QDataStream> #include <QDataStream>
#include <QHostInfo>
#include <QRandomGenerator> #include <QRandomGenerator>
#include <QStandardPaths> #include <QStandardPaths>
#include <QSysInfo>
#include <QTemporaryFile> #include <QTemporaryFile>
static void writeXauthorityEntry(QDataStream &stream, quint16 family, static void writeXauthorityEntry(QDataStream &stream, quint16 family,
@ -54,7 +54,7 @@ bool generateXauthorityFile(int display, QTemporaryFile *authorityFile)
return false; return false;
} }
const QByteArray hostname = QHostInfo::localHostName().toUtf8(); const QByteArray hostname = QSysInfo::machineHostName().toUtf8();
const QByteArray displayName = QByteArray::number(display); const QByteArray displayName = QByteArray::number(display);
const QByteArray name = QByteArrayLiteral("MIT-MAGIC-COOKIE-1"); const QByteArray name = QByteArrayLiteral("MIT-MAGIC-COOKIE-1");
const QByteArray cookie = generateXauthorityCookie(); const QByteArray cookie = generateXauthorityCookie();