[gnome-nibbles/gnome-3-10] Get rid of scores again



commit 9b82b37d5d67685d6323a733c72361f3b72138d8
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Nov 6 08:06:19 2013 -0600

    Get rid of scores again
    
    There's no way to mitigate this string break. I guess we'll just not
    have scores for 3.10. They've been broken for so long that this is
    hardly a big deal.

 src/Makefile.am            |    6 -
 src/games-scores-backend.c |  352 -------------------------
 src/games-scores-backend.h |   67 -----
 src/games-scores-dialog.c  |  610 --------------------------------------------
 src/games-scores-dialog.h  |   81 ------
 src/games-scores.c         |   29 --
 src/games-scores.h         |    1 -
 src/games-setgid-io.c      |  558 ----------------------------------------
 src/games-setgid-io.h      |   38 ---
 src/gnibbles.c             |   28 +--
 src/main.c                 |   12 -
 11 files changed, 4 insertions(+), 1778 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 6bfbcda..9df28c3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,12 +21,6 @@ gnome_nibbles_SOURCES = \
        games-score.c                   \
        games-scores.c                  \
        games-scores.h                  \
-       games-scores-dialog.c   \
-       games-scores-dialog.h   \
-       games-scores-backend.c  \
-       games-scores-backend.h  \
-       games-setgid-io.c \
-       games-setgid-io.h \
        gnibbles.h \
        gnibbles.c \
        properties.h \
diff --git a/src/games-scores.c b/src/games-scores.c
index 8b097e4..be003ac 100644
--- a/src/games-scores.c
+++ b/src/games-scores.c
@@ -28,14 +28,12 @@
 
 #include <glib/gi18n.h>
 
-#include "games-scores-backend.h"
 #include "games-score.h"
 #include "games-scores.h"
 
 /* The local version of the GamesScoresCategory. */
 typedef struct {
   GamesScoresCategory category;
-  GamesScoresBackend *backend;
 } GamesScoresCategoryInternal;
 
 struct GamesScoresPrivate {
@@ -51,19 +49,12 @@ struct GamesScoresPrivate {
   GamesScoresCategoryInternal dummycat;
 };
 
-void
-games_scores_startup (void)
-{
-  games_scores_backend_startup ();
-}
 
 static void
 games_scores_category_free (GamesScoresCategoryInternal *cat)
 {
   g_free (cat->category.key);
   g_free (cat->category.name);
-  if (cat->backend)
-    g_object_unref (cat->backend);
   g_free (cat);
 }
 
@@ -89,11 +80,6 @@ games_scores_get_current (GamesScores * self)
       return NULL;
   }
 
-  if (cat->backend == NULL) {
-    cat->backend = games_scores_backend_new (priv->style, priv->basename,
-                                             cat->category.key);
-  }
-
   return cat;
 }
 
@@ -193,7 +179,6 @@ games_scores_add_category (GamesScores *self,
   cat = g_new (GamesScoresCategoryInternal, 1);
   cat->category.key = g_strdup (key);
   cat->category.name = g_strdup (name);
-  cat->backend = NULL;
 
   g_hash_table_insert (priv->categories, g_strdup (key), cat);
   priv->catsordered = g_slist_append (priv->catsordered, cat);
@@ -252,8 +237,6 @@ games_scores_add_score (GamesScores * self, GamesScore *score)
 
   cat = games_scores_get_current (self);
 
-  scores_list = games_scores_backend_get_scores (cat->backend);
-
   s = scores_list;
   place = 0;
   n = 0;
@@ -291,9 +274,6 @@ games_scores_add_score (GamesScores * self, GamesScore *score)
     s->next = NULL;
   }
 
-  if (games_scores_backend_set_scores (cat->backend, scores_list) == FALSE)
-    place = 0;
-
   priv->last_score_significant = place > 0;
   priv->last_score_position = place;
   g_object_unref (priv->last_score);
@@ -349,8 +329,6 @@ games_scores_update_score_name (GamesScores * self, gchar * new_name, gchar * ol
 
   cat = games_scores_get_current (self);
 
-  scores_list = games_scores_backend_get_scores (cat->backend);
-
   s = g_list_last (scores_list);
   n = g_list_length (scores_list);
 
@@ -371,8 +349,6 @@ games_scores_update_score_name (GamesScores * self, gchar * new_name, gchar * ol
     n--;
   }
 
-  games_scores_backend_set_scores (cat->backend, scores_list);
-
   g_free (old_name);
 }
 
@@ -414,11 +390,6 @@ games_scores_get (GamesScores * self)
 
   cat = games_scores_get_current (self);
 
-  scores = games_scores_backend_get_scores (cat->backend);
-  /* Tell the backend that we won't be altering the scores so it
-   * can release the lock. */
-  games_scores_backend_discard_scores (cat->backend);
-
   return scores;
 }
 
diff --git a/src/games-scores.h b/src/games-scores.h
index 02e31c6..f24a3f0 100644
--- a/src/games-scores.h
+++ b/src/games-scores.h
@@ -29,7 +29,6 @@
 G_BEGIN_DECLS
 
 #include "games-score.h"
-#include "games-scores-backend.h"
 
 /* How many scores get counted as significant. */
 #define GAMES_SCORES_SIGNIFICANT 10
diff --git a/src/gnibbles.c b/src/gnibbles.c
index ab612f4..81625d6 100644
--- a/src/gnibbles.c
+++ b/src/gnibbles.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+//* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
 /*
  *   Gnome Nibbles: Gnome Worm Game
@@ -40,7 +40,6 @@
 #include "board.h"
 #include "sound.h"
 #include "worm.h"
-#include "games-scores-dialog.h"
 #include "games-scores.h"
 
 GnibblesWorm *worms[NUMWORMS];
@@ -331,31 +330,13 @@ gnibbles_keypress_worms (guint keyval)
 }
 
 void
-gnibbles_show_scores (GtkWidget * window, gint pos)
-{
-  static GtkWidget *scoresdialog = NULL;
-  gchar *message;
-
-  if (!scoresdialog) {
-    scoresdialog = games_scores_dialog_new (GTK_WINDOW (window),
-                                            highscores,
-                                            NULL);
-  }
-  if (pos > 0) {
-    games_scores_dialog_set_hilight (GAMES_SCORES_DIALOG (scoresdialog), pos);
-  }
-  games_scores_dialog_set_message (GAMES_SCORES_DIALOG (scoresdialog),
-                                   NULL);
-
-  gtk_dialog_run (GTK_DIALOG (scoresdialog));
-  gtk_widget_hide (scoresdialog);
-}
-
-void
 gnibbles_log_score (GtkWidget * window)
 {
   gint pos;
 
+  if (properties->numworms > 1)
+    return;
+
   if (properties->human != 1)
     return;
 
@@ -367,5 +348,4 @@ gnibbles_log_score (GtkWidget * window)
 
   pos = games_scores_add_plain_score (highscores, worms[0]->score);
 
-  gnibbles_show_scores (window, pos);
 }
diff --git a/src/main.c b/src/main.c
index 5720311..d28ec89 100644
--- a/src/main.c
+++ b/src/main.c
@@ -327,12 +327,6 @@ pause_game_cb (GtkAction * action, gpointer data)
   }
 }
 
-static void
-show_scores_cb (GtkAction * action, gpointer data)
-{
-  gnibbles_show_scores (window, 0);
-}
-
 void
 end_game (void)
 {
@@ -588,8 +582,6 @@ static const GtkActionEntry action_entry[] = {
    G_CALLBACK (new_game_cb)},
   {"EndGame", NULL, N_("_End Game"), NULL, NULL,
    G_CALLBACK (end_game_cb)},
-  {"Scores", NULL, N_("_Scores"), NULL, NULL,
-   G_CALLBACK (show_scores_cb)},
   {"Quit", GTK_STOCK_QUIT, NULL, NULL, NULL, G_CALLBACK (quit_cb)},
   {"Preferences", GTK_STOCK_PREFERENCES, NULL, NULL, NULL,
    G_CALLBACK (gnibbles_preferences_cb)},
@@ -606,8 +598,6 @@ static const char ui_description[] =
   "      <separator/>"
   "      <menuitem action='Pause'/>"
   "      <separator/>"
-  "      <menuitem action='Scores'/>"
-  "      <separator/>"
   "      <menuitem action='Quit'/>"
   "    </menu>"
   "    <menu action='ViewMenu'>"
@@ -741,8 +731,6 @@ main (int argc, char **argv)
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
-  games_scores_startup ();
-
   /*
    * Required because the binary doesn't match the desktop file.
    * Has to be before the call to g_option_context_parse.


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