Merge lp:~wistful/unity-launcher-editor/unity-launcher-editor into lp:unity-launcher-editor

Proposed by wst
Status: Merged
Merged at revision: 64
Proposed branch: lp:~wistful/unity-launcher-editor/unity-launcher-editor
Merge into: lp:unity-launcher-editor
Diff against target: 60 lines (+11/-9)
1 file modified
unitylaunchereditor/dialogs/app.py (+11/-9)
To merge this branch: bzr merge lp:~wistful/unity-launcher-editor/unity-launcher-editor
Reviewer Review Type Date Requested Status
Laudeci Oliveira Approve
Review via email: mp+150677@code.launchpad.net

Description of the change

improve startup time from 40 seconds to 2 seconds

To post a comment you must log in.
Revision history for this message
CSRedRat (csredrat) wrote :

The best optimization!
Profiling process for patch in Russian: http://habrahabr.ru/post/171005/

Revision history for this message
Laudeci Oliveira (laudeci) wrote :

Good job.

review: Approve
Revision history for this message
CSRedRat (csredrat) wrote :
Revision history for this message
CSRedRat (csredrat) wrote :

Code merged. Can approve patch fix in bug?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'unitylaunchereditor/dialogs/app.py'
--- unitylaunchereditor/dialogs/app.py 2011-11-28 17:12:07 +0000
+++ unitylaunchereditor/dialogs/app.py 2013-02-26 21:54:36 +0000
@@ -71,6 +71,8 @@
71 #bottom window buttons71 #bottom window buttons
72 self.__create_bottom_box(main_box)72 self.__create_bottom_box(main_box)
73 73
74 self.icon_manager = IconManager()
75 self.pix_missing = self.icon_manager.get_icon(ThemedIcon('image-missing'),32)
74 self.__populate()76 self.__populate()
75 self.connect('delete-event', Gtk.main_quit)77 self.connect('delete-event', Gtk.main_quit)
76 78
@@ -198,12 +200,12 @@
198 sname = info['Name']200 sname = info['Name']
199 desc = info['Comment']201 desc = info['Comment']
200 icon = info['Icon']202 icon = info['Icon']
201 pix = IconManager().get_icon(ThemedIcon('image-missing'),32)203 pix = self.pix_missing
202 if icon:204 if icon:
203 if icon.rfind('.') != -1:205 if icon.rfind('.') != -1:
204 pix = IconManager().get_icon(FileIcon(File(icon)),32)206 pix = self.icon_manager.get_icon(FileIcon(File(icon)),32)
205 else:207 else:
206 pix = IconManager().get_icon(ThemedIcon(icon),32)208 pix = self.icon_manager.get_icon(ThemedIcon(icon),32)
207 data = (pix, '%s' % sname, obj, sname.upper(), file_path)209 data = (pix, '%s' % sname, obj, sname.upper(), file_path)
208 210
209 return self.launcher_view.add_row(data,True)211 return self.launcher_view.add_row(data,True)
@@ -215,12 +217,12 @@
215 sname = obj.get('Name',locale=LOCALE)217 sname = obj.get('Name',locale=LOCALE)
216 desc = obj.get('Comment',locale=LOCALE)218 desc = obj.get('Comment',locale=LOCALE)
217 icon = obj.get('Icon')219 icon = obj.get('Icon')
218 pix = IconManager().get_icon(ThemedIcon('image-missing'),32)220 pix = self.pix_missing
219 if icon:221 if icon:
220 if icon.rfind('.') != -1:222 if icon.rfind('.') != -1:
221 pix = IconManager().get_icon(FileIcon(File(icon)),32)223 pix = self.icon_manager.get_icon(FileIcon(File(icon)),32)
222 else:224 else:
223 pix = IconManager().get_icon(ThemedIcon(icon),32)225 pix = self.icon_manager.get_icon(ThemedIcon(icon),32)
224 226
225 data = (pix, '%s' % sname, obj, sname.upper(), file_path)227 data = (pix, '%s' % sname, obj, sname.upper(), file_path)
226 return self.launcher_view.add_row(data,selected)228 return self.launcher_view.add_row(data,selected)
@@ -325,12 +327,12 @@
325 self.launcher_view.set_value(obj['Name'], self.launcher_view.COLUMN_NAME)327 self.launcher_view.set_value(obj['Name'], self.launcher_view.COLUMN_NAME)
326 self.launcher_view.set_value(obj['Name'].upper(), self.launcher_view.COLUMN_NAME_UPPER)328 self.launcher_view.set_value(obj['Name'].upper(), self.launcher_view.COLUMN_NAME_UPPER)
327 icon = obj['Icon']329 icon = obj['Icon']
328 pix = IconManager().get_icon(ThemedIcon('image-missing'),32)330 pix = self.pix_missing
329 if icon:331 if icon:
330 if icon.rfind('.') != -1:332 if icon.rfind('.') != -1:
331 pix = IconManager().get_icon(FileIcon(File(icon)),32)333 pix = self.icon_manager.get_icon(FileIcon(File(icon)),32)
332 else:334 else:
333 pix = IconManager().get_icon(ThemedIcon(icon),32)335 pix = self.icon_manager.get_icon(ThemedIcon(icon),32)
334 self.launcher_view.set_value(pix, self.launcher_view.COLUMN_ICON)336 self.launcher_view.set_value(pix, self.launcher_view.COLUMN_ICON)
335 337
336 if button_type == TOOLBUTTON_REMOVE:338 if button_type == TOOLBUTTON_REMOVE:

Subscribers

People subscribed via source and target branches