@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−#include "MirSessionItem.h"
17+#include "Session.h"
1818#include "ApplicationInfo.h"
1919#include "SurfaceManager.h"
2020
@@ -22,29 +22,29 @@
2222#include <QQmlEngine>
2323#include <QTimer>
2424
25−MirSessionItem::MirSessionItem(const QString &name,
26− const QUrl& screenshot,
27− QQuickItem *parent)
28− : QQuickItem(parent)
25+Session::Session(const QString &name,
26+ const QUrl& screenshot,
27+ QObject *parent)
28+ : QObject(parent)
2929 , m_name(name)
3030 , m_screenshot(screenshot)
3131 , m_application(nullptr)
3232 , m_surface(nullptr)
3333 , m_parentSession(nullptr)
34− , m_children(new MirSessionItemModel(this))
34+ , m_children(new SessionModel(this))
3535 , m_manualSurfaceCreation(false)
3636{
37− qDebug() << "MirSessionItem::MirSessionItem() " << this->name();
37+ qDebug() << "Session::Session() " << this->name();
3838
3939 QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
4040}
4141
42−MirSessionItem::~MirSessionItem()
42+Session::~Session()
4343{
44− qDebug() << "MirSessionItem::~MirSessionItem() " << name();
44+ qDebug() << "Session::~Session() " << name();
4545
46− QList<MirSessionItem*> children(m_children->list());
47− for (MirSessionItem* child : children) {
46+ QList<Session*> children(m_children->list());
47+ for (Session* child : children) {
4848 delete child;
4949 }
5050 if (m_parentSession) {
@@ -57,9 +57,9 @@ MirSessionItem::~MirSessionItem()
5757 delete m_children;
5858}
5959
60−void MirSessionItem::release()
60+void Session::release()
6161{
62− qDebug() << "MirSessionItem::release " << name();
62+ qDebug() << "Session::release " << name();
6363 Q_EMIT aboutToBeDestroyed();
6464
6565 if (m_parentSession) {
@@ -73,7 +73,7 @@ void MirSessionItem::release()
7373 }
7474}
7575
76−void MirSessionItem::setApplication(ApplicationInfo* application)
76+void Session::setApplication(ApplicationInfo* application)
7777{
7878 if (m_application == application)
7979 return;
@@ -96,9 +96,9 @@ void MirSessionItem::setApplication(ApplicationInfo* application)
9696 }
9797}
9898
99−void MirSessionItem::setSurface(MirSurfaceItem* surface)
99+void Session::setSurface(MirSurfaceItem* surface)
100100{
101− qDebug() << "MirSessionItem::setSurface - session=" << name() << "surface=" << surface;
101+ qDebug() << "Session::setSurface - session=" << name() << "surface=" << surface;
102102 if (m_surface == surface)
103103 return;
104104
@@ -117,7 +117,7 @@ void MirSessionItem::setSurface(MirSurfaceItem* surface)
117117 Q_EMIT surfaceChanged(m_surface);
118118}
119119
120−void MirSessionItem::setScreenshot(const QUrl& screenshot)
120+void Session::setScreenshot(const QUrl& screenshot)
121121{
122122 if (screenshot != m_screenshot) {
123123 m_screenshot = screenshot;
@@ -127,7 +127,7 @@ void MirSessionItem::setScreenshot(const QUrl& screenshot)
127127 }
128128}
129129
130−void MirSessionItem::setParentSession(MirSessionItem* session)
130+void Session::setParentSession(Session* session)
131131{
132132 if (m_parentSession == session || session == this)
133133 return;
@@ -136,7 +136,7 @@ void MirSessionItem::setParentSession(MirSessionItem* session)
136136 Q_EMIT parentSessionChanged(session);
137137}
138138
139−void MirSessionItem::createSurface()
139+void Session::createSurface()
140140{
141141 if (m_surface) return;
142142
@@ -146,22 +146,22 @@ void MirSessionItem::createSurface()
146146 m_screenshot));
147147}
148148
149−void MirSessionItem::addChildSession(MirSessionItem* session)
149+void Session::addChildSession(Session* session)
150150{
151151 insertChildSession(m_children->rowCount(), session);
152152}
153153
154−void MirSessionItem::insertChildSession(uint index, MirSessionItem* session)
154+void Session::insertChildSession(uint index, Session* session)
155155{
156− qDebug() << "MirSessionItem::insertChildSession - " << session->name() << " to " << name() << " @ " << index;
156+ qDebug() << "Session::insertChildSession - " << session->name() << " to " << name() << " @ " << index;
157157
158158 session->setParentSession(this);
159159 m_children->insert(index, session);
160160}
161161
162−void MirSessionItem::removeChildSession(MirSessionItem* session)
162+void Session::removeChildSession(Session* session)
163163{
164− qDebug() << "MirSessionItem::removeChildSession - " << session->name() << " from " << name();
164+ qDebug() << "Session::removeChildSession - " << session->name() << " from " << name();
165165
166166 if (m_children->contains(session)) {
167167 m_children->remove(session);
@@ -169,12 +169,12 @@ void MirSessionItem::removeChildSession(MirSessionItem* session)
169169 }
170170}
171171
172−MirSessionItemModel* MirSessionItem::childSessions() const
172+SessionModel* Session::childSessions() const
173173{
174174 return m_children;
175175}
176176
177−void MirSessionItem::setManualSurfaceCreation(bool value)
177+void Session::setManualSurfaceCreation(bool value)
178178{
179179 if (value != m_manualSurfaceCreation) {
180180 m_manualSurfaceCreation = value;