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
1=== modified file 'unitylaunchereditor/dialogs/app.py'
2--- unitylaunchereditor/dialogs/app.py 2011-11-28 17:12:07 +0000
3+++ unitylaunchereditor/dialogs/app.py 2013-02-26 21:54:36 +0000
4@@ -71,6 +71,8 @@
5 #bottom window buttons
6 self.__create_bottom_box(main_box)
7
8+ self.icon_manager = IconManager()
9+ self.pix_missing = self.icon_manager.get_icon(ThemedIcon('image-missing'),32)
10 self.__populate()
11 self.connect('delete-event', Gtk.main_quit)
12
13@@ -198,12 +200,12 @@
14 sname = info['Name']
15 desc = info['Comment']
16 icon = info['Icon']
17- pix = IconManager().get_icon(ThemedIcon('image-missing'),32)
18+ pix = self.pix_missing
19 if icon:
20 if icon.rfind('.') != -1:
21- pix = IconManager().get_icon(FileIcon(File(icon)),32)
22+ pix = self.icon_manager.get_icon(FileIcon(File(icon)),32)
23 else:
24- pix = IconManager().get_icon(ThemedIcon(icon),32)
25+ pix = self.icon_manager.get_icon(ThemedIcon(icon),32)
26 data = (pix, '%s' % sname, obj, sname.upper(), file_path)
27
28 return self.launcher_view.add_row(data,True)
29@@ -215,12 +217,12 @@
30 sname = obj.get('Name',locale=LOCALE)
31 desc = obj.get('Comment',locale=LOCALE)
32 icon = obj.get('Icon')
33- pix = IconManager().get_icon(ThemedIcon('image-missing'),32)
34+ pix = self.pix_missing
35 if icon:
36 if icon.rfind('.') != -1:
37- pix = IconManager().get_icon(FileIcon(File(icon)),32)
38+ pix = self.icon_manager.get_icon(FileIcon(File(icon)),32)
39 else:
40- pix = IconManager().get_icon(ThemedIcon(icon),32)
41+ pix = self.icon_manager.get_icon(ThemedIcon(icon),32)
42
43 data = (pix, '%s' % sname, obj, sname.upper(), file_path)
44 return self.launcher_view.add_row(data,selected)
45@@ -325,12 +327,12 @@
46 self.launcher_view.set_value(obj['Name'], self.launcher_view.COLUMN_NAME)
47 self.launcher_view.set_value(obj['Name'].upper(), self.launcher_view.COLUMN_NAME_UPPER)
48 icon = obj['Icon']
49- pix = IconManager().get_icon(ThemedIcon('image-missing'),32)
50+ pix = self.pix_missing
51 if icon:
52 if icon.rfind('.') != -1:
53- pix = IconManager().get_icon(FileIcon(File(icon)),32)
54+ pix = self.icon_manager.get_icon(FileIcon(File(icon)),32)
55 else:
56- pix = IconManager().get_icon(ThemedIcon(icon),32)
57+ pix = self.icon_manager.get_icon(ThemedIcon(icon),32)
58 self.launcher_view.set_value(pix, self.launcher_view.COLUMN_ICON)
59
60 if button_type == TOOLBUTTON_REMOVE:

Subscribers

People subscribed via source and target branches