Move construction of ExternalApplications inside the class

This commit is contained in:
Christian Dywan 2010-05-14 22:17:37 +02:00
parent 0189921974
commit 25a08b36ee

View file

@ -17,10 +17,10 @@ public class ExternalApplications : Midori.Extension {
Dialog? dialog; Dialog? dialog;
bool launch (string command, string uri) { bool launch (string command, string uri) {
try { try {
var info = GLib.AppInfo.create_from_commandline (command, null, 0); var info = GLib.AppInfo.create_from_commandline (command, "", 0);
var uris = new List<string>(); var uris = new List<string>();
uris.prepend (uri); uris.prepend (uri);
info.launch_uris (uris, null); info.launch_uris (uris, new GLib.AppLaunchContext ());
return true; return true;
} }
catch (GLib.Error error) { catch (GLib.Error error) {
@ -90,17 +90,16 @@ public class ExternalApplications : Midori.Extension {
} }
} }
internal ExternalApplications () { internal ExternalApplications () {
GLib.Object (name: "External Applications",
description: "Associate URL schemes with external commands",
version: "0.1",
authors: "Christian Dywan <christian@twotoasts.de>");
activate.connect (activated); activate.connect (activated);
deactivate.connect (deactivated); deactivate.connect (deactivated);
} }
} }
public Midori.Extension extension_init () { public Midori.Extension extension_init () {
var extension = new ExternalApplications (); return new ExternalApplications ();
extension.name = "External Applications";
extension.description = "Lalala";
extension.version = "0.1";
extension.authors = "Christian Dywan <christian@twotoasts.de>";
return extension;
} }