From 0816105028c26965e37c9afc7c598854f3fecde1 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Tue, 26 Oct 2021 15:03:25 -0700 Subject: [PATCH] Adhere to GLib.Object naming conventions for properties Vala now validates property names against GLib.Object conventions, this fixes a compilation error as a result of this enforcement: ../src/API/Status.vala:27.5-27.23: error: Name `_url' is not valid for a GLib.Object property public string? _url { get; set; } ^^^^^^^^^^^^^^^^^^^ Relevant Vala change: https://gitlab.gnome.org/GNOME/vala/-/commit/38d61fbff037687ea4772e6df85c7e22a74b335e fixes #337 Signed-off-by: Clayton Craft --- src/API/Attachment.vala | 6 +++--- src/API/Status.vala | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/API/Attachment.vala b/src/API/Attachment.vala index 88bc5bb..35c4018 100644 --- a/src/API/Attachment.vala +++ b/src/API/Attachment.vala @@ -4,10 +4,10 @@ public class Tootle.API.Attachment : Entity, Widgetizable { public string kind { get; set; default = "unknown"; } public string url { get; set; } public string? description { get; set; } - public string? _preview_url { get; set; } + private string? t_preview_url { get; set; } public string? preview_url { - set { this._preview_url = value; } - get { return (this._preview_url == null || this._preview_url == "") ? url : _preview_url; } + set { this.t_preview_url = value; } + get { return (this.t_preview_url == null || this.t_preview_url == "") ? url : t_preview_url; } } public File? source_file { get; set; } diff --git a/src/API/Status.vala b/src/API/Status.vala index 4f92cdb..00e8a9f 100644 --- a/src/API/Status.vala +++ b/src/API/Status.vala @@ -28,16 +28,16 @@ public class Tootle.API.Status : Entity, Widgetizable { public ArrayList? mentions { get; set; default = null; } public ArrayList? media_attachments { get; set; default = null; } - public string? _url { get; set; } + private string? t_url { get; set; } public string url { owned get { return this.get_modified_url (); } - set { this._url = value; } + set { this.t_url = value; } } string get_modified_url () { - if (this._url == null) { + if (this.t_url == null) { return this.uri.replace ("/activity", ""); } - return this._url; + return this.t_url; } public Status formal { 'formatted-message' instead of '&message' where appropriate....* gnu.scm (%try-use-modules): Use 'formatted-message' instead of '&message'. * gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error): Likewise. * gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise. (machine-check-building-for-appropriate-system): Likewise. (deploy-managed-host): Likewise. (maybe-raise-unsupported-configuration-error): Likewise. * gnu/packages.scm (search-patch): Likewise. * gnu/services.scm (%service-with-default-value): Likewise. (files->etc-directory): Likewise. (fold-services): Likewise. * gnu/system.scm (locale-name->definition*): Likewise. * gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise. (check-luks-device): Likewise. * guix/channels.scm (latest-channel-instance): Likewise. * guix/cve.scm (json->cve-items): Likewise. * guix/git-authenticate.scm (commit-signing-key): Likewise. (commit-authorized-keys): Likewise. (authenticate-commit): Likewise. (verify-introductory-commit): Likewise. * guix/remote.scm (remote-pipe-for-gexp): Likewise. * guix/scripts/graph.scm (assert-package): Likewise. * guix/scripts/offload.scm (private-key-from-file*): Likewise. * guix/ssh.scm (authenticate-server*): Likewise. (open-ssh-session): Likewise. (remote-inferior): Likewise. * guix/ui.scm (matching-generations): Likewise. * guix/upstream.scm (package-update): Likewise. * tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"): Catch 'formatted-message?'. ("authenticate-channel, wrong first commit signer"): Likewise. * tests/lint.scm ("patches: not found"): Adjust message string. * tests/packages.scm ("patch not found yields a run-time error"): Catch 'formatted-message?'. * guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'. (check-derivation): Ditto. Ludovic Courtès 2020-07-25utils: Move '&fix-hint' to (guix diagnostics)....* guix/utils.scm (&fix-hint): Move to... * guix/diagnostics.scm (&fix-hint): ... here. * gnu.scm: Adjust imports accordingly. * gnu/system/mapped-devices.scm: Likewise. * guix/channels.scm: Likewise. * guix/profiles.scm: Likewise. * guix/scripts/system/reconfigure.scm: Likewise. * guix/ssh.scm: Likewise. Ludovic Courtès 2020-07-25utils: Move <location> and '&error-location' to (guix diagnostics)....* guix/utils.scm (<location>, source-properties->location) (location->source-properties, &error-location): Move to... * guix/diagnostics.scm: ... here. * gnu.scm: Adjust imports accordingly. * gnu/machine.scm: Likewise. * gnu/system.scm: Likewise. * gnu/tests.scm: Likewise. * guix/inferior.scm: Likewise. * tests/channels.scm: Likewise. * tests/packages.scm: Likewise. Ludovic Courtès