denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Git master currently broken for command saving, comma


From: Richard Shann
Subject: Re: [Denemo-devel] Git master currently broken for command saving, command center operations ....
Date: Tue, 26 Nov 2013 17:48:58 +0000

On Tue, 2013-11-26 at 16:02 +0100, Éloi Rivard wrote:
> How exactly can you call the "thumbnail invocation" of denemo ?


It is in printview.c:


 gchar *arguments[] = {
                g_build_filename (get_system_bin_dir (), "denemo",
NULL),
                "-n", "-a", "(d-CreateThumbnail #f)(d-Exit)",
                Denemo.gui->filename->str,
                NULL
              };

That is, if you have a denemo file junk.denemo and use the command line

denemo -n -a "(d-CreateThumbnail #f)(d-Exit)"  junk.denemo

it would create a thumbnail for it. But it doesn't: it exits with 0
after giving those error messages, and no thumbnail is created.

> 
> 
>         > Oh - I thought it was part of trying to get non-interactive
>         invocation
>         > working without gtk. In this case the crash is more serious
>         - it was
>         > crashing because during file loading the scheme callback
>         route was not
>         > used and so displayhelper() was not called, by moving the
>         call to
>         > displayhelper() down into the addmeasures() routine you
>         caused it to be
>         > called during file loading (I would guess that Denemo.gui is
>         not set up
>         > at that stage). So it is more serious because you moved
>         displayhelper()
>         > down into other low-level routines, and the same crash may
>         be waiting
>         > for us when a file is loaded which require those.
>         
> We could check if Denemo.gui is well set up inside displayhelper. What
> do you think should be checked exactly ?

I don't think I have ever got to grips with what displayhelper() does. I
think that the beaming and stems get in a muddle (in the display) if it
is not called at the right moment ... it is some very ancient piece of
code.

> 
>  
>         > This, of course, brings us back to the main thing we need,
>         tests. (That
>         > is why I hoped and assumed that the crash was due to you
>         trying to get
>         > testing working, rather than general improvements to the
>         code). It will
>         > be much easier to improve the code generally once a good set
>         of tests
>         > are present. 
> Of course, I tend to do thing a bit too quickly. What kind of test is
> the priority at this stage according to you ?
> 
>  
>         In particular, the excellent improvement of removing the
>         > passing of the global value Denemo.gui around could only
>         safely be done
>         > when tests are present that will fail if the parameter "gui"
>         refers not
>         > to the global Denemo.gui but to a DenemoGUI* which is being
>         created and
>         > populated - as during file loading, and possibly other
>         things such as
>         > switching tabs.
>         
> So this is not the kind of tests we can easilly set in a testsuite,
> this is more some guards or assertion, isn't it ?

I think we can have tests for this sort of thing - I am not thinking of
testing that there is a tab to click on and what happens when that mouse
event is received, but with the scheme interface we can create actions
even for things like changing tab which we might not otherwise need. 

> 
>  
>         > Can you list the places where you have moved the
>         displayhelper() call,
>         > and with a view to looking over where they can occur in the
>         call tree?
>         
>         About displayhelpers, you can see most of the changes here :
>         
> https://github.com/denemo/denemo/commit/ebf606a4d502aa1d9b2eb9d9913a4df77d6f116f

hmm, that *is* a lot. It would be interesting to put a counter on
displayhelper() and find out how much it is being called while doing
simple tasks...

Richard






reply via email to

[Prev in Thread] Current Thread [Next in Thread]