on xenial help sign in
added application property to session
commitec70d0fbd55b2cbb8c9defcbbc8bef977467be08 authorNick Dedekind <nick.dedekind@canonical.com> dateMon 1 Sep 2014, 17:07 (12 years ago) parent49c427d
4 files changed+6−2
qml/Shell.qml+2−2 tests/mocks/Unity/Application/Session.cpp+1 tests/mocks/Unity/Application/Session.h+2 tests/mocks/Unity/Application/plugin.cpp+1
qml/Shell.qml+2−2
@@ -236,8 +236,8 @@ Item {
236236 Connections {
237237 target: SessionManager
238238 onSessionStopping: {
239− if (!session.parent) {
240− // there's no one displaying it. delete it right away
239+ if (!session.parentSession && !session.application) {
240+ // nothing is using it. delete it right away
241241 session.release();
242242 }
243243 }
tests/mocks/Unity/Application/Session.cpp+1
@@ -79,6 +79,7 @@ void Session::setApplication(ApplicationInfo* application)
7979 return;
8080
8181 m_application = application;
82+ Q_EMIT applicationChanged(application);
8283}
8384
8485void Session::setSurface(MirSurfaceItem* surface)
tests/mocks/Unity/Application/Session.h+2
@@ -29,6 +29,7 @@ class Session : public QObject
2929 Q_OBJECT
3030 Q_PROPERTY(QString name READ name CONSTANT)
3131 Q_PROPERTY(MirSurfaceItem* surface READ surface NOTIFY surfaceChanged)
32+ Q_PROPERTY(ApplicationInfo* application READ application NOTIFY applicationChanged)
3233 Q_PROPERTY(Session* parentSession READ parentSession NOTIFY parentSessionChanged DESIGNABLE false)
3334 Q_PROPERTY(SessionModel* childSessions READ childSessions DESIGNABLE false CONSTANT)
3435 Q_PROPERTY(bool live READ live NOTIFY liveChanged)
@@ -58,6 +59,7 @@ public:
5859 void removeChildSession(Session* session);
5960
6061Q_SIGNALS:
62+ void applicationChanged(ApplicationInfo*);
6163 void surfaceChanged(MirSurfaceItem*);
6264 void parentSessionChanged(Session*);
6365 void liveChanged(bool live);
tests/mocks/Unity/Application/plugin.cpp+1
@@ -60,6 +60,7 @@ static QObject* applicationTestInterface(QQmlEngine* engine, QJSEngine* scriptEn
6060void FakeUnityApplicationQmlPlugin::registerTypes(const char *uri)
6161{
6262 qRegisterMetaType<Session*>("Session*");
63+ qRegisterMetaType<ApplicationInfo*>("ApplicationInfo*");
6364 qRegisterMetaType<MirSurfaceItemModel*>("SessionModel*");
6465 qRegisterMetaType<MirSurfaceItem*>("MirSurfaceItem*");
6566 qRegisterMetaType<MirSurfaceItemModel*>("MirSurfaceItemModel*");