[gitg] Drop default value of non-automatic property for newer vala



commit c2a4e98c3e741dc3d6f4a2b2255c79ae66c7d373
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Apr 24 10:07:57 2018 +0200

    Drop default value of non-automatic property for newer vala
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795500

 gitg/commit/gitg-commit-dialog.vala            |   16 ++++++----------
 gitg/gitg-dash-view.vala                       |    4 ++--
 libgitg/gitg-diff-image-overlay.vala           |    5 ++++-
 libgitg/gitg-diff-image-slider.vala            |    5 ++++-
 libgitg/gitg-diff-view-commit-details.vala     |    3 ++-
 libgitg/gitg-diff-view-file-renderer-text.vala |    4 ++--
 libgitg/gitg-diff-view.vala                    |    7 +++++--
 libgitg/gitg-repository-list-box.vala          |    3 +--
 8 files changed, 26 insertions(+), 21 deletions(-)
---
diff --git a/gitg/commit/gitg-commit-dialog.vala b/gitg/commit/gitg-commit-dialog.vala
index 2d3eaab..84bd981 100644
--- a/gitg/commit/gitg-commit-dialog.vala
+++ b/gitg/commit/gitg-commit-dialog.vala
@@ -185,8 +185,6 @@ class Dialog : Gtk.Dialog
                        d_show_markup = value;
                        update_highlight();
                }
-
-               default = true;
        }
 
        public bool show_right_margin
@@ -198,8 +196,6 @@ class Dialog : Gtk.Dialog
                        d_show_right_margin = value;
                        update_highlight();
                }
-
-               default = true;
        }
 
        public bool show_subject_margin
@@ -211,8 +207,6 @@ class Dialog : Gtk.Dialog
                        d_show_subject_margin = value;
                        update_highlight();
                }
-
-               default = true;
        }
 
        public int right_margin_position
@@ -224,8 +218,6 @@ class Dialog : Gtk.Dialog
                        d_right_margin_position = value;
                        update_highlight();
                }
-
-               default = 72;
        }
 
        public int subject_margin_position
@@ -237,8 +229,6 @@ class Dialog : Gtk.Dialog
                        d_subject_margin_position = value;
                        update_highlight();
                }
-
-               default = 50;
        }
 
        public Ggit.Signature author
@@ -495,6 +485,12 @@ class Dialog : Gtk.Dialog
                                        "use-gravatar",
                                        SettingsBindFlags.GET);
 
+               show_markup = true;
+               show_right_margin = true;
+               show_subject_margin = true;
+               right_margin_position = 72;
+               subject_margin_position = 50;
+
                d_constructed = true;
 
                init_message_area();
diff --git a/gitg/gitg-dash-view.vala b/gitg/gitg-dash-view.vala
index 0f2415b..a5e2923 100644
--- a/gitg/gitg-dash-view.vala
+++ b/gitg/gitg-dash-view.vala
@@ -141,8 +141,6 @@ class DashView : Gtk.Grid, GitgExt.UIElement, GitgExt.Activity, GitgExt.Selectab
                                update_search_text();
                        }
                }
-
-               default = "";
        }
 
        public Gtk.Entry? search_entry
@@ -243,6 +241,8 @@ class DashView : Gtk.Grid, GitgExt.UIElement, GitgExt.Activity, GitgExt.Selectab
 
                        whenMapped = null;
                });
+
+               search_text = "";
        }
 
        private void update_setup_profile_visibility()
diff --git a/libgitg/gitg-diff-image-overlay.vala b/libgitg/gitg-diff-image-overlay.vala
index b74218b..77e69c3 100644
--- a/libgitg/gitg-diff-image-overlay.vala
+++ b/libgitg/gitg-diff-image-overlay.vala
@@ -35,8 +35,11 @@ class Gitg.DiffImageOverlay : DiffImageComposite
                                queue_draw();
                        }
                }
+       }
 
-               default = 0.5;
+       construct
+       {
+               alpha = 0.5;
        }
 
        protected override bool draw(Cairo.Context cr)
diff --git a/libgitg/gitg-diff-image-slider.vala b/libgitg/gitg-diff-image-slider.vala
index 4179f1d..4c7600f 100644
--- a/libgitg/gitg-diff-image-slider.vala
+++ b/libgitg/gitg-diff-image-slider.vala
@@ -35,8 +35,11 @@ class Gitg.DiffImageSlider : DiffImageComposite
                                queue_draw();
                        }
                }
+       }
 
-               default = 0.5;
+       construct
+       {
+               position = 0.5;
        }
 
        protected override bool draw(Cairo.Context cr)
diff --git a/libgitg/gitg-diff-view-commit-details.vala b/libgitg/gitg-diff-view-commit-details.vala
index 3927d83..254844e 100644
--- a/libgitg/gitg-diff-view-commit-details.vala
+++ b/libgitg/gitg-diff-view-commit-details.vala
@@ -132,7 +132,6 @@ class Gitg.DiffViewCommitDetails : Gtk.Grid
                        d_use_gravatar = value;
                        update_avatar();
                }
-               default = true;
        }
 
        private Gee.HashMap<Ggit.OId, Gtk.RadioButton> d_parents_map;
@@ -151,6 +150,8 @@ class Gitg.DiffViewCommitDetails : Gtk.Grid
 
                        notify_property("expanded");
                });
+
+               use_gravatar = true;
        }
 
        protected override void dispose()
diff --git a/libgitg/gitg-diff-view-file-renderer-text.vala b/libgitg/gitg-diff-view-file-renderer-text.vala
index 0ddae6d..ee7b2b5 100644
--- a/libgitg/gitg-diff-view-file-renderer-text.vala
+++ b/libgitg/gitg-diff-view-file-renderer-text.vala
@@ -108,8 +108,6 @@ class Gitg.DiffViewFileRendererText : Gtk.SourceView, DiffSelectable, DiffViewFi
                                update_highlight();
                        }
                }
-
-               default = true;
        }
        
        private bool d_has_selection;
@@ -210,6 +208,8 @@ class Gitg.DiffViewFileRendererText : Gtk.SourceView, DiffSelectable, DiffViewFi
                }
 
                d_lines = new Gee.HashMap<int, PatchSet.Patch?>();
+
+               highlight = true;
        }
 
        protected override void dispose()
diff --git a/libgitg/gitg-diff-view.vala b/libgitg/gitg-diff-view.vala
index 2865775..53b761d 100644
--- a/libgitg/gitg-diff-view.vala
+++ b/libgitg/gitg-diff-view.vala
@@ -182,8 +182,6 @@ public class Gitg.DiffView : Gtk.Grid
                                options_changed();
                        }
                }
-
-               default = 3;
        }
 
        protected override void constructed()
@@ -242,6 +240,11 @@ public class Gitg.DiffView : Gtk.Grid
                } catch (Error e) { stderr.printf(@"Failed to compile regex: $(e.message)\n"); }
        }
 
+       construct
+       {
+               context_lines = 3;
+       }
+
        private string message_without_subject(Commit commit)
        {
                var message = commit.get_message();
diff --git a/libgitg/gitg-repository-list-box.vala b/libgitg/gitg-repository-list-box.vala
index 81d933c..4107255 100644
--- a/libgitg/gitg-repository-list-box.vala
+++ b/libgitg/gitg-repository-list-box.vala
@@ -36,7 +36,7 @@ namespace Gitg
                public class Row : Gtk.ListBoxRow
                {
                        private Repository? d_repository;
-                       private DateTime d_time;
+                       private DateTime d_time = new DateTime.now_local();
                        private bool d_loading;
                        [GtkChild]
                        private ProgressBin d_progress_bin;
@@ -112,7 +112,6 @@ namespace Gitg
                        {
                                get { return d_time; }
                                set { d_time = value; }
-                               default = new DateTime.now_local();
                        }
 
                        public double fraction


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