~ubuntu-branches/ubuntu/precise/gnome-games/precise-proposed

« back to all changes in this revision

Viewing changes to libgames-support/games-runtime.c

  • Committer: Package Import Robot
  • Author(s): Rodrigo Moya
  • Date: 2011-05-30 13:32:04 UTC
  • mfrom: (1.3.4)
  • mto: (163.1.3 precise)
  • mto: This revision was merged to the branch mainline in revision 143.
  • Revision ID: package-import@ubuntu.com-20110530133204-celaq1v1dsxc48q1
Tags: upstream-3.0.2
ImportĀ upstreamĀ versionĀ 3.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
static const DerivedDirectory derived_directories[] = {
231
231
  /* Keep this in the same order as in the GamesRuntimeDirectory enum! */
232
232
#ifdef ENABLE_BINRELOC
233
 
  { GAMES_RUNTIME_MODULE_DIRECTORY,   "share"              }, /* GAMES_RUNTIME_DATA_DIRECTORY              */
 
233
  { GAMES_RUNTIME_PREFIX,             "share"              }, /* GAMES_RUNTIME_DATA_DIRECTORY              */
234
234
  { GAMES_RUNTIME_DATA_DIRECTORY,     "gnome-games-common" }, /* GAMES_RUNTIME_COMMON_DATA_DIRECTORY       */
235
235
  { GAMES_RUNTIME_DATA_DIRECTORY,     "gnome-games"        }, /* GAMES_RUNTIME_PKG_DATA_DIRECTORY          */
236
236
  { GAMES_RUNTIME_DATA_DIRECTORY,     "scores"             }, /* GAMES_RUNTIME_SCORES_DIRECTORY            */
374
374
  const char *path;
375
375
 
376
376
  /* Now check that we can get the module installation directory */
377
 
  path = games_runtime_get_directory (GAMES_RUNTIME_MODULE_DIRECTORY);
 
377
  path = games_runtime_get_directory (GAMES_RUNTIME_PREFIX);
378
378
 
379
379
  _games_debug_print (GAMES_DEBUG_RUNTIME,
380
380
                      "Relocation path: %s\n", path ? path : "(null)");
473
473
 
474
474
/**
475
475
 * games_runtime_get_directory:
476
 
 * @runtime: the #GamesProgram instance
477
476
 * @directory:
478
477
 *
479
478
 * Returns: the path to use for @directory
492
491
 
493
492
  switch ((int) directory) {
494
493
#ifdef ENABLE_BINRELOC
495
 
    case GAMES_RUNTIME_MODULE_DIRECTORY:
 
494
    case GAMES_RUNTIME_PREFIX:
496
495
#ifdef G_OS_WIN32
497
496
      path = g_win32_get_package_installation_directory_of_module (NULL);
498
497
#else
526
525
      break;
527
526
#else /* !ENABLE_BINRELOC */
528
527
 
 
528
    case GAMES_RUNTIME_PREFIX:
 
529
      path = g_strdup (PREFIX);
 
530
      break;
 
531
 
529
532
    case GAMES_RUNTIME_DATA_DIRECTORY:
530
533
      path = g_strdup (DATADIR);
531
534
      break;
558
561
 
559
562
/**
560
563
 * games_runtime_get_file:
561
 
 * @runtime: the #GamesProgram instance
562
564
 * @directory:
563
565
 * @name:
564
566
 *
590
592
{
591
593
  return gpl_version;
592
594
}
 
595
 
 
596
/**
 
597
 * games_runtime_is_system_prefix:
 
598
 *
 
599
 * Returns: whether the runtime prefix is "/usr".
 
600
 */
 
601
gboolean
 
602
games_runtime_is_system_prefix (void)
 
603
{
 
604
  return strcmp (games_runtime_get_directory (GAMES_RUNTIME_PREFIX), "/usr") == 0;
 
605
}