[vala/0.36: 177/212] Don't warn about unused internal methods which are meant to be visible on DBus



commit c6c288a4a2287112f0a2d972ad9449bbcf9bc282
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Feb 13 10:37:03 2018 +0100

    Don't warn about unused internal methods which are meant to be visible on DBus
    
    https://bugzilla.gnome.org/show_bug.cgi?id=593902

 vala/valaflowanalyzer.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala
index 9f94a42..07b2ad5 100644
--- a/vala/valaflowanalyzer.vala
+++ b/vala/valaflowanalyzer.vala
@@ -168,6 +168,9 @@ public class Vala.FlowAnalyzer : CodeVisitor {
                    && !(m is CreationMethod)) {
                        if (!m.is_private_symbol () && (context.internal_header_filename != null || 
context.use_fast_vapi)) {
                                // do not warn if internal member may be used outside this compilation unit
+                       } else if (m.parent_symbol != null && m.parent_symbol.get_attribute ("DBus") != null
+                           && m.get_attribute_bool ("DBus", "visible", true)) {
+                               // do not warn if internal member is a visible DBus method
                        } else {
                                Report.warning (m.source_reference, "method `%s' never used".printf 
(m.get_full_name ()));
                        }


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