Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool nautilus_sendto_installed = Environment.find_program_in_path(SENDTO_EXEC) != null;
- if (!nautilus_sendto_installed)
- {
- DBus.Connection connection;
- try {
- connection = DBus.Bus.get (DBus.BusType.SESSION);
- } catch (DBus.Error error) {
- warning ("Error: %s\n", error.message);
- return;
- };
- DBus.Object object = connection.get_object ("org.freedesktop.PackageKit",
- "org/freedesktop/PackageKit",
- "org.freedesktop.PackageKit.Modify");
- GLib.Error error;
- if (!object.call ("InstallPackageNames", out error,
- typeof (string), "nautilus-sendto",
- typeof (string), "",
- GLib.Type.INVALID, GLib.Type.INVALID))
- {
- warning ("Error: %s\n", error.message);
- return;
- }
- }
Add Comment
Please, Sign In to add comment