Merge lp:~fboucault/unity-2d/launcher_kde3_support into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 625
Merged at revision: 629
Proposed branch: lp:~fboucault/unity-2d/launcher_kde3_support
Merge into: lp:unity-2d/3.0
Diff against target: 44 lines (+21/-0)
2 files modified
libunity-2d-private/Unity2d/launcherapplicationslist.cpp (+20/-0)
libunity-2d-private/Unity2d/launcherapplicationslist.h (+1/-0)
To merge this branch: bzr merge lp:~fboucault/unity-2d/launcher_kde3_support
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
Review via email: mp+67856@code.launchpad.net

Description of the change

[launcher] KDE3 applications now appear in the launcher.

That required to take into account the case where a BamfApplication's user_visible
went from false to true.

To post a comment you must log in.
625. By Florian Boucault

Empty commit to link bugs fixed by that branch.

Revision history for this message
Ugo Riboni (uriboni) wrote :

Fixes the problem as advertised.
Code looks good too (use of UniqueConnection is clever)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/Unity2d/launcherapplicationslist.cpp'
2--- libunity-2d-private/Unity2d/launcherapplicationslist.cpp 2011-06-11 10:50:03 +0000
3+++ libunity-2d-private/Unity2d/launcherapplicationslist.cpp 2011-07-14 11:26:29 +0000
4@@ -227,8 +227,28 @@
5 application->deleteLater();
6 }
7
8+void
9+LauncherApplicationsList::onApplicationUserVisibleChanged(bool user_visible)
10+{
11+ BamfApplication* bamf_application = qobject_cast<BamfApplication*>(sender());
12+ if (user_visible) {
13+ insertBamfApplication(bamf_application);
14+ } else {
15+ /* FIXME: this case has not been implemented yet but it has not been
16+ affecting anybody so far. */
17+ }
18+}
19+
20 void LauncherApplicationsList::insertBamfApplication(BamfApplication* bamf_application)
21 {
22+ /* Only insert BamfApplications for which the user_visible property is true.
23+ Monitor that property so that they are inserted/removed dynamically when it changes.
24+
25+ Not doing it led to KDE3 applications not showing up in the launcher.
26+ Ref.: https://bugs.launchpad.net/unity-2d/+bug/719983
27+ */
28+ QObject::connect(bamf_application, SIGNAL(UserVisibleChanged(bool)), this, SLOT(onApplicationUserVisibleChanged(bool)), Qt::UniqueConnection);
29+
30 if (!bamf_application->user_visible()) {
31 return;
32 }
33
34=== modified file 'libunity-2d-private/Unity2d/launcherapplicationslist.h'
35--- libunity-2d-private/Unity2d/launcherapplicationslist.h 2011-06-07 16:34:46 +0000
36+++ libunity-2d-private/Unity2d/launcherapplicationslist.h 2011-07-14 11:26:29 +0000
37@@ -102,6 +102,7 @@
38 void onApplicationStickyChanged(bool sticky);
39 void onApplicationLaunchingChanged(bool launching);
40 void onApplicationUrgentChanged(bool urgent);
41+ void onApplicationUserVisibleChanged(bool user_visible);
42 void onRemoteEntryUpdated(QString applicationURI,
43 QMap<QString, QVariant> properties);
44 };

Subscribers

People subscribed via source and target branches