@@ -14,7 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17−#include "MirSessionItem.h"
17+#include "Session.h"
18#include "ApplicationInfo.h"
18#include "ApplicationInfo.h"
19#include "SurfaceManager.h"
19#include "SurfaceManager.h"
@@ -22,29 +22,29 @@
22#include <QQmlEngine>
22#include <QQmlEngine>
23#include <QTimer>
23#include <QTimer>
25−MirSessionItem::MirSessionItem(const QString &name,
25+Session::Session(const QString &name,
26− const QUrl& screenshot,
26+ const QUrl& screenshot,
27− QQuickItem *parent)
27+ QObject *parent)
28− : QQuickItem(parent)
28+ : QObject(parent)
29 , m_name(name)
29 , m_name(name)
30 , m_screenshot(screenshot)
30 , m_screenshot(screenshot)
31 , m_application(nullptr)
31 , m_application(nullptr)
32 , m_surface(nullptr)
32 , m_surface(nullptr)
33 , m_parentSession(nullptr)
33 , m_parentSession(nullptr)
34− , m_children(new MirSessionItemModel(this))
34+ , m_children(new SessionModel(this))
35 , m_manualSurfaceCreation(false)
35 , m_manualSurfaceCreation(false)
37− qDebug() << "MirSessionItem::MirSessionItem() " << this->name();
37+ qDebug() << "Session::Session() " << this->name();
39 QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
39 QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
42−MirSessionItem::~MirSessionItem()
42+Session::~Session()
44− qDebug() << "MirSessionItem::~MirSessionItem() " << name();
44+ qDebug() << "Session::~Session() " << name();
46− QList<MirSessionItem*> children(m_children->list());
46+ QList<Session*> children(m_children->list());
47− for (MirSessionItem* child : children) {
47+ for (Session* child : children) {
48 delete child;
48 delete child;
50 if (m_parentSession) {
50 if (m_parentSession) {
@@ -57,9 +57,9 @@ MirSessionItem::~MirSessionItem()
57 delete m_children;
57 delete m_children;
60−void MirSessionItem::release()
60+void Session::release()
62− qDebug() << "MirSessionItem::release " << name();
62+ qDebug() << "Session::release " << name();
63 Q_EMIT aboutToBeDestroyed();
63 Q_EMIT aboutToBeDestroyed();
65 if (m_parentSession) {
65 if (m_parentSession) {
@@ -73,7 +73,7 @@ void MirSessionItem::release()
76−void MirSessionItem::setApplication(ApplicationInfo* application)
76+void Session::setApplication(ApplicationInfo* application)
78 if (m_application == application)
78 if (m_application == application)
@@ -96,9 +96,9 @@ void MirSessionItem::setApplication(ApplicationInfo* application)
99−void MirSessionItem::setSurface(MirSurfaceItem* surface)
99+void Session::setSurface(MirSurfaceItem* surface)
101− qDebug() << "MirSessionItem::setSurface - session=" << name() << "surface=" << surface;
101+ qDebug() << "Session::setSurface - session=" << name() << "surface=" << surface;
102 if (m_surface == surface)
102 if (m_surface == surface)
@@ -117,7 +117,7 @@ void MirSessionItem::setSurface(MirSurfaceItem* surface)
117 Q_EMIT surfaceChanged(m_surface);
117 Q_EMIT surfaceChanged(m_surface);
120−void MirSessionItem::setScreenshot(const QUrl& screenshot)
120+void Session::setScreenshot(const QUrl& screenshot)
122 if (screenshot != m_screenshot) {
122 if (screenshot != m_screenshot) {
123 m_screenshot = screenshot;
123 m_screenshot = screenshot;
@@ -127,7 +127,7 @@ void MirSessionItem::setScreenshot(const QUrl& screenshot)
130−void MirSessionItem::setParentSession(MirSessionItem* session)
130+void Session::setParentSession(Session* session)
132 if (m_parentSession == session || session == this)
132 if (m_parentSession == session || session == this)
@@ -136,7 +136,7 @@ void MirSessionItem::setParentSession(MirSessionItem* session)
136 Q_EMIT parentSessionChanged(session);
136 Q_EMIT parentSessionChanged(session);
139−void MirSessionItem::createSurface()
139+void Session::createSurface()
141 if (m_surface) return;
141 if (m_surface) return;
@@ -146,22 +146,22 @@ void MirSessionItem::createSurface()
146 m_screenshot));
146 m_screenshot));
149−void MirSessionItem::addChildSession(MirSessionItem* session)
149+void Session::addChildSession(Session* session)
151 insertChildSession(m_children->rowCount(), session);
151 insertChildSession(m_children->rowCount(), session);
154−void MirSessionItem::insertChildSession(uint index, MirSessionItem* session)
154+void Session::insertChildSession(uint index, Session* session)
156− qDebug() << "MirSessionItem::insertChildSession - " << session->name() << " to " << name() << " @ " << index;
156+ qDebug() << "Session::insertChildSession - " << session->name() << " to " << name() << " @ " << index;
158 session->setParentSession(this);
158 session->setParentSession(this);
159 m_children->insert(index, session);
159 m_children->insert(index, session);
162−void MirSessionItem::removeChildSession(MirSessionItem* session)
162+void Session::removeChildSession(Session* session)
164− qDebug() << "MirSessionItem::removeChildSession - " << session->name() << " from " << name();
164+ qDebug() << "Session::removeChildSession - " << session->name() << " from " << name();
166 if (m_children->contains(session)) {
166 if (m_children->contains(session)) {
167 m_children->remove(session);
167 m_children->remove(session);
@@ -169,12 +169,12 @@ void MirSessionItem::removeChildSession(MirSessionItem* session)
172−MirSessionItemModel* MirSessionItem::childSessions() const
172+SessionModel* Session::childSessions() const
174 return m_children;
174 return m_children;
177−void MirSessionItem::setManualSurfaceCreation(bool value)
177+void Session::setManualSurfaceCreation(bool value)
179 if (value != m_manualSurfaceCreation) {
179 if (value != m_manualSurfaceCreation) {
180 m_manualSurfaceCreation = value;
180 m_manualSurfaceCreation = value;