Merge lp:~donadigo/wingpanel-indicator-bluetooth/use-appinfo into lp:~wingpanel-devs/wingpanel-indicator-bluetooth/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Felipe Escoto
Approved revision: 36
Merged at revision: 35
Proposed branch: lp:~donadigo/wingpanel-indicator-bluetooth/use-appinfo
Merge into: lp:~wingpanel-devs/wingpanel-indicator-bluetooth/trunk
Diff against target: 45 lines (+16/-6)
1 file modified
src/Widgets/Views/MainView.vala (+16/-6)
To merge this branch: bzr merge lp:~donadigo/wingpanel-indicator-bluetooth/use-appinfo
Reviewer Review Type Date Requested Status
WingPanel Devs Pending
Review via email: mp+293789@code.launchpad.net

Commit message

* Fix bug #1575376: "Use GLib.AppInfo.launch instead of granite simple command to open system settings".

Description of the change

Fixes bug #1575376: "Use GLib.AppInfo.launch instead of granite simple command to open system settings".

Use AppInfo instead of SimpleCommand to launch Switchboard.

To post a comment you must log in.
36. By Adam Bieńkowski

Remove unused variable; use appinfo for bluetooth wizard

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/Views/MainView.vala'
2--- src/Widgets/Views/MainView.vala 2016-05-01 00:07:29 +0000
3+++ src/Widgets/Views/MainView.vala 2016-05-04 14:44:43 +0000
4@@ -20,8 +20,6 @@
5 public signal void device_requested (Bluetooth.Services.Device device);
6 public signal void discovery_requested ();
7
8- private const string SETTINGS_EXEC = "switchboard bluetooth";
9-
10 private Wingpanel.Widgets.Button show_settings_button;
11 private Wingpanel.Widgets.Button discovery_button;
12 private Wingpanel.Widgets.Switch main_switch;
13@@ -59,8 +57,13 @@
14
15 discovery_button.clicked.connect (() => {
16 request_close ();
17- var cmd = new Granite.Services.SimpleCommand ("/usr/bin", "bluetooth-wizard");
18- cmd.run ();
19+
20+ try {
21+ var appinfo = AppInfo.create_from_commandline ("bluetooth-wizard", null, AppInfoCreateFlags.SUPPORTS_URIS);
22+ appinfo.launch_uris (null, null);
23+ } catch (Error e) {
24+ warning ("%s\n", e.message);
25+ }
26 });
27
28 //Adapter's Connections
29@@ -110,7 +113,14 @@
30 }
31
32 private void show_settings () {
33- var cmd = new Granite.Services.SimpleCommand ("/usr/bin", SETTINGS_EXEC);
34- cmd.run ();
35+ var list = new List<string> ();
36+ list.append ("bluetooth");
37+
38+ try {
39+ var appinfo = AppInfo.create_from_commandline ("switchboard", null, AppInfoCreateFlags.SUPPORTS_URIS);
40+ appinfo.launch_uris (list, null);
41+ } catch (Error e) {
42+ warning ("%s\n", e.message);
43+ }
44 }
45 }

Subscribers

People subscribed via source and target branches