19#include <QDBusConnection>
23Platform::Platform(QObject *parent)
24 : QObject(parent), m_isPC(true), m_isMultiSession(true)
26 QMetaObject::invokeMethod(
this,
"init");
31 QDBusInterface iface(
"org.freedesktop.hostname1",
"/org/freedesktop/hostname1",
"org.freedesktop.hostname1",
32 QDBusConnection::systemBus(),
this);
33 QDBusInterface seatIface(
"org.freedesktop.login1",
"/org/freedesktop/login1/seat/self",
"org.freedesktop.login1.Seat",
34 QDBusConnection::systemBus(),
this);
46 m_chassis = iface.property(
"Chassis").toString();
49 m_isPC = !QSet<QString>{
"handset",
"tablet",
"watch"}.contains(m_chassis);
50 m_isMultiSession = seatIface.property(
"CanMultiSession").toBool() && seatIface.property(
"CanGraphical").toBool();
65 return m_isMultiSession;