xffm changes

Olivier Fourdan fourdan at xfce.org
Mon Jan 27 19:27:37 CET 2003


Hi,
 
>	wastepath = g_strconcat (filepath, "/..Wastebasket/", NULL);

If you want portability (which is a good thing anyway), please use 
G_DIR_SEPARATOR instead of '/' (ie when a char is expected) and
G_DIR_SEPARATOR_S instead of "/" (ie when a string is expected)

So you should use :

wastepath = g_strconcat (filepath, G_DIR_SEPARATOR_S, "..Wastebasket",
G_DIR_SEPARATOR_S, NULL);

AFAIK, both xfce-mcs-plugins and xfwm4 use that.

Cheers,
Olivier.

On Mon, 2003-01-27 at 19:07, Jens Luedicke wrote:
> On Mon, 2003-01-27 at 18:03, edscott wilson garcia wrote:
> 
> > 1- It's a "good thing" to keep variables localized. For example, putting
> > wastebackup into the if block means it will not be pushed up to the
> > stack if not needed, and the call to g_free can be avoided. This
> > eliminates unnecesary code from being executed.
> 
> Agreed, but I actally prefer to declare them all at once.
> I probably did it because from my experience with perl. 
> 
> > 3- Do not include a trailing "/" within path variables. Doing so causes
> > many bugs and confusion in xftree and should be avoided in xffm. The
> > only path that ends with a slash should be the root dir.
> 
> I saw you changed:

> into:
> 	wastepath = g_strconcat (filepath, "/..Wastebasket","/", NULL);
> 
> and used later: 
> 
> 	new_name(wastepath,"/",filename)); 
> 
> 
> 1) why not at once -> "/..Wastebasket/", <- ?
> 
> 2) iirc accepts the new_name function only two arguments?
> 
>   
-- 
Olivier Fourdan <fourdan at xfce.org>
http://www.xfce.org




More information about the Xfce4-dev mailing list