Re: [PATCH 2/3] [filesystem] Get paths to show from the configuration files



Hi,

On Wed, 2010-06-02 at 18:53 +0200, Juan A. Suarez Romero wrote:
> On Wed, 2010-06-02 at 15:29 +0200, Joaquim Rocha wrote:
> >  
> > @@ -385,9 +400,7 @@ create_content (GrlMedia *content,
> >    }
> >  
> >    /* ID: if root path, then id must be kept NULL */
> > -  grl_media_set_id (media,
> > -                    g_strcmp0 (path,
> > -                               G_DIR_SEPARATOR_S) == 0? NULL: path);
> > +  grl_media_set_id (media, path);
> 
> Is there any reason why you're changing this?
> 
> This was changed in f288fd9, and seems you are reverting it.

I changed this because if the client configures the chosen path to be
"/" then that entry would not give any results.

> 
> >  
> >    /* URL */
> >    str = g_strconcat ("file://", path, NULL);
> > @@ -549,14 +562,30 @@ static void
> >  grl_filesystem_source_browse (GrlMediaSource *source,
> >                                GrlMediaSourceBrowseSpec *bs)
> >  {
> > -  const gchar *path;
> >    const gchar *id;
> > +  GList *chosen_paths;
> >  
> >    g_debug ("grl_filesystem_source_browse");
> >  
> >    id = grl_media_get_id (bs->container);
> > -  path = id ? id : G_DIR_SEPARATOR_S;
> > -  produce_from_path (bs, path);
> > +  chosen_paths = GRL_FILESYSTEM_SOURCE(source)->priv->chosen_paths;
> > +  if (!id && chosen_paths) {
> > +    guint remaining = g_list_length (chosen_paths);
> > +    for (; chosen_paths; chosen_paths = g_list_next (chosen_paths)) {
> > +      GrlMedia *content = create_content (NULL,
> > +					  (gchar *) chosen_paths->data,
> > +					  GRL_RESOLVE_FAST_ONLY);
> > +
> > +      bs->callback (source,
> > +		    bs->browse_id,
> > +		    content,
> > +		    --remaining,
> > +		    bs->user_data,
> > +		    NULL);
> > +    }
> > +  } else {
> > +    produce_from_path (bs, id ? id : G_DIR_SEPARATOR_S);
> > +  }
> >  }
> >  
> >  static void
> > diff --git a/src/filesystem/grl-filesystem.h b/src/filesystem/grl-filesystem.h
> > index 7e24211..ec24aa2 100644
> > --- a/src/filesystem/grl-filesystem.h
> > +++ b/src/filesystem/grl-filesystem.h
> > @@ -51,6 +51,10 @@
> >                                GRL_FILESYSTEM_SOURCE_TYPE,       \
> >                                GrlFilesystemSourceClass))
> >  
> > +/* --- Grilo Configuration --- */
> > +#define GRILO_CONF_CHOSEN_PATH "FS_PATH"
> 
> I would use something like "base-path" or alike (names following the
> glib-property name style).
> 

Okay, I can change that.

--
Joaquim Rocha

Attachment: signature.asc
Description: This is a digitally signed message part



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