Tommaso Cucinotta wrote:
Vincent van Ravesteijn ha scritto:
The comment was about r31219. I really don't like that commit because:

1) I don't want to spoil the code with an infinite amount of

if (buffer().fileName().extension() == "internal")
Absolutely agree. At least, it should be "if (buffer().isInternal())".
2) there are still a zillion of bugs related to this issue, and we can't solve them all one-by-one whenever we see one. We need to think about a real solution,

3) setting the screen_label should not be a task of addToToc(), but of updateLabels(),
Never meant to provide a definitive solution. Just a fix that I felt as
closely related to the Advanced Search functionality and fixing a light
unimportant misbehaviour. Concerning the position of this, I also didn't
understand why I had to modify a "addToToc()" method, but I guess the
code can be easily moved somewhere else (or the method renamed to
something else) if needed.

"addToToc()" is not needed for an internal buffer.



Agree that, before filling the code of such lines, it would be better to
have a generally agreed way of understanding whether a buffer is
internal or not, guess this is up to the "grownup" developers :-)

What about the buffer().isInternal() or buffer().internal() method ?
Afterward, implementation may be changed as appropriate.

OK for the new buffer().isInternal() but this method should be used in the same commit. I guess this is in TocBackend.cpp:

-     buffer_->inset().addToToc(dit);
+    if ( buffer_->isInternal())
+        buffer_->inset().addToToc(dit);

Or something like that...

Abdel.

Reply via email to