Use QHostInfo to get local host name.
Added dependency on QtNetwork for Qt4, too. In Qt5 we depend through QtQuick.
This commit is contained in:
parent
5e9269b854
commit
541fcee7a4
@ -33,6 +33,7 @@ if (USE_QT5)
|
||||
qt5_use_modules(sddm Widgets Quick)
|
||||
else()
|
||||
find_package(Qt4 REQUIRED)
|
||||
set(QT_USE_QTNETWORK TRUE)
|
||||
set(QT_USE_QTDECLARATIVE TRUE)
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
|
@ -25,11 +25,10 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QHostInfo>
|
||||
#include <QProcess>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace SDE;
|
||||
namespace SDE {
|
||||
class SessionInfo {
|
||||
@ -87,9 +86,7 @@ namespace SDE {
|
||||
d->lastSessionIndex = i;
|
||||
}
|
||||
// get hostname
|
||||
char hostName[100];
|
||||
gethostname(hostName, 100);
|
||||
d->hostName = hostName;
|
||||
d->hostName = QHostInfo::localHostName();
|
||||
}
|
||||
|
||||
SessionManager::~SessionManager() {
|
||||
|
Loading…
Reference in New Issue
Block a user