diff options
author | fiaxh <git@lightrise.org> | 2021-10-12 17:54:00 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-10-12 19:53:22 +0200 |
commit | b71196ef073dc1c49f4e42c0380b553286fe426c (patch) | |
tree | 2315ac1c5a2410b290646d9a4a3696e4bd40c5ae | |
parent | 9285fd07bf555fdf46954c4adfa58751e44633a3 (diff) | |
download | dino-b71196ef073dc1c49f4e42c0380b553286fe426c.tar.gz dino-b71196ef073dc1c49f4e42c0380b553286fe426c.zip |
Fix compiler warnings ('passing argument .. from incompatible pointer type') by passing (non)const argument
-rw-r--r-- | libdino/src/service/blocking_manager.vala | 4 | ||||
-rw-r--r-- | main/src/ui/application.vala | 16 | ||||
-rw-r--r-- | xmpp-vala/src/module/xep/0191_blocking_command.vala | 10 |
3 files changed, 18 insertions, 12 deletions
diff --git a/libdino/src/service/blocking_manager.vala b/libdino/src/service/blocking_manager.vala index 183c8a9e..aa07f990 100644 --- a/libdino/src/service/blocking_manager.vala +++ b/libdino/src/service/blocking_manager.vala @@ -27,12 +27,12 @@ public class BlockingManager : StreamInteractionModule, Object { public void block(Account account, Jid jid) { XmppStream stream = stream_interactor.get_stream(account); - stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).block(stream, new ArrayList<string>.wrap(new string[] {jid.to_string()})); + stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).block(stream, { jid.to_string() }); } public void unblock(Account account, Jid jid) { XmppStream stream = stream_interactor.get_stream(account); - stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).unblock(stream, new ArrayList<string>.wrap(new string[] {jid.to_string()})); + stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).unblock(stream, { jid.to_string() }); } public bool is_supported(Account account) { 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 = {"<Ctrl>Q", null}; + private const string[] KEY_COMBINATION_ADD_CHAT = {"<Ctrl>T", null}; + private const string[] KEY_COMBINATION_ADD_CONFERENCE = {"<Ctrl>G", null}; + private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS = {"<Ctrl>Tab", null}; + private const string[] KEY_COMBINATION_LOOP_CONVERSATIONS_REV = {"<Ctrl><Shift>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[]{"<Ctrl>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[]{"<Ctrl>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[]{"<Ctrl>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[]{"<Ctrl>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[]{"<Ctrl><Shift>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) => { diff --git a/xmpp-vala/src/module/xep/0191_blocking_command.vala b/xmpp-vala/src/module/xep/0191_blocking_command.vala index be312581..987f538a 100644 --- a/xmpp-vala/src/module/xep/0191_blocking_command.vala +++ b/xmpp-vala/src/module/xep/0191_blocking_command.vala @@ -15,8 +15,8 @@ public class Module : XmppStreamModule, Iq.Handler { return stream.get_flag(Flag.IDENTITY).blocklist.contains(jid); } - public bool block(XmppStream stream, Gee.List<string> jids) { - if (jids.size == 0) return false; // This would otherwise be a bad-request error. + public bool block(XmppStream stream, string[] jids) { + if (jids.length == 0) return false; // This would otherwise be a bad-request error. StanzaNode block_node = new StanzaNode.build("block", NS_URI).add_self_xmlns(); fill_node_with_items(block_node, jids); @@ -25,8 +25,8 @@ public class Module : XmppStreamModule, Iq.Handler { return true; } - public bool unblock(XmppStream stream, Gee.List<string> jids) { - if (jids.size == 0) return false; // This would otherwise unblock all blocked JIDs. + public bool unblock(XmppStream stream, string[] jids) { + if (jids.length == 0) return false; // This would otherwise unblock all blocked JIDs. StanzaNode unblock_node = new StanzaNode.build("unblock", NS_URI).add_self_xmlns(); fill_node_with_items(unblock_node, jids); @@ -112,7 +112,7 @@ public class Module : XmppStreamModule, Iq.Handler { return jids; } - private void fill_node_with_items(StanzaNode node, Gee.List<string> jids) { + private void fill_node_with_items(StanzaNode node, string[] jids) { foreach (string jid in jids) { StanzaNode item_node = new StanzaNode.build("item", NS_URI).add_self_xmlns(); item_node.set_attribute("jid", jid, NS_URI); |