[polari] utils: Use Gtk.show_uri() to open URLs



commit b3d2b97dc1e35da49b04bbaa5084e642d278b348
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Oct 17 18:18:10 2016 +0200

    utils: Use Gtk.show_uri() to open URLs
    
    Gtk already provides a convenience method for launching a URL with
    a timestamp, use it.

 src/utils.js |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/src/utils.js b/src/utils.js
index 97c680b..db87177 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -159,10 +159,8 @@ function findChannels(str, server) {
 }
 
 function openURL(url, timestamp) {
-    let ctx = Gdk.Display.get_default().get_app_launch_context();
-    ctx.set_timestamp(timestamp);
     try {
-        Gio.AppInfo.launch_default_for_uri(url, ctx);
+        Gtk.show_uri (Gdk.Screen.get_default(), url, timestamp);
     } catch(e) {
         let n = new AppNotifications.SimpleOutput(_("Failed to open link"));
         let app = Gio.Application.get_default();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]