[glade/modern-ui: 6/31] GladeAdaptorChooser: add GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED flag



commit 85a1351b06b54175d0caa30e224a3ac16b937510
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Sat Jun 10 20:29:52 2017 -0300

    GladeAdaptorChooser: add GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED flag
    
    From now on the chooser will include deprecated classes by default.

 gladeui/glade-adaptor-chooser.c |    3 ++-
 gladeui/glade-adaptor-chooser.h |    7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gladeui/glade-adaptor-chooser.c b/gladeui/glade-adaptor-chooser.c
index f4e4d97..0a14425 100644
--- a/gladeui/glade-adaptor-chooser.c
+++ b/gladeui/glade-adaptor-chooser.c
@@ -186,7 +186,7 @@ store_populate (GtkListStore            *store,
               GType type = glade_widget_adaptor_get_object_type (adaptor);
 
               /* Skip deprecated adaptors and according to flags */
-              if (GWA_DEPRECATED (adaptor) ||
+              if ((flags & GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED && GWA_DEPRECATED (adaptor)) ||
                   (flags & GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL && GWA_IS_TOPLEVEL (adaptor)) ||
                   !((flags & GLADE_ADAPTOR_CHOOSER_WIDGET && g_type_is_a (type, GTK_TYPE_WIDGET)) ||
                     (flags & GLADE_ADAPTOR_CHOOSER_TOPLEVEL && GWA_IS_TOPLEVEL (adaptor))))
@@ -377,6 +377,7 @@ _glade_adaptor_chooser_flags_get_type (void)
             { GLADE_ADAPTOR_CHOOSER_WIDGET, "GLADE_ADAPTOR_CHOOSER_WIDGET", "widget" },
             { GLADE_ADAPTOR_CHOOSER_TOPLEVEL, "GLADE_ADAPTOR_CHOOSER_TOPLEVEL", "toplevel" },
             { GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL, "GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL", "skip-toplevel" },
+            { GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED, "GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED", 
"skip-deprecated" },
             { 0, NULL, NULL }
         };
         etype = g_flags_register_static (g_intern_static_string ("_GladeAdaptorChooserFlag"), values);
diff --git a/gladeui/glade-adaptor-chooser.h b/gladeui/glade-adaptor-chooser.h
index 8c33208..164befd 100644
--- a/gladeui/glade-adaptor-chooser.h
+++ b/gladeui/glade-adaptor-chooser.h
@@ -41,9 +41,10 @@ typedef struct _GladeAdaptorChooserPrivate _GladeAdaptorChooserPrivate;
 
 typedef enum
 {
-  GLADE_ADAPTOR_CHOOSER_WIDGET        = 1 << 0,
-  GLADE_ADAPTOR_CHOOSER_TOPLEVEL      = 1 << 1,
-  GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL = 1 << 2
+  GLADE_ADAPTOR_CHOOSER_WIDGET          = 1 << 0,
+  GLADE_ADAPTOR_CHOOSER_TOPLEVEL        = 1 << 1,
+  GLADE_ADAPTOR_CHOOSER_SKIP_TOPLEVEL   = 1 << 2,
+  GLADE_ADAPTOR_CHOOSER_SKIP_DEPRECATED = 1 << 3
 } _GladeAdaptorChooserFlags;
 
 struct _GladeAdaptorChooserClass


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