Fixed notiModel compile warnings

This commit is contained in:
Erik Reider
2022-05-07 15:34:17 +02:00
parent f848b57018
commit 2a07bd7487
2 changed files with 5 additions and 5 deletions

View File

@@ -98,14 +98,14 @@ namespace SwayNotificationCenter {
priv_value = value.clamp (0, 100); priv_value = value.clamp (0, 100);
} }
} }
private int ? priv_value { private get; private set; } private int priv_value { private get; private set; }
public bool has_synch { public get; private set; } public bool has_synch { public get; private set; }
// Custom hints // Custom hints
/** Disables scripting for notification */ /** Disables scripting for notification */
public bool swaync_no_script { get; set; } public bool swaync_no_script { get; set; }
public Action[] actions { get; set; } public Array<Action> actions { get; set; }
/** If the notification replaces another */ /** If the notification replaces another */
public bool replaces { get; set; } public bool replaces { get; set; }
@@ -134,7 +134,7 @@ namespace SwayNotificationCenter {
s_hints (); s_hints ();
Action[] ac_array = {}; Array<Action> ac_array = new Array<Action>();
if (actions.length > 1 && actions.length % 2 == 0) { if (actions.length > 1 && actions.length % 2 == 0) {
for (int i = 0; i < actions.length; i++) { for (int i = 0; i < actions.length; i++) {
var action = new Action (); var action = new Action ();
@@ -146,7 +146,7 @@ namespace SwayNotificationCenter {
if (action.identifier.down () == "default") { if (action.identifier.down () == "default") {
default_action = action; default_action = action;
} else { } else {
ac_array += action; ac_array.append_val (action);
} }
} }
i++; i++;

View File

@@ -297,7 +297,7 @@ namespace SwayNotificationCenter {
if (param.actions.length == 0 || index >= param.actions.length) { if (param.actions.length == 0 || index >= param.actions.length) {
return; return;
} }
action_clicked (param.actions[index]); action_clicked (param.actions.index (index));
} }
private void action_clicked (Action action, bool is_default = false) { private void action_clicked (Action action, bool is_default = false) {