[libgnome-games-support/arnaudb/wip/gtk4] Remove unused constructors.



commit a37fad43bf3f6a0c58c8712383f02d90a67d1477
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Jul 20 16:56:26 2020 +0200

    Remove unused constructors.

 games/scores/context.vala | 57 ++++++++++++++++-------------------------------
 tests/test-scores.vala    | 11 +++++----
 2 files changed, 26 insertions(+), 42 deletions(-)
---
diff --git a/games/scores/context.vala b/games/scores/context.vala
index 3fb9e68..83ba25f 100644
--- a/games/scores/context.vala
+++ b/games/scores/context.vala
@@ -68,49 +68,30 @@ public class Context : Object
         Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
     }
 
-    public Context (string app_name,
-                    string category_type,
-                    Gtk.Window? game_window,
+    public Context (string              app_name,
+                    string              icon_name,
+                    string              category_type,
+                    Gtk.Window?         game_window,
                     CategoryRequestFunc category_request,
-                    Style style)
+                    Style               style)
     {
-        this.with_importer_and_icon_name (app_name, category_type, game_window, category_request, style, 
null, null);
+        this.with_importer (app_name, icon_name, category_type, game_window, category_request, style, null);
     }
 
-    public Context.with_icon_name (string app_name,
-                                   string category_type,
-                                   Gtk.Window? game_window,
-                                   CategoryRequestFunc category_request,
-                                   Style style,
-                                   string icon_name)
+    public Context.with_importer (string                app_name,
+                                  string                icon_name,
+                                  string                category_type,
+                                  Gtk.Window?           game_window,
+                                  CategoryRequestFunc   category_request,
+                                  Style                 style,
+                                  Importer?             importer = null)
     {
-        this.with_importer_and_icon_name (app_name, category_type, game_window, category_request, style, 
null, icon_name);
-    }
-
-    public Context.with_importer (string app_name,
-                                  string category_type,
-                                  Gtk.Window? game_window,
-                                  CategoryRequestFunc category_request,
-                                  Style style,
-                                  Importer? importer)
-    {
-        this.with_importer_and_icon_name (app_name, category_type, game_window, category_request, style, 
importer, null);
-    }
-
-    public Context.with_importer_and_icon_name (string app_name,
-                                                string category_type,
-                                                Gtk.Window? game_window,
-                                                CategoryRequestFunc category_request,
-                                                Style style,
-                                                Importer? importer = null,
-                                                string? icon_name = null)
-    {
-        Object (app_name: app_name,
-                category_type: category_type,
-                game_window: game_window,
-                style: style,
-                importer: importer,
-                icon_name: icon_name ?? app_name);
+        Object (app_name:       app_name,
+                icon_name:      icon_name,
+                category_type:  category_type,
+                game_window:    game_window,
+                style:          style,
+                importer:       importer);
 
         /* Note: the following functionality can be performed manually by
          * calling Context.load_scores, to ensure Context is usable even if
diff --git a/tests/test-scores.vala b/tests/test-scores.vala
index e8e313c..3b6cf17 100644
--- a/tests/test-scores.vala
+++ b/tests/test-scores.vala
@@ -46,7 +46,7 @@ private void add_score_sync (Context context, int score, Category category) {
 
 private void create_scores ()
 {
-    Context context = new Context ("libgnome-games-support-test", "Games Type", null, category_request, 
Style.POINTS_GREATER_IS_BETTER);
+    Context context = new Context ("libgnome-games-support-test", /* icon */ "", "Games Type", null, 
category_request, Style.POINTS_GREATER_IS_BETTER);
     Category cat = new Category ("cat1", "cat1");
     add_score_sync (context, 101, cat);
     add_score_sync (context, 102, cat);
@@ -178,7 +178,8 @@ private void test_import_from_score_directory ()
 
         var context = new Context.with_importer (
             "libgnome-games-support-test",
-            "",
+            /* icon */ "",
+            /* type */ "",
             null,
             (key) => {
                 assert (key == "new-cat");
@@ -225,7 +226,8 @@ private void test_import_from_history_file ()
 
         var context = new Context.with_importer (
             "libgnome-games-support-test",
-            "",
+            /* icon */ "",
+            /* type */ "",
             null,
             (key) => {
                 assert (key == "new-cat");
@@ -256,7 +258,8 @@ private void test_import_from_nonexistent_history_file ()
 {
     (void) new Context.with_importer (
         "libgnome-games-support-test",
-        "",
+        /* icon */ "",
+        /* type */ "",
         null,
         (key) => {
             return null;


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