Merge lp:~donadigo/slingshot/fix-show-uri-warning into lp:~elementary-pantheon/slingshot/trunk

Proposed by Adam Bieńkowski on 2017-01-02
Status: Merged
Approved by: Cody Garver on 2017-01-02
Approved revision: 712
Merged at revision: 712
Proposed branch: lp:~donadigo/slingshot/fix-show-uri-warning
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 15 lines (+5/-1)
1 file modified
lib/synapse-plugins/switchboard-plugin.vala (+5/-1)
To merge this branch: bzr merge lp:~donadigo/slingshot/fix-show-uri-warning
Reviewer Review Type Date Requested Status
elementary Pantheon team 2017-01-02 Pending
Review via email: mp+313973@code.launchpad.net

Commit message

Fix Gtk.show_uri compilation warning

Description of the change

This branch fixes a warning for Gtk.show_uri. Handles the error properly.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/synapse-plugins/switchboard-plugin.vala'
2--- lib/synapse-plugins/switchboard-plugin.vala 2016-12-28 16:21:42 +0000
3+++ lib/synapse-plugins/switchboard-plugin.vala 2017-01-02 23:11:39 +0000
4@@ -54,7 +54,11 @@
5 }
6
7 public void execute (Match? match) {
8- Gtk.show_uri (null, "settings://%s".printf (uri), Gdk.CURRENT_TIME);
9+ try {
10+ Gtk.show_uri (null, "settings://%s".printf (uri), Gdk.CURRENT_TIME);
11+ } catch (Error e) {
12+ warning ("Failed to show URI for %s: %s\n".printf (uri, e.message));
13+ }
14 }
15 }
16

Subscribers

People subscribed via source and target branches