Merge lp:~debfx/messagingmenu-extension/lp817598 into lp:messagingmenu-extension

Proposed by Felix Geyer
Status: Merged
Merged at revision: 69
Proposed branch: lp:~debfx/messagingmenu-extension/lp817598
Merge into: lp:messagingmenu-extension
Diff against target: 49 lines (+12/-8)
2 files modified
modules/LibUnity.jsm (+6/-4)
modules/MessagingMenu.jsm (+6/-4)
To merge this branch: bzr merge lp:~debfx/messagingmenu-extension/lp817598
Reviewer Review Type Date Requested Status
Mike Conley Pending
Review via email: mp+74489@code.launchpad.net

Description of the change

Make the messaging menu work when libunity isn't installed.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/LibUnity.jsm'
--- modules/LibUnity.jsm 2011-09-06 13:54:17 +0000
+++ modules/LibUnity.jsm 2011-09-07 18:01:23 +0000
@@ -54,12 +54,11 @@
54 try {54 try {
55 libunity = ctypes.open("libunity.so.5");55 libunity = ctypes.open("libunity.so.5");
56 } catch(e) {56 } catch(e) {
57 libunity = ctypes.open("libunity.so.4");57 try {
58 libunity = ctypes.open("libunity.so.4");
59 } catch(e) {}
58 }60 }
5961
60 if (!libunity)
61 throw "libunity is unavailable";
62
63 return libunity;62 return libunity;
64});63});
6564
@@ -240,6 +239,9 @@
240 },239 },
241240
242 isAvailable: function LUP_isAvailable() {241 isAvailable: function LUP_isAvailable() {
242 if (!libunity)
243 return false;
244
243 var ret = false;245 var ret = false;
244 try {246 try {
245 var inspector = unity_inspector_get_default();247 var inspector = unity_inspector_get_default();
246248
=== modified file 'modules/MessagingMenu.jsm'
--- modules/MessagingMenu.jsm 2011-09-05 17:48:06 +0000
+++ modules/MessagingMenu.jsm 2011-09-07 18:01:23 +0000
@@ -685,10 +685,12 @@
685 set badgeCount(aCount) {685 set badgeCount(aCount) {
686 LOG("Setting total new count to " + aCount.toString());686 LOG("Setting total new count to " + aCount.toString());
687 this._badgeCount = aCount;687 this._badgeCount = aCount;
688 if (aCount > 0) {688 if (LibUnity.isAvailable()) {
689 LibUnity.setCount(aCount);689 if (aCount > 0) {
690 } else {690 LibUnity.setCount(aCount);
691 LibUnity.setCount(null);691 } else {
692 LibUnity.setCount(null);
693 }
692 }694 }
693 },695 },
694696

Subscribers

People subscribed via source and target branches

to all changes: