Re: filename translation implementation - how to decide



On Thu, 2004-12-16 at 08:03 +0100, Alexander Larsson wrote:
> On Wed, 2004-12-15 at 22:15 +0000, Jamie McCracken wrote:
> > On Wed, 2004-12-15 at 23:07 +0100, Alexander Larsson wrote:
> > > On Wed, 2004-12-15 at 21:58 +0000, Jamie McCracken wrote:
> > > > On Wed, 2004-12-15 at 22:25 +0100, Alexander Larsson wrote:
> > > > 
> > > > > 
> > > > > On the contrary, the API for a library is highly dependant on how the
> > > > > standard works. It should be obvious to anyone that actually read my
> > > > > initial mail that the two solutions have a very different API.
> > > > > 
> > > > 
> > > > Yes thats true but it could still be defined to cover both. 
> > > > 
> > > > EG you could have:
> > > > 
> > > > fdo_get_desktop_dir - returns ~/Desktop with option1 else custom path 
> > > > fdo_get_desktop_displayname - returns translated name if option 1 etc
> > > 
> > > So, for every filename, you'd call fdo_get_desktop_dir() and compare
> > > with that, and if its true you'd call fdo_get_desktop_displayname(),
> > > repeat for all special folders. Doesn't sound very efficient.
> > 
> > No. 
> > 
> > If you want to write to desktop you always use  fdo_get_desktop_dir (as
> > you would with g_get_home_dir)
> > 
> > If you want to display to the user in Nautilus the desktop name you use
> > fdo_get_desktop_displayname (instead of g_filename_display_basename).
> > There should be no need to combine or compare the two.
> 
> And exactly how do you know if the folder you're going to display in ~/
> is the desktop or not?

simply replace wherever you hardcode ~/Desktop with fdo_get_desktop_dir
in your existing code. It shouldn't be any less efficient or cumbersome.

jamie.

> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  Alexander Larsson                                            Red Hat, Inc 
>                    alexl redhat com    alla lysator liu se 
> He's a globe-trotting soccer-playing romance novelist gone bad. She's a 
> brilliant junkie mercenary living on borrowed time. They fight crime! 
> 
> 




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