[vala/staging: 1/2] Don't warn about unused internal methods which are callbacks of GtkTemplate



commit f18b4341ac7c75568e46c404f556d6ea651d20eb
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue May 1 20:04:22 2018 +0200

    Don't warn about unused internal methods which are callbacks of GtkTemplate

 vala/valaflowanalyzer.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala
index ff7c03e..0ee764f 100644
--- a/vala/valaflowanalyzer.vala
+++ b/vala/valaflowanalyzer.vala
@@ -174,6 +174,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 ("GtkTemplate") 
!= null
+                           && m.get_attribute ("GtkCallback") != null) {
+                               // do not warn if internal member is a GtkCallback
                        } 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


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