Get rid of some deprecation warnings

This commit is contained in:
Niels De Graef 2017-07-18 11:40:36 +02:00
parent 4e9a0a91fa
commit 51de2b085b
4 changed files with 6 additions and 12 deletions

View file

@ -1,4 +1,3 @@
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
*
* This program is free software; you can redistribute it and/or modify
@ -65,7 +64,8 @@ public class Contacts.AddressMap : Frame {
if (maps_info != null) {
/* Set cursor as HAND1 to indicate the map is clickable */
map.realize.connect (() => {
map.get_window ().set_cursor (new Cursor (CursorType.HAND1));
var hand_cursor = new Cursor.for_display (Display.get_default (), CursorType.HAND1);
map.get_window ().set_cursor (hand_cursor);
});
map.button_press_event.connect(() => {

View file

@ -1,4 +1,3 @@
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
* Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
*
@ -114,9 +113,7 @@ public class Contacts.App : Gtk.Application {
public void show_help () {
try {
Gtk.show_uri (window.get_screen (),
"help:gnome-help/contacts",
Gtk.get_current_event_time ());
Gtk.show_uri_on_window (window, "help:gnome-help/contacts", Gtk.get_current_event_time ());
} catch (GLib.Error e1) {
warning ("Error showing help: %s", e1.message);
}
@ -173,7 +170,7 @@ public class Contacts.App : Gtk.Application {
}
private void create_app_menu () {
this.add_action_entries (this.action_entries, this);
this.add_action_entries (action_entries, this);
this.set_accels_for_action ("app.help", {"F1"});
this.set_accels_for_action ("app.new-contact", {"<Primary>n"});
@ -297,7 +294,7 @@ public class Contacts.App : Gtk.Application {
private static string individual_id = null;
private static string email_address = null;
private static string search_terms = null;
private static const OptionEntry[] options = {
private const OptionEntry[] options = {
{ "individual", 'i', 0, OptionArg.STRING, ref individual_id,
N_("Show contact with this individual id"), null },
{ "email", 'e', 0, OptionArg.STRING, ref email_address,

View file

@ -1,4 +1,3 @@
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
* Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
*
@ -148,7 +147,7 @@ public class Center : Bin {
public class Contacts.Utils : Object {
public static void compose_mail (string email) {
try {
Gtk.show_uri (null, "mailto:" + Uri.escape_string (email, "@" , false), 0);
Gtk.show_uri_on_window (null, "mailto:" + Uri.escape_string (email, "@" , false), 0);
} catch {
}
}

View file

@ -1,4 +1,3 @@
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
* Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
*
@ -86,7 +85,6 @@ public class Contacts.View : ListBox {
int nr_contacts_marked = 0;
string []? filter_values;
TextDisplay text_display = TextDisplay.PRESENCE;
bool selectors_visible = false;
private Store _store;