Merge lp:~kazade/wingpanel/indicator-loading into lp:~elementary-pantheon/wingpanel/wingpanel

Proposed by Kazade
Status: Merged
Merged at revision: 29
Proposed branch: lp:~kazade/wingpanel/indicator-loading
Merge into: lp:~elementary-pantheon/wingpanel/wingpanel
Diff against target: 53 lines (+26/-3)
2 files modified
wingpanel-config.vala (+1/-1)
wingpanel-indicator-file-model.vala (+25/-2)
To merge this branch: bzr merge lp:~kazade/wingpanel/indicator-loading
Reviewer Review Type Date Requested Status
Cris Dywan (community) Approve
Review via email: mp+44556@code.launchpad.net

This proposal supersedes a proposal from 2010-12-22.

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote : Posted in a previous version of this proposal

Please use critical() instead of print(), since the panel is unusable in that case. And please limit the lines to ~80 columns.

review: Needs Fixing
Revision history for this message
Cris Dywan (kalikiana) wrote :

Looks good and quickly tested, thanks a lot.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'wingpanel-config.vala'
--- wingpanel-config.vala 2010-12-20 23:12:54 +0000
+++ wingpanel-config.vala 2010-12-23 09:14:09 +0000
@@ -1,3 +1,3 @@
1namespace Wingpanel.Config {1namespace Wingpanel.Config {
2 public const string INDICATORDIR = "/usr/lib/indicators/4/";2 public const string INDICATORDIR = "/usr/lib/indicators/";
3}3}
44
=== modified file 'wingpanel-indicator-file-model.vala'
--- wingpanel-indicator-file-model.vala 2010-12-22 15:31:51 +0000
+++ wingpanel-indicator-file-model.vala 2010-12-23 09:14:09 +0000
@@ -95,7 +95,30 @@
95 //Gtk.IconTheme.get_default ().append_search_path (Wingpanel.Config.INDICATORICONSDIR);95 //Gtk.IconTheme.get_default ().append_search_path (Wingpanel.Config.INDICATORICONSDIR);
9696
97 /* Start loading 'em in. .so are located in INDICATORDIR*/97 /* Start loading 'em in. .so are located in INDICATORDIR*/
98 var dir = File.new_for_path (Wingpanel.Config.INDICATORDIR);98
99 //Supported versions
100 ArrayList<string> versions = new Gee.ArrayList<string>();
101 versions.add("3");
102 versions.add("4");
103
104 File dir = null;
105 //See if any of the version directories exist in INDICATORDIR
106 foreach(string version in versions) {
107 var version_path = File.new_for_path (
108 Wingpanel.Config.INDICATORDIR).get_child(version);
109 if (version_path.query_exists()) {
110 dir = version_path;
111 break;
112 }
113 }
114
115 //If none exist, then print an error and return
116 if(dir == null) {
117 critical ("No indicatordirectory found in: %s. Check configuration.",
118 Wingpanel.Config.INDICATORDIR);
119 return;
120 }
121
99 try122 try
100 {123 {
101 var e = dir.enumerate_children (FILE_ATTRIBUTE_STANDARD_NAME, 0, null);124 var e = dir.enumerate_children (FILE_ATTRIBUTE_STANDARD_NAME, 0, null);
@@ -123,7 +146,7 @@
123 sos.sort ((CompareFunc)indicator_sort_func);146 sos.sort ((CompareFunc)indicator_sort_func);
124147
125 foreach (string leaf in sos)148 foreach (string leaf in sos)
126 this.load_indicator (Wingpanel.Config.INDICATORDIR + leaf, leaf);149 this.load_indicator (dir.get_path() + "/" + leaf, leaf);
127 }150 }
128 catch (Error error)151 catch (Error error)
129 {152 {

Subscribers

People subscribed via source and target branches