Merge lp:~aacid/qtmir/remove_non_interface_things into lp:qtmir

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 619
Merged at revision: 627
Proposed branch: lp:~aacid/qtmir/remove_non_interface_things
Merge into: lp:qtmir
Diff against target: 123 lines (+1/-54)
2 files modified
src/modules/Unity/Application/application_manager.cpp (+0/-40)
src/modules/Unity/Application/application_manager.h (+1/-14)
To merge this branch: bzr merge lp:~aacid/qtmir/remove_non_interface_things
Reviewer Review Type Date Requested Status
Unity8 CI Bot (community) continuous-integration Approve
Gerry Boland (community) Approve
Review via email: mp+320600@code.launchpad.net

Commit message

Remove empty property and move invokable

They are not part of the interface and not used by unity8 either

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:619
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/606/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4604
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4632
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4459
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4459/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4459
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4459/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4459
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4459/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4459
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4459/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4459
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4459/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4459
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4459/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/606/rebuild

review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

- qtmir::Application* findApplicationWithPid(const pid_t pid) const;
run this by Dednick, my memory suggests DBus menus require the pid. Though probably not since it's not Q_INVOKABLE

Rest looks good!

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> - qtmir::Application* findApplicationWithPid(const pid_t pid) const;
> run this by Dednick, my memory suggests DBus menus require the pid. Though
> probably not since it's not Q_INVOKABLE

We dont use it for menus. We only use the "Surface Menus" (which use surfaceId)
But we "may" need something in the future when we start using "Application Menus" (which use pid)

>
> Rest looks good!

Revision history for this message
Albert Astals Cid (aacid) wrote :

> > - qtmir::Application* findApplicationWithPid(const pid_t pid) const;
> > run this by Dednick, my memory suggests DBus menus require the pid. Though
> > probably not since it's not Q_INVOKABLE
>
> We dont use it for menus. We only use the "Surface Menus" (which use
> surfaceId)
> But we "may" need something in the future when we start using "Application
> Menus" (which use pid)

We can add it later if needed, in this branch i'm just removing functions we don't need to close the entry points for the branch that adds the mutex handling to ApplicationManager.

>
> >
> > Rest looks good!

Revision history for this message
Gerry Boland (gerboland) wrote :

Yep, happy to remove it not being used ATM

review: Approve
620. By Albert Astals Cid

Merge

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:620
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/642/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4749
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4777
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4599
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4599/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4599
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4599/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4599
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4599/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4599
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4599/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4599
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4599/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4599
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4599/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/642/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/application_manager.cpp'
2--- src/modules/Unity/Application/application_manager.cpp 2017-02-21 18:46:30 +0000
3+++ src/modules/Unity/Application/application_manager.cpp 2017-03-24 08:44:31 +0000
4@@ -658,9 +658,6 @@
5 m_applications.append(application);
6 endInsertRows();
7 Q_EMIT countChanged();
8- if (m_applications.size() == 1) {
9- Q_EMIT emptyChanged();
10- }
11
12 m_modelUnderChange = false;
13
14@@ -686,9 +683,6 @@
15 m_applications.removeAt(index);
16 endRemoveRows();
17 Q_EMIT countChanged();
18- if (index == 0) {
19- Q_EMIT emptyChanged();
20- }
21
22 disconnect(application, &Application::fullscreenChanged, this, 0);
23 disconnect(application, &Application::focusedChanged, this, 0);
24@@ -705,29 +699,6 @@
25 DEBUG_MSG << "(appId=" << application->appId() << ") - after " << toString();
26 }
27
28-void ApplicationManager::move(int from, int to) {
29- qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::move - from=" << from << "to=" << to;
30- if (from == to) return;
31-
32- Q_ASSERT(!m_modelUnderChange);
33- m_modelUnderChange = true;
34-
35- if (from >= 0 && from < m_applications.size() && to >= 0 && to < m_applications.size()) {
36- QModelIndex parent;
37- /* When moving an item down, the destination index needs to be incremented
38- by one, as explained in the documentation:
39- http://qt-project.org/doc/qt-5.0/qtcore/qabstractitemmodel.html#beginMoveRows */
40-
41- beginMoveRows(parent, from, from, parent, to + (to > from ? 1 : 0));
42- m_applications.move(from, to);
43- endMoveRows();
44- }
45-
46- m_modelUnderChange = false;
47-
48- qCDebug(QTMIR_APPLICATIONS) << "ApplicationManager::move after " << toString();
49-}
50-
51 QModelIndex ApplicationManager::findIndex(Application* application)
52 {
53 for (int i = 0; i < m_applications.size(); ++i) {
54@@ -763,17 +734,6 @@
55 return nullptr;
56 }
57
58-Application *ApplicationManager::findApplication(qtmir::MirSurfaceInterface* surface)
59-{
60- Q_FOREACH (Application *app, m_applications) {
61- if (app->session() == surface->session()) {
62- return app;
63- }
64- }
65- return nullptr;
66-}
67-
68-
69 void ApplicationManager::onSessionStarting(SessionInterface *qmlSession)
70 {
71 Application* application = findApplicationWithSession(qmlSession->session());
72
73=== modified file 'src/modules/Unity/Application/application_manager.h'
74--- src/modules/Unity/Application/application_manager.h 2017-03-20 15:56:22 +0000
75+++ src/modules/Unity/Application/application_manager.h 2017-03-24 08:44:31 +0000
76@@ -61,9 +61,6 @@
77 {
78 Q_OBJECT
79
80- // TODO: Move to unity::shell::application::ApplicationManagerInterface
81- Q_PROPERTY(bool empty READ isEmpty NOTIFY emptyChanged)
82-
83 public:
84 static ApplicationManager* create();
85 static ApplicationManager* singleton();
86@@ -89,13 +86,6 @@
87 int rowCount(const QModelIndex & parent = QModelIndex()) const override;
88 QVariant data(const QModelIndex & index, int role) const override;
89
90- Q_INVOKABLE void move(int from, int to);
91-
92- bool isEmpty() const { return rowCount() == 0; }
93-
94- const QList<Application*> &list() const { return m_applications; }
95- qtmir::Application* findApplicationWithPid(const pid_t pid) const;
96-
97 SessionInterface *findSession(const mir::scene::Session* session) const override;
98
99 public Q_SLOTS:
100@@ -109,14 +99,12 @@
101 void onResumeRequested(const QString& appId);
102 void onSessionStarting(SessionInterface *session);
103
104-Q_SIGNALS:
105- void emptyChanged();
106-
107 private Q_SLOTS:
108 void onAppDataChanged(const int role);
109 void onApplicationClosing(Application *application);
110
111 private:
112+ qtmir::Application* findApplicationWithPid(const pid_t pid) const;
113 Application* findApplicationWithSession(const std::shared_ptr<mir::scene::Session> &session);
114 void setFocused(Application *application);
115 void add(Application *application);
116@@ -128,7 +116,6 @@
117
118 Application* findApplicationWithPromptSession(const mir::scene::PromptSession* promptSession);
119 Application *findClosingApplication(const QString &inputAppId) const;
120- Application *findApplication(MirSurfaceInterface* surface);
121
122 QList<Application*> m_applications;
123 DBusFocusInfo *m_dbusFocusInfo;

Subscribers

People subscribed via source and target branches