From abd4e8ca1595f56b61277704cd734722c46cfc44 Mon Sep 17 00:00:00 2001 From: Dan Breslau Date: Tue, 23 Aug 2016 10:02:04 -0400 Subject: [PATCH] Cleaning up compilation warnings --- src/moonshot-custom-vbox.vala | 2 +- src/moonshot-id.vala | 4 ++ src/moonshot-idcard-widget.vala | 2 +- src/moonshot-identity-dialog.vala | 14 ------- src/moonshot-identity-management-view.vala | 63 +++++++++++------------------- src/moonshot-local-flat-file-store.vala | 1 - src/moonshot-provisioning-common.vala | 2 +- src/moonshot-trust-anchor-dialog.vala | 2 - 8 files changed, 29 insertions(+), 61 deletions(-) diff --git a/src/moonshot-custom-vbox.vala b/src/moonshot-custom-vbox.vala index 49f0a6a..9a690ec 100644 --- a/src/moonshot-custom-vbox.vala +++ b/src/moonshot-custom-vbox.vala @@ -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) { diff --git a/src/moonshot-id.vala b/src/moonshot-id.vala index 522a820..b8e92a6 100644 --- a/src/moonshot-id.vala +++ b/src/moonshot-id.vala @@ -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"; diff --git a/src/moonshot-idcard-widget.vala b/src/moonshot-idcard-widget.vala index 09e9b6c..487b0e7 100644 --- a/src/moonshot-idcard-widget.vala +++ b/src/moonshot-idcard-widget.vala @@ -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; diff --git a/src/moonshot-identity-dialog.vala b/src/moonshot-identity-dialog.vala index df517b9..bb017fe 100644 --- a/src/moonshot-identity-dialog.vala +++ b/src/moonshot-identity-dialog.vala @@ -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"); diff --git a/src/moonshot-identity-management-view.vala b/src/moonshot-identity-management-view.vala index fb411d3..b10ff0c 100644 --- a/src/moonshot-identity-management-view.vala +++ b/src/moonshot-identity-management-view.vala @@ -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); diff --git a/src/moonshot-local-flat-file-store.vala b/src/moonshot-local-flat-file-store.vala index 9654682..e4c303c 100644 --- a/src/moonshot-local-flat-file-store.vala +++ b/src/moonshot-local-flat-file-store.vala @@ -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]; diff --git a/src/moonshot-provisioning-common.vala b/src/moonshot-provisioning-common.vala index c0b35c4..d780eeb 100644 --- a/src/moonshot-provisioning-common.vala +++ b/src/moonshot-provisioning-common.vala @@ -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, diff --git a/src/moonshot-trust-anchor-dialog.vala b/src/moonshot-trust-anchor-dialog.vala index aec8fda..20def57 100644 --- a/src/moonshot-trust-anchor-dialog.vala +++ b/src/moonshot-trust-anchor-dialog.vala @@ -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) -- 2.1.4