It fix when add file to folder after have attached folder to parent.
Work add file to folder before have attached folder to parent.
Fix count m_children when remove file from folder
aacid | |
sitter |
It fix when add file to folder after have attached folder to parent.
Work add file to folder before have attached folder to parent.
Fix count m_children when remove file from folder
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Thanks for your patch! What repo is this for? It didn't get set automatically for some reason and i's not clear from looking at the diff or your description.
Can you please explain what bug you intend to fix here and how to test it?
I am not sure I understand what you are fixing in the append....
The way listing works is that we open a dir, iterate its entries, for each file entry we append a File* for each directory we recurse and then append the returned Folder* making the current Folder the parent and the returned Folder the child. That is to say: once a child gets a parent the child is complete, there are no more appends happening to that child.
You could add a Q_ASSERT(!parent()); to the top of the append and it should never crash there.
The remove change looks good though.
I fix:
If you don't use deleteFile, then remove the buggy method, else fix it 1)
In your code 2) will not append, but when some body (like me), reuse you code, and do it, it have problem because it can use it like that's.
I have implemented the code here:
https://github.com/alphaonex86/Ultracopier/tree/master/test/radialmap
And in my case I need append file after the root is constructed
Thanks, that does make sense now.
Seeing as this isn't a library it's not meant to be working for third party use. I appreciate your patch but in the interest of speed I'll leave the append() change out of the commit. As mentioned, there is no parent for us so the attempted loop is entirely unnecessary for our purposes.
I'll go ahead and land the bugfix updating m_children.
Thanks!