Merge lp:~tigrangab/slingshot/testing-startup-time into lp:~elementary-pantheon/slingshot/trunk

Proposed by Tigran Gabrielyan
Status: Merged
Approved by: Cody Garver
Approved revision: 370
Merged at revision: 368
Proposed branch: lp:~tigrangab/slingshot/testing-startup-time
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 55 lines (+12/-15)
1 file modified
src/Slingshot.vala (+12/-15)
To merge this branch: bzr merge lp:~tigrangab/slingshot/testing-startup-time
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
David Gomes (community) Needs Fixing
Review via email: mp+179821@code.launchpad.net

Commit message

Only use OptionContext parser if we have args to avoid slow down in startup time to fix bug #1043689.

To post a comment you must log in.
368. By Tigran Gabrielyan

Only use OptionContext parser if we have args to avoid slow down in startup time

Revision history for this message
David Gomes (davidgomes) wrote :

Code style fixes:

Add a newline after "context.add_group (Gtk.get_option_group (true));"
var context = new OptionContext(""); → var context = new OptionContext ("");
context.parse(ref args); → context.parse (ref args);
print(e.message + "\n"); → print (e.message + "\n");
Cuddle the try/catch blog so it'll be } catch {

This will need to be tested on Pantheon, seen as I can't run Pantheon I can't test it, but somebody will have to before it gets merged.

review: Needs Fixing
369. By Tigran Gabrielyan

Fix coding style

370. By Tigran Gabrielyan

Fix coding style

Revision history for this message
Julián Unrrein (junrrein) wrote :

I did some quick testing, but I can preliminarily say that the speed bump when opening slingshot is impressive!
I can't believe something so simple has such an effect.

Revision history for this message
Cody Garver (codygarver) wrote :

This merge will prompt a new stable release of Slingshot

Revision history for this message
Cody Garver (codygarver) wrote :

I tried to break it. I failed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Slingshot.vala'
2--- src/Slingshot.vala 2013-01-09 16:31:38 +0000
3+++ src/Slingshot.vala 2013-08-12 22:48:00 +0000
4@@ -62,9 +62,7 @@
5 }
6
7 public Slingshot () {
8-
9 settings = new Settings ();
10-
11 }
12
13 protected override void activate () {
14@@ -86,7 +84,6 @@
15 view.show_slingshot ();
16 }
17 silent = false;
18-
19 }
20
21 static const OptionEntry[] entries = {
22@@ -96,21 +93,21 @@
23 };
24
25 public static int main (string[] args) {
26-
27- var context = new OptionContext("");
28- context.add_main_entries(entries, "slingshot");
29- context.add_group (Gtk.get_option_group (true));
30- try {
31- context.parse(ref args);
32- }
33- catch(Error e) {
34- print(e.message + "\n");
35- }
36-
37+ if (args.length > 1) {
38+ var context = new OptionContext ("");
39+ context.add_main_entries (entries, "slingshot");
40+ context.add_group (Gtk.get_option_group (true));
41+
42+ try {
43+ context.parse (ref args);
44+ } catch (Error e) {
45+ print (e.message + "\n");
46+ }
47+ }
48+
49 var app = new Slingshot ();
50
51 return app.run (args);
52-
53 }
54
55 }

Subscribers

People subscribed via source and target branches