Cleaning up compilation warnings
authorDan Breslau <dbreslau@painless-security.com>
Tue, 23 Aug 2016 14:02:04 +0000 (10:02 -0400)
committerDan Breslau <dbreslau@painless-security.com>
Tue, 23 Aug 2016 14:02:04 +0000 (10:02 -0400)
src/moonshot-custom-vbox.vala
src/moonshot-id.vala
src/moonshot-idcard-widget.vala
src/moonshot-identity-dialog.vala
src/moonshot-identity-management-view.vala
src/moonshot-local-flat-file-store.vala
src/moonshot-provisioning-common.vala
src/moonshot-trust-anchor-dialog.vala

index 49f0a6a..9a690ec 100644 (file)
@@ -67,7 +67,7 @@ class CustomVBox : VBox
         id_card_widget.position = next_pos++;
     }
 
-    public IdCardWidget find_idcard_widget(IdCard id_card) {
+    public IdCardWidget? find_idcard_widget(IdCard id_card) {
         foreach (var w in get_children()) {
             IdCardWidget widget = (IdCardWidget) w;
             if (widget.id_card.nai == id_card.nai) {
index 522a820..b8e92a6 100644 (file)
@@ -148,6 +148,10 @@ public class TrustAnchor : Object
 
     public string? get_expiration_date(out string? err_out=null)
     {
+        if (&err_out != null) {
+            err_out = null;
+        }
+
         if (this.ca_cert == "") {
             if (&err_out != null) {
                 err_out = "Trust anchor does not have a ca_certificate";
index 09e9b6c..487b0e7 100644 (file)
@@ -33,7 +33,7 @@ using Gtk;
 
 class IdCardWidget : Box
 {
-    static MoonshotLogger logger = get_logger("IdCardWidget");
+    // static MoonshotLogger logger = get_logger("IdCardWidget");
 
     private static const ShadowType ARROW_SHADOW = ShadowType.NONE;
 
index df517b9..bb017fe 100644 (file)
@@ -348,20 +348,6 @@ class IdentityDialog : Dialog
         }
     }
 
-    private static void label_make_bold(Label label)
-    {
-        var font_desc = new Pango.FontDescription();
-
-        font_desc.set_weight(Pango.Weight.BOLD);
-
-        /* This will only affect the weight of the font. The rest is
-         * from the current state of the widget, which comes from the
-         * theme or user prefs, since the font desc only has the
-         * weight flag turned on.
-         */
-        label.modify_font(font_desc);
-    }
-
     private VBox make_services_vbox()
     {
         logger.trace("make_services_vbox");
index fb411d3..b10ff0c 100644 (file)
@@ -48,10 +48,8 @@ public class IdentityManagerView : Window {
     #endif
     private UIManager ui_manager = new UIManager();
     private Entry search_entry;
-    private VBox vbox_right;
     private CustomVBox custom_vbox;
     private VBox service_prompt_vbox;
-    private Label no_identity_title;
     private Button edit_button;
     private Button remove_button;
 
@@ -189,8 +187,6 @@ public class IdentityManagerView : Window {
     {
         this.filter.refilter();
         redraw_id_card_widgets();
-
-        var has_text = this.search_entry.get_text_length() > 0;
     }
 
     private bool search_entry_key_press_event_cb(Gdk.EventKey e)
@@ -216,7 +212,7 @@ public class IdentityManagerView : Window {
         foreach (IdCard id_card in card_list) {
             logger.trace(@"load_id_cards: Loading card with display name '$(id_card.display_name)'");
             add_id_card_data(id_card);
-            IdCardWidget id_card_widget = add_id_card_widget(id_card);
+            add_id_card_widget(id_card);
         }
     }
     
@@ -251,27 +247,27 @@ public class IdentityManagerView : Window {
                        Columns.PASSWORD_COL, id_card.password);
     }
 
-    private void remove_id_card_data(IdCard id_card)
-    {
-        TreeIter iter;
-        string issuer;
-
-        if (listmodel->get_iter_first(out iter))
-        {
-            do
-            {
-                listmodel->get(iter,
-                               Columns.ISSUER_COL, out issuer);
-
-                if (id_card.issuer == issuer)
-                {
-                    listmodel->remove(iter);
-                    break;
-                }
-            }
-            while (listmodel->iter_next(ref iter));
-        }
-    }
+    // private void remove_id_card_data(IdCard id_card)
+    // {
+    //     TreeIter iter;
+    //     string issuer;
+
+    //     if (listmodel->get_iter_first(out iter))
+    //     {
+    //         do
+    //         {
+    //             listmodel->get(iter,
+    //                            Columns.ISSUER_COL, out issuer);
+
+    //             if (id_card.issuer == issuer)
+    //             {
+    //                 listmodel->remove(iter);
+    //                 break;
+    //             }
+    //         }
+    //         while (listmodel->iter_next(ref iter));
+    //     }
+    // }
 
     private IdCardWidget add_id_card_widget(IdCard id_card)
     {
@@ -623,21 +619,6 @@ public class IdentityManagerView : Window {
         return true;
     }
 
-
-    // private void label_make_bold(Label label)
-    // {
-    //     var font_desc = new Pango.FontDescription();
-
-    //     font_desc.set_weight(Pango.Weight.BOLD);
-
-    //     /* This will only affect the weight of the font, the rest is
-    //      * from the current state of the widget, which comes from the
-    //      * theme or user prefs, since the font desc only has the
-    //      * weight flag turned on.
-    //      */
-    //     label.modify_font(font_desc);
-    // }
-
     private void on_about_action()
     {
         string copyright = "Copyright (c) 2011, %d JANET".printf(LATEST_EDIT_YEAR);
index 9654682..e4c303c 100644 (file)
@@ -154,7 +154,6 @@ public class LocalFlatFileStore : Object, IIdentityCardStore {
 
             /* workaround for Centos vala array property bug: use temp arrays */
             var rules = id_card.rules;
-            string[] empty = {};
             string[] rules_patterns = new string[rules.length];
             string[] rules_always_conf = new string[rules.length];
             
index c0b35c4..d780eeb 100644 (file)
@@ -121,7 +121,7 @@ namespace WebProvisioning
 
     public class Parser : Object
     {
-        private static MoonshotLogger logger = new MoonshotLogger("WebProvisioning");
+        // private static MoonshotLogger logger = new MoonshotLogger("WebProvisioning");
 
         private void start_element_func(MarkupParseContext context,
                                         string element_name,
index aec8fda..20def57 100644 (file)
@@ -35,8 +35,6 @@ class TrustAnchorDialog : Dialog
 {
     private static Gdk.Color white = make_color(65535, 65535, 65535);
 
-    private Entry trust_anchor_entry;
-
     public bool complete = false;
 
     public TrustAnchorDialog(IdCard idcard, Window parent)