Merge lp:~mzanetti/unity8/parent-that-launcheritem into lp:unity8

Proposed by Michael Zanetti
Status: Superseded
Proposed branch: lp:~mzanetti/unity8/parent-that-launcheritem
Merge into: lp:unity8
Diff against target: 102 lines (+19/-7)
5 files modified
plugins/Unity/Launcher/launcheritem.cpp (+1/-0)
plugins/Unity/Launcher/launcheritem.h (+1/-1)
plugins/Unity/Launcher/launchermodel.cpp (+15/-5)
plugins/Unity/Launcher/launchermodel.h (+1/-1)
qml/Launcher/LauncherDelegate.qml (+1/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/parent-that-launcheritem
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+288412@code.launchpad.net

This proposal has been superseded by a proposal from 2016-03-10.

Commit message

Properly parent launcher items in all cases

It is required to keep object ownership within C++ or QML would delete items in some circumstances which leads to crashes.

Description of the change

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

no

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

no.. there's no change in behaviour. I believe this fixes a crash

https://errors.ubuntu.com/problem/dd7cdb19e961e18e58939b8af5c9324afbafc573

however, still need to figure how to reproduce this.

 * Did you make sure that your branch does not contain spurious tags?

yes

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

n/a

 * If you changed the UI, has there been a design review?

n/a

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Should we also remove the = 0 from the LauncherItem constructor for the parent argument then?

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

FAILED: Continuous integration, rev:2215
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/623/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/353
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/353
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/353
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/825
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/841
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/841
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/839
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/839/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/839
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/839/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/839
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/839/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/839
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/839/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/839
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/839/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/839
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/839/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
2216. By Michael Zanetti

prevent the same mistake from happening again

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

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Not really but the code is quite self explanatory

 * Did CI run pass?
Yes

 * Did you make sure that the branch does not contain spurious tags?
Yes

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

FAILED: Continuous integration, rev:2216
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/632/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/358
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/358
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/358
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/836
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/852
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/852
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/850/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
2217. By Michael Zanetti

merge ~lukas-kde/unity8/dynamicLauncherIcons as prereq

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Unity/Launcher/launcheritem.cpp'
2--- plugins/Unity/Launcher/launcheritem.cpp 2015-09-14 09:11:08 +0000
3+++ plugins/Unity/Launcher/launcheritem.cpp 2016-03-10 13:07:25 +0000
4@@ -37,6 +37,7 @@
5 m_alerting(false),
6 m_quickList(new QuickListModel(this))
7 {
8+ Q_ASSERT(parent != nullptr);
9 QuickListEntry nameAction;
10 nameAction.setActionId(QStringLiteral("launch_item"));
11 nameAction.setText(m_name);
12
13=== modified file 'plugins/Unity/Launcher/launcheritem.h'
14--- plugins/Unity/Launcher/launcheritem.h 2015-07-23 14:13:57 +0000
15+++ plugins/Unity/Launcher/launcheritem.h 2016-03-10 13:07:25 +0000
16@@ -32,7 +32,7 @@
17 {
18 Q_OBJECT
19 public:
20- LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent = 0);
21+ LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent);
22
23 QString appId() const override;
24 QString name() const override;
25
26=== modified file 'plugins/Unity/Launcher/launchermodel.cpp'
27--- plugins/Unity/Launcher/launchermodel.cpp 2015-09-14 09:11:08 +0000
28+++ plugins/Unity/Launcher/launchermodel.cpp 2016-03-10 13:07:25 +0000
29@@ -103,7 +103,7 @@
30 LauncherItem *item = m_list.at(index);
31 if (!item->focused()) {
32 item->setAlerting(alerting);
33- Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RoleAlerting);
34+ Q_EMIT dataChanged(modelIndex, modelIndex, {RoleAlerting});
35 }
36 }
37 }
38@@ -389,7 +389,8 @@
39 if (countVisible && desktopFile.isValid()) {
40 LauncherItem *item = new LauncherItem(appId,
41 desktopFile.displayName(),
42- desktopFile.icon());
43+ desktopFile.icon(),
44+ this);
45 item->setCountVisible(true);
46 beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
47 m_list.append(item);
48@@ -414,10 +415,19 @@
49 } else {
50 int idx = m_list.indexOf(item);
51 item->setName(desktopFile.displayName());
52- item->setIcon(desktopFile.icon());
53 item->setPinned(item->pinned()); // update pinned text if needed
54 item->setRunning(item->running());
55- Q_EMIT dataChanged(index(idx), index(idx), {RoleName, RoleIcon, RoleRunning});
56+ Q_EMIT dataChanged(index(idx), index(idx), {RoleName, RoleRunning});
57+
58+ const QString oldIcon = item->icon();
59+ if (oldIcon == desktopFile.icon()) { // same icon file, perhaps different contents, simulate changing the icon name to force reload
60+ item->setIcon(QString());
61+ Q_EMIT dataChanged(index(idx), index(idx), {RoleIcon});
62+ }
63+
64+ // now set the icon for real
65+ item->setIcon(desktopFile.icon());
66+ Q_EMIT dataChanged(index(idx), index(idx), {RoleIcon});
67 }
68 }
69
70@@ -489,7 +499,7 @@
71 if (idx >= 0) {
72 LauncherItem *item = m_list.at(idx);
73 setAlerting(item->appId(), true);
74- Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleAlerting);
75+ Q_EMIT dataChanged(index(idx), index(idx), {RoleAlerting});
76 }
77 }
78
79
80=== modified file 'plugins/Unity/Launcher/launchermodel.h'
81--- plugins/Unity/Launcher/launchermodel.h 2015-07-29 12:32:57 +0000
82+++ plugins/Unity/Launcher/launchermodel.h 2016-03-10 13:07:25 +0000
83@@ -38,7 +38,7 @@
84 Q_OBJECT
85
86 public:
87- LauncherModel(QObject *parent = 0);
88+ LauncherModel(QObject *parent = nullptr);
89 ~LauncherModel();
90
91 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
92
93=== modified file 'qml/Launcher/LauncherDelegate.qml'
94--- qml/Launcher/LauncherDelegate.qml 2015-11-19 16:55:31 +0000
95+++ qml/Launcher/LauncherDelegate.qml 2016-03-10 13:07:25 +0000
96@@ -135,6 +135,7 @@
97 sourceSize.width: iconShape.width
98 sourceSize.height: iconShape.height
99 source: root.iconName
100+ cache: false // see lpbug#1543290 why no cache
101 }
102 }
103

Subscribers

People subscribed via source and target branches