Changeset View
Changeset View
Standalone View
Standalone View
Modules/base/info_wayland.cpp
Show All 36 Lines | 34 | WaylandModule::WaylandModule(QTreeWidget *parent) | |||
---|---|---|---|---|---|
37 | , m_thread(new QThread(this)) | 37 | , m_thread(new QThread(this)) | ||
38 | , m_connection(new KWayland::Client::ConnectionThread) | 38 | , m_connection(new KWayland::Client::ConnectionThread) | ||
39 | { | 39 | { | ||
40 | init(); | 40 | init(); | ||
41 | } | 41 | } | ||
42 | 42 | | |||
43 | WaylandModule::~WaylandModule() | 43 | WaylandModule::~WaylandModule() | ||
44 | { | 44 | { | ||
45 | delete m_registry; | ||||
45 | m_connection->deleteLater(); | 46 | m_connection->deleteLater(); | ||
46 | m_thread->quit(); | 47 | m_thread->quit(); | ||
47 | m_thread->wait(); | 48 | m_thread->wait(); | ||
48 | } | 49 | } | ||
49 | 50 | | |||
50 | void WaylandModule::init() | 51 | void WaylandModule::init() | ||
51 | { | 52 | { | ||
52 | using namespace KWayland::Client; | 53 | using namespace KWayland::Client; | ||
Show All 10 Lines | |||||
63 | new QTreeWidgetItem(compositorItem, QStringList() << i18n("Name of the Display") << qgetenv("WAYLAND_DISPLAY")); | 64 | new QTreeWidgetItem(compositorItem, QStringList() << i18n("Name of the Display") << qgetenv("WAYLAND_DISPLAY")); | ||
64 | 65 | | |||
65 | auto interfacesItem = new QTreeWidgetItem(compositorItem, QStringList() << i18n("Interfaces") << i18n("Interface Version")); | 66 | auto interfacesItem = new QTreeWidgetItem(compositorItem, QStringList() << i18n("Interfaces") << i18n("Interface Version")); | ||
66 | interfacesItem->setExpanded(true); | 67 | interfacesItem->setExpanded(true); | ||
67 | 68 | | |||
68 | connect(m_connection, &ConnectionThread::connected, this, | 69 | connect(m_connection, &ConnectionThread::connected, this, | ||
69 | [this, compositorItem, interfacesItem] { | 70 | [this, compositorItem, interfacesItem] { | ||
70 | Registry *registry = new Registry(this); | 71 | Registry *registry = new Registry(this); | ||
71 | EventQueue *queue = new EventQueue(this); | 72 | EventQueue *queue = new EventQueue(registry); | ||
72 | queue->setup(m_connection); | 73 | queue->setup(m_connection); | ||
73 | registry->setEventQueue(queue); | 74 | registry->setEventQueue(queue); | ||
74 | connect(registry, &Registry::interfaceAnnounced, this, | 75 | connect(registry, &Registry::interfaceAnnounced, this, | ||
75 | [this, interfacesItem] (const QByteArray &interface, quint32 name, quint32 version) { | 76 | [this, interfacesItem] (const QByteArray &interface, quint32 name, quint32 version) { | ||
76 | Q_UNUSED(name) | 77 | Q_UNUSED(name) | ||
77 | new QTreeWidgetItem(interfacesItem, QStringList() << interface << QString::number(version)); | 78 | new QTreeWidgetItem(interfacesItem, QStringList() << interface << QString::number(version)); | ||
78 | } | 79 | } | ||
79 | ); | 80 | ); | ||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 210 | new QTreeWidgetItem(modeItem, QStringList() << i18n("Preferred") | |||
210 | << (mode.flags.testFlag(Output::Mode::Flag::Preferred) ? i18n("yes") : i18n("no"))); | 211 | << (mode.flags.testFlag(Output::Mode::Flag::Preferred) ? i18n("yes") : i18n("no"))); | ||
211 | new QTreeWidgetItem(modeItem, QStringList() << i18n("Current") | 212 | new QTreeWidgetItem(modeItem, QStringList() << i18n("Current") | ||
212 | << (mode.flags.testFlag(Output::Mode::Flag::Current) ? i18n("yes") : i18n("no"))); | 213 | << (mode.flags.testFlag(Output::Mode::Flag::Current) ? i18n("yes") : i18n("no"))); | ||
213 | } | 214 | } | ||
214 | } | 215 | } | ||
215 | ); | 216 | ); | ||
216 | } | 217 | } | ||
217 | ); | 218 | ); | ||
219 | m_registry = registry; | ||||
218 | registry->create(m_connection); | 220 | registry->create(m_connection); | ||
219 | registry->setup(); | 221 | registry->setup(); | ||
220 | }, | 222 | }, | ||
221 | Qt::QueuedConnection | 223 | Qt::QueuedConnection | ||
222 | ); | 224 | ); | ||
223 | 225 | | |||
224 | m_connection->initConnection(); | 226 | m_connection->initConnection(); | ||
225 | } | 227 | } |