[vala/1270-remove-static-codecontext-access] VersionAttribute: use context's report methods



commit c16d3eb0f46df8654fdb34e69e578e14f593e179
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Dec 29 08:57:27 2021 -0600

    VersionAttribute: use context's report methods
    
    Avoids use static Report's methods

 vala/valaversionattribute.vala | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vala/valaversionattribute.vala b/vala/valaversionattribute.vala
index 9ef5e0e91..283e0a6a3 100644
--- a/vala/valaversionattribute.vala
+++ b/vala/valaversionattribute.vala
@@ -153,7 +153,7 @@ public class Vala.VersionAttribute {
                        string? package_version = symbol.source_reference.file.installed_version;
 
                        if (!context.deprecated && (package_version == null || deprecated_since == null || 
VersionAttribute.cmp_versions (package_version, deprecated_since) >= 0)) {
-                               Report.deprecated (source_ref, "`%s' %s%s", symbol.get_full_name (), 
(deprecated_since == null) ? "is deprecated" : "has been deprecated since %s".printf (deprecated_since), 
(replacement == null) ? "" : ". Use %s".printf (replacement));
+                               context.report.log_deprecated (source_ref, "`%s' %s%s", symbol.get_full_name 
(), (deprecated_since == null) ? "is deprecated" : "has been deprecated since %s".printf (deprecated_since), 
(replacement == null) ? "" : ". Use %s".printf (replacement));
                        }
                        result = true;
                }
@@ -165,7 +165,7 @@ public class Vala.VersionAttribute {
                        if (context.since_check && package_version != null && VersionAttribute.cmp_versions 
(package_version, since) < 0) {
                                unowned string filename = symbol.source_reference.file.filename;
                                string pkg = Path.get_basename (filename[0:filename.last_index_of_char 
('.')]);
-                               Report.error (source_ref, "`%s' is not available in %s %s. Use %s >= %s", 
symbol.get_full_name (), pkg, package_version, pkg, since);
+                               context.report.log_error (source_ref, "`%s' is not available in %s %s. Use %s 
= %s", symbol.get_full_name (), pkg, package_version, pkg, since);
                        }
                        result = true;
                }
@@ -177,7 +177,7 @@ public class Vala.VersionAttribute {
                                string? experimental_until = this.experimental_until;
 
                                if (experimental_until == null || package_version == null || 
VersionAttribute.cmp_versions (package_version, experimental_until) < 0) {
-                                       Report.experimental (source_ref, "`%s' is experimental%s", 
symbol.get_full_name (), (experimental_until != null) ? " until %s".printf (experimental_until) : "");
+                                       context.report.log_experimental (source_ref, "`%s' is 
experimental%s", symbol.get_full_name (), (experimental_until != null) ? " until %s".printf 
(experimental_until) : "");
                                }
                        }
                        result = true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]