gnome-games r8299 - trunk/libgames-support



Author: chpe
Date: Sun Nov  9 15:11:00 2008
New Revision: 8299
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8299&view=rev

Log:
Add GAMES_RUNTIME_SCORES_DIRECTORY and use that in the scores backend.

Modified:
   trunk/libgames-support/games-runtime.c
   trunk/libgames-support/games-runtime.h
   trunk/libgames-support/games-scores-backend.c
   trunk/libgames-support/games-sound.c

Modified: trunk/libgames-support/games-runtime.c
==============================================================================
--- trunk/libgames-support/games-runtime.c	(original)
+++ trunk/libgames-support/games-runtime.c	Sun Nov  9 15:11:00 2008
@@ -24,10 +24,6 @@
 #include <windows.h>
 #include <io.h>
 #define HELP_EXT "xhtml"
-/* FIXME On win32 help is created as html with gnome-doc-tool,
- * and put manually in the directory below.
- */
-#define HELPDIR PKGDATADIR "/aisleriot/help"
 #endif /* G_OS_WIN32 */
 
 #include "games-runtime.h"
@@ -49,6 +45,7 @@
   { GAMES_RUNTIME_MODULE_DIRECTORY,   "share"              }, /* GAMES_RUNTIME_DATA_DIRECTORY              */
   { GAMES_RUNTIME_DATA_DIRECTORY,     "gnome-games-common" }, /* GAMES_RUNTIME_COMMON_DATA_DIRECTORY       */
   { GAMES_RUNTIME_DATA_DIRECTORY,     "gnome-games"        }, /* GAMES_RUNTIME_PKG_DATA_DIRECTORY          */
+  { GAMES_RUNTIME_DATA_DIRECTORY,     "scores"             }, /* GAMES_RUNTIME_SCORES_DIRECTORY            */
 #endif /* G_OS_WIN32 */
   { GAMES_RUNTIME_DATA_DIRECTORY,         "locale"         }, /* GAMES_RUNTIME_LOCALE_DIRECTORY            */
   { GAMES_RUNTIME_COMMON_DATA_DIRECTORY,  "pixmaps"        }, /* GAMES_RUNTIME_COMMON_PIXMAP_DIRECTORY     */
@@ -139,6 +136,10 @@
       path = g_strdup (PKGDATADIR);
       break;
 
+    case GAMES_RUNTIME_SCORES_DIRECTORY:
+      path = g_strdup (SCORESDIR);
+      break;
+
 #else /* G_OS_WIN32 */
     case GAMES_RUNTIME_MODULE_DIRECTORY:
       path = g_win32_get_package_installation_directory_of_module (NULL);

Modified: trunk/libgames-support/games-runtime.h
==============================================================================
--- trunk/libgames-support/games-runtime.h	(original)
+++ trunk/libgames-support/games-runtime.h	Sun Nov  9 15:11:00 2008
@@ -32,6 +32,7 @@
   GAMES_RUNTIME_DATA_DIRECTORY,
   GAMES_RUNTIME_COMMON_DATA_DIRECTORY,
   GAMES_RUNTIME_PKG_DATA_DIRECTORY,
+  GAMES_RUNTIME_SCORES_DIRECTORY,
 
   /* Derived directories */
   GAMES_RUNTIME_LOCALE_DIRECTORY,

Modified: trunk/libgames-support/games-scores-backend.c
==============================================================================
--- trunk/libgames-support/games-scores-backend.c	(original)
+++ trunk/libgames-support/games-scores-backend.c	Sun Nov  9 15:11:00 2008
@@ -29,7 +29,7 @@
 #include "games-score.h"
 #include "games-scores.h"
 #include "games-scores-backend.h"
-
+#include "games-runtime.h"
 #include "games-setgid-io.h"
 
 G_DEFINE_TYPE (GamesScoresBackend, games_scores_backend, G_TYPE_OBJECT);
@@ -81,7 +81,8 @@
   backend->priv->timestamp = 0;
   backend->priv->style = style;
   backend->scores_list = NULL;
-  backend->priv->filename = g_build_filename (SCORESDIR, fullname, NULL);
+  backend->priv->filename = g_build_filename (games_runtime_get_directory (GAMES_RUNTIME_SCORES_DIRECTORY),
+                                              fullname, NULL);
   g_free (fullname);
 
   backend->priv->fd = -1;

Modified: trunk/libgames-support/games-sound.c
==============================================================================
--- trunk/libgames-support/games-sound.c	(original)
+++ trunk/libgames-support/games-sound.c	Sun Nov  9 15:11:00 2008
@@ -182,7 +182,8 @@
  * @filename: the sound file to player
  * 
  * Plays a sound with the given filename using GStreamer. The sound file is stored in
- * the SOUNDDIR directory in .ogg format. Sound is played in a separate thread.
+ * the GAMES_RUNTIME_SOUND_DIRECTORY directory in .ogg format. Sound is played in a
+ * separate thread.
  */
 void
 games_sound_play (const gchar * filename)



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