From b71196ef073dc1c49f4e42c0380b553286fe426c Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 12 Oct 2021 17:54:00 +0200 Subject: Fix compiler warnings ('passing argument .. from incompatible pointer type') by passing (non)const argument --- main/src/ui/application.vala | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'main') diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala index 780c37fd..bed6d01b 100644 --- a/main/src/ui/application.vala +++ b/main/src/ui/application.vala @@ -5,6 +5,12 @@ using Dino.Ui; using Xmpp; public class Dino.Ui.Application : Gtk.Application, Dino.Application { + private const string[] KEY_COMBINATION_QUIT = {"Q", null}; + private const string[] KEY_COMBINATION_ADD_CHAT = {"T", null}; + private const string[] KEY_COMBINATION_ADD_CONFERENCE = {"G", null}; + private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS = {"Tab", null}; + private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS_REV = {"Tab", null}; + private MainWindow window; public MainWindowController controller; @@ -116,7 +122,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { SimpleAction quit_action = new SimpleAction("quit", null); quit_action.activate.connect(quit); add_action(quit_action); - set_accels_for_action("app.quit", new string[]{"Q"}); + set_accels_for_action("app.quit", KEY_COMBINATION_QUIT); SimpleAction open_conversation_action = new SimpleAction("open-conversation", VariantType.INT32); open_conversation_action.activate.connect((variant) => { @@ -142,7 +148,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { add_chat_dialog.present(); }); add_action(contacts_action); - set_accels_for_action("app.add_chat", new string[]{"T"}); + set_accels_for_action("app.add_chat", KEY_COMBINATION_ADD_CHAT); SimpleAction conference_action = new SimpleAction("add_conference", null); conference_action.activate.connect(() => { @@ -151,7 +157,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { add_conference_dialog.present(); }); add_action(conference_action); - set_accels_for_action("app.add_conference", new string[]{"G"}); + set_accels_for_action("app.add_conference", KEY_COMBINATION_ADD_CONFERENCE); SimpleAction accept_muc_invite_action = new SimpleAction("open-muc-join", VariantType.INT32); accept_muc_invite_action.activate.connect((variant) => { @@ -175,12 +181,12 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application { SimpleAction loop_conversations_action = new SimpleAction("loop_conversations", null); loop_conversations_action.activate.connect(() => { window.loop_conversations(false); }); add_action(loop_conversations_action); - set_accels_for_action("app.loop_conversations", new string[]{"Tab"}); + set_accels_for_action("app.loop_conversations", KEY_COMBINATION_LOOP_CONVERSATIONS); SimpleAction loop_conversations_bw_action = new SimpleAction("loop_conversations_bw", null); loop_conversations_bw_action.activate.connect(() => { window.loop_conversations(true); }); add_action(loop_conversations_bw_action); - set_accels_for_action("app.loop_conversations_bw", new string[]{"Tab"}); + set_accels_for_action("app.loop_conversations_bw", KEY_COMBINATION_LOOP_CONVERSATIONS_REV); SimpleAction open_shortcuts_action = new SimpleAction("open_shortcuts", null); open_shortcuts_action.activate.connect((variant) => { -- cgit v1.2.3-70-g09d2