Re: --show-layers=... alternative



On 03.04.2005 20:26, Simon Kagstrom wrote:
On 2005-04-03, 17:46, Lars Clausen wrote:
[...]
That could be useful.  There also ought to be a warning if a layer is
specified multiple times.


I reimplemented the patch to support both named layers and ranges of numbered
layers. Things like

app/run_dia.sh -e tst.eps dijkstra_execution.dia --show-layers="Step 5",0-1,Graph

work now and will issue warnings like "Warning: Layer 1 (Graph) selected more
than once." if a layer is selected more than once (but it still works). If
--show-layers= is given, no layers are exported.

The patch is available at

http://bugzilla.gnome.org/show_bug.cgi?id=172507

Some nitpicking:

- you are using strtok_r() to split the string into pieces. That function
  is neither portable nor utf8 aware (if that matters). It would be better
  to use g_strsplit()
- please don't use strdup() and free() but their g_* equivalent. The latter
  are guaranteed to not return on failure.
- g_error() will also call exit(). IMO g_assert() would be more appropriate
  at some places

I'm afraid I uploaded an incorrect version first, sorry for that. I also
didn't touch the ChangeLog or the manual, but I can do that if I'm supposed to
do it :-)

That would be nice.

Thanks,
        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



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