Commit graph

13 commits

Author SHA1 Message Date
TheJackiMonster 173531ef2c
Combined #777 with changes from #827
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2021-04-10 14:46:03 +02:00
Tobias Frisch 653357d2e9
Merge pull request #777 from siliconserf/Issue-324-NoID-Fix
Update abstractModel.py
2021-04-10 14:39:50 +02:00
Tobias Frisch 0a615bdef2
Merge pull request #667 from worstje/arguments-and-logging
Logging and command-line arguments
2021-04-08 19:37:09 +02:00
Jan Wester ff2cbca028 Converted most print statements to use logging
Some snippets have yet to be converted due to the more complex nature
of those snippets, and to keep things neat a separate commit makes more
sense for those.
2021-04-08 18:44:28 +02:00
Tobias Frisch 7c93567279
Merge branch 'develop' into develop 2021-04-08 18:33:27 +02:00
emgineering bee24d45b0 Change ID assignment method for Outline 2021-04-08 09:57:36 -06:00
TheJackiMonster 12be4c3a3d
Fixed all Python syntax warnings 2021-02-21 23:45:34 +01:00
siliconserf ed78f6e56f Update abstractModel.py 2020-06-04 14:25:27 -07:00
Jan Wester 12390a9aab Fix occasional crashes when (re)moving items
Describing all the rabbitholes that I and kakaroto have gone through
while debugging this one until dawn can frankly not do enough justice to
the crazy amount of rubberducking that went on while trying to fix this.

This bug would be triggered whenever you had a document open in the
editor and then moved an ancestor object downwards (visually) in the tree.
Or when you simply deleted the ancestor. Depending on the exact method
that caused the opened item to be removed from the internal model, the
exact nature of the bug would vary, which means this commit fixes a few
different bits of code that lead to what appears to be the same bug.

In order of appearance, the bugs that ruined our sleep were:

1) The editor widget was trying to handle the removed item at too late a
stage.

2) The editor widget tried to fix its view after a move by searching for
the new item with the same ID, but in the case of moving an object down
it came across its own old item, ruining the attempt.

3) The editor widget did not properly account for the hierarchical
nature of the model.

Upon fixing these the next day, it was revealed that:

4) The outlineItem.updateWordCount(emit=False) flag is broken. This
function would call setData() in several spots which would still cause
emits to bubble through the system despite emit=False, and we simply got
lucky that it stopped enough of them until now.

This last one was caused by a small mistake in the fixes for the first
three bugs, but it has led to a couple of extra changes to make any
future bug hunts slightly less arduous and frustrating:

a) When calling item.removeChild(c), it now resets the associated parent
and model to mirror item.insertChild(c). This has also led to an extra
check in model.parent() to check for its validity.

b) The outlineItem.updateWordCount(emit=) flag has been removed entirely
and it now emits away with reckless abandon. I have been unable to
reproduce the crashes the code warned about, so I consider this a code
quality fix to prevent mysterious future issues where things sometimes
do not properly update right.

Worthy of note is that the original code clearly showed the intention to
close tabs for items that were removed. Reworking the editor to support
closing a tab is unfortunately way out of scope, so this intention was
left in and the new fix was structured to make it trivial to implement
such a change when the time comes. An existing FIXME regarding unrelated
buggy editor behaviour was left in, too.

Many thanks to Kakaroto for burning the midnight oil with me to get to
the bottom of this. (I learned a lot that night!)

Issues #479, #516 and #559 are fixed by this commit. And maybe some others,
too.
2019-05-19 09:33:19 -06:00
Sebastian Rasmussen dfe88a9681 Fix typos in code comments, invisible to end-users. 2018-01-29 10:30:41 -07:00
Olivier Keshavjee 04fc6a5ae4 Checkpoint: refactoring 2017-11-18 20:53:10 +01:00
Olivier Keshavjee 9e95196cc5 Changes Outline enums to IntEnum 2017-11-15 20:58:12 +01:00
Olivier Keshavjee bc0d6f5760 Creates base classes 2017-11-15 20:34:05 +01:00