Ejemplo n.º 1
0
static void
do_mount_tests (GDrive *drive, GVolume *volume, GMount *mount)
{
  GDrive *d;
  GVolume *v;
  gchar *name;
  gchar *uuid;

  name = g_mount_get_name (mount);
  g_assert (name != NULL);
  g_free (name);

  v = g_mount_get_volume (mount);
  g_assert (v == volume);
  if (v != NULL)
    g_object_unref (v);

  d = g_mount_get_drive (mount);
  g_assert (d == drive);
  if (d != NULL)
    g_object_unref (d);

  uuid = g_mount_get_uuid (mount);
  if (uuid)
    {
      GMount *m;
      m = g_volume_monitor_get_mount_for_uuid (monitor, uuid);
      g_assert (m == mount);
      g_object_unref (m);
      g_free (uuid);
    }
}
Ejemplo n.º 2
0
static GMount *
get_mount_for_uuid (GVolumeMonitor *volume_monitor, const char *uuid)
{
  GUnionVolumeMonitor *monitor;
  GVolumeMonitor *child_monitor;
  GMount *mount;
  GList *l;
  
  monitor = G_UNION_VOLUME_MONITOR (volume_monitor);

  mount = NULL;
  
  g_rec_mutex_lock (&the_volume_monitor_mutex);

  for (l = monitor->monitors; l != NULL; l = l->next)
    {
      child_monitor = l->data;

      mount = g_volume_monitor_get_mount_for_uuid (child_monitor, uuid);
      if (mount != NULL)
        break;

    }
  
  g_rec_mutex_unlock (&the_volume_monitor_mutex);

  return mount;
}
Ejemplo n.º 3
0
static VALUE
rg_get_mount_for_uuid(VALUE self, VALUE value)
{
        return GOBJ2RVAL_UNREF(g_volume_monitor_get_mount_for_uuid(_SELF(self), RVAL2CSTR(value)));
}