diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 65cc3c208..23b1f0d16 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -38,7 +38,7 @@ public class Tasks.MainWindow : Hdy.ApplicationWindow { construct { add_action_entries (ACTION_ENTRIES, this); - var application_instance = (Gtk.Application) GLib.Application.get_default (); + unowned var application_instance = (Gtk.Application) GLib.Application.get_default (); foreach (var action in action_accelerators.get_keys ()) { application_instance.set_accels_for_action ( ACTION_PREFIX + action, action_accelerators[action].to_array () @@ -233,7 +233,7 @@ public class Tasks.MainWindow : Hdy.ApplicationWindow { var task_lists = registry.list_sources (E.SOURCE_EXTENSION_TASK_LIST); task_lists.foreach ((source) => { - E.SourceTaskList list = (E.SourceTaskList)source.get_extension (E.SOURCE_EXTENSION_TASK_LIST); + unowned var list = (E.SourceTaskList)source.get_extension (E.SOURCE_EXTENSION_TASK_LIST); if (list.selected == true && source.enabled == true && !source.has_extension (E.SOURCE_EXTENSION_COLLECTION)) { add_source (source); @@ -256,7 +256,7 @@ public class Tasks.MainWindow : Hdy.ApplicationWindow { try { var new_source = new E.Source (null, null); - var new_source_tasklist_extension = (E.SourceTaskList) new_source.get_extension (E.SOURCE_EXTENSION_TASK_LIST); + unowned var new_source_tasklist_extension = (E.SourceTaskList) new_source.get_extension (E.SOURCE_EXTENSION_TASK_LIST); new_source.display_name = _("New list"); new_source_tasklist_extension.color = "#0e9a83"; @@ -296,7 +296,7 @@ public class Tasks.MainWindow : Hdy.ApplicationWindow { } private void action_delete_selected_list () { - var list_row = ((Tasks.Widgets.SourceRow) listbox.get_selected_row ()); + unowned var list_row = ((Tasks.Widgets.SourceRow) listbox.get_selected_row ()); var source = list_row.source; if (Tasks.Application.model.is_remove_task_list_supported (source)) { @@ -310,7 +310,7 @@ public class Tasks.MainWindow : Hdy.ApplicationWindow { transient_for = this }; - unowned Gtk.Widget trash_button = message_dialog.add_button (_("Delete Anyway"), Gtk.ResponseType.YES); + unowned var trash_button = message_dialog.add_button (_("Delete Anyway"), Gtk.ResponseType.YES); trash_button.get_style_context ().add_class (Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION); message_dialog.response.connect ((response) => { @@ -421,7 +421,7 @@ public class Tasks.MainWindow : Hdy.ApplicationWindow { } private void update_source (E.Source source) { - E.SourceTaskList list = (E.SourceTaskList)source.get_extension (E.SOURCE_EXTENSION_TASK_LIST); + unowned var list = (E.SourceTaskList)source.get_extension (E.SOURCE_EXTENSION_TASK_LIST); if (list.selected != true || source.enabled != true) { remove_source (source); @@ -432,7 +432,7 @@ public class Tasks.MainWindow : Hdy.ApplicationWindow { } else { source_rows[source].update_request (); - var task_list_grid = (Tasks.Widgets.TaskListGrid) task_list_grid_stack.get_visible_child (); + unowned var task_list_grid = (Tasks.Widgets.TaskListGrid) task_list_grid_stack.get_visible_child (); if (task_list_grid != null) { task_list_grid.update_request (); } diff --git a/src/TaskModel.vala b/src/TaskModel.vala index 0973e4c8a..f7aa339c3 100644 --- a/src/TaskModel.vala +++ b/src/TaskModel.vala @@ -260,7 +260,7 @@ public class Tasks.TaskModel : Object { public async void add_task_list (E.Source task_list, E.Source collection_or_sibling) throws Error { var registry = get_registry_sync (); - var task_list_extension = (E.SourceTaskList) task_list.get_extension (E.SOURCE_EXTENSION_TASK_LIST); + unowned var task_list_extension = (E.SourceTaskList) task_list.get_extension (E.SOURCE_EXTENSION_TASK_LIST); var backend_name = get_collection_backend_name (collection_or_sibling, registry); switch (backend_name.down ()) { @@ -592,7 +592,7 @@ public class Tasks.TaskModel : Object { debug ("WebDAV Rename '%s'", task_list.get_uid ()); var collection_source_webdav_session = new E.WebDAVSession (collection_source); - var source_webdav_extension = (E.SourceWebdav) task_list.get_extension (E.SOURCE_EXTENSION_WEBDAV_BACKEND); + unowned var source_webdav_extension = (E.SourceWebdav) task_list.get_extension (E.SOURCE_EXTENSION_WEBDAV_BACKEND); var credentials_provider = new E.SourceCredentialsProvider (registry); E.NamedParameters credentials; @@ -676,7 +676,7 @@ public class Tasks.TaskModel : Object { if (!task_list.has_extension (E.SOURCE_EXTENSION_TASK_LIST)) { throw new Tasks.TaskModelError.INVALID_ARGUMENT ("Changing the color is not supported by this source."); } - var task_list_extension = (E.SourceTaskList) task_list.get_extension (E.SOURCE_EXTENSION_TASK_LIST); + unowned var task_list_extension = (E.SourceTaskList) task_list.get_extension (E.SOURCE_EXTENSION_TASK_LIST); var previous_color = task_list_extension.dup_color (); var registry = get_registry_sync (); @@ -700,7 +700,7 @@ public class Tasks.TaskModel : Object { debug ("Update %s color for '%s'", backend_name, task_list.get_uid ()); var collection_source_webdav_session = new E.WebDAVSession (collection_source); - var source_webdav_extension = (E.SourceWebdav) task_list.get_extension (E.SOURCE_EXTENSION_WEBDAV_BACKEND); + unowned var source_webdav_extension = (E.SourceWebdav) task_list.get_extension (E.SOURCE_EXTENSION_WEBDAV_BACKEND); var credentials_provider = new E.SourceCredentialsProvider (registry); E.NamedParameters credentials; @@ -750,7 +750,7 @@ public class Tasks.TaskModel : Object { public async void add_task (E.Source list, ECal.Component task) throws Error { ECal.Client client = get_client (list); - unowned ICal.Component comp = task.get_icalcomponent (); + unowned var comp = task.get_icalcomponent (); debug (@"Adding task '$(comp.get_uid())'"); @@ -764,7 +764,7 @@ public class Tasks.TaskModel : Object { public async void complete_task (E.Source list, ECal.Component task) throws Error { ECal.Client client = get_client (list); - unowned ICal.Component comp = task.get_icalcomponent (); + unowned var comp = task.get_icalcomponent (); var was_completed = comp.get_status () == ICal.PropertyStatus.COMPLETED; if (was_completed) { @@ -831,7 +831,7 @@ public class Tasks.TaskModel : Object { public async void update_task (E.Source list, ECal.Component task, ECal.ObjModType mod_type) throws Error { ECal.Client client = get_client (list); - unowned ICal.Component comp = task.get_icalcomponent (); + unowned var comp = task.get_icalcomponent (); debug (@"Updating task '$(comp.get_uid())' [mod_type=$(mod_type)]"); yield client.modify_object (comp, mod_type, ECal.OperationFlags.NONE, null); @@ -839,7 +839,7 @@ public class Tasks.TaskModel : Object { public async void remove_task (E.Source list, ECal.Component task, ECal.ObjModType mod_type) throws Error { ECal.Client client = get_client (list); - unowned ICal.Component comp = task.get_icalcomponent (); + unowned var comp = task.get_icalcomponent (); string uid = comp.get_uid (); string? rid = task.has_recurrences () ? null : task.get_recurid_as_string (); @@ -881,7 +881,7 @@ public class Tasks.TaskModel : Object { } private void debug_task (E.Source task_list, ECal.Component task) { - unowned ICal.Component comp = task.get_icalcomponent (); + unowned var comp = task.get_icalcomponent (); var task_summary = comp.get_summary (); var task_uid = comp.get_uid (); var task_list_display_name = task_list.dup_display_name (); diff --git a/src/Widgets/TaskListGrid.vala b/src/Widgets/TaskListGrid.vala index 7ad64c84c..f02d11c98 100644 --- a/src/Widgets/TaskListGrid.vala +++ b/src/Widgets/TaskListGrid.vala @@ -360,7 +360,7 @@ public class Tasks.Widgets.TaskListGrid : Gtk.Grid { } private void on_tasks_modified (Gee.Collection tasks) { - Tasks.Widgets.TaskRow task_row = null; + unowned Tasks.Widgets.TaskRow task_row = null; var row_index = 0; do {