Summary: | Expansion of groups in the Contact List is not always remembered | ||
---|---|---|---|
Product: | [Unmaintained] telepathy | Reporter: | Dennis Schridde <heri+kde> |
Component: | contactlist | Assignee: | Telepathy Bugs <kde-telepathy-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | arthur, kde, mklapetek, renatoat |
Priority: | NOR | ||
Version: | 0.6.80 | ||
Target Milestone: | Future | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/telepathy-contact-list/57123038d097dd0fac80c31aadb27976ab2547a7 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | A proposed solution for this bug |
Description
Dennis Schridde
2013-10-01 16:29:18 UTC
Works for me. Can you look in ~/.kde4/share/config/ktelepathyrc before opening and after closing. Check the [Groups] section and determine if it is failing to save or failing to open. (In reply to comment #1) > Can you look in ~/.kde4/share/config/ktelepathyrc before opening and after > closing. > Check the [Groups] section and determine if it is failing to save or failing > to open. Difficult task, because it seems to happen randomly. I'll report back, once I find a way to reproduce it reliably and thus get into a state where it actually makes sense to compare the file before/after. Thanks. (In reply to comment #1) > Can you look in ~/.kde4/share/config/ktelepathyrc before opening and after > closing. > Check the [Groups] section and determine if it is failing to save or failing > to open. I opened the Contact List, found that one group closed, opened it, closed the Contact List. Then I took a snapshot of ~/.kde4/share/config/ktelepathyrc. I then opened the Contact List again, group was again closed, I opened it, closed the Contact List and took another snapshot. Then I opened the Contact List, found the group closed, did *not* open it, closed the Contact List and took a snapshot of the config. In all three cases the config looked exactly the same. No group state changed, and the one in question had state "true". Please note that I still do not know how to reliably reproduce this. It just happened that today the group would always be closed when opening the Contact List. I found another way to "reproduce" this (could also be a separate issue, but the symptom is the same). 1. Open a group that was previously closed (I can reproduce this with at least two of my groups) 2. Search for anyone (does not matter which group he is in) 3. Clear the search field 4. Observe that the previously opened group is now closed again In 0.7.80 (0.8 beta1) I cannot reproduce this anymore, including following your steps. Dennis, can you please confirm? Still cannot reproduce and given no activity for almost two months, closing. I'm using 0.8.0 from Kubuntu 14.04 and I can reproduce both the scenarios described here (closing the contacts list and searching for anything). Watching ktelepathyrc, the [GroupsState] section is saved correctly (Group=true), but even after I close and open the contacts list, the group is still collapsed and the file is unchanged - meaning the Group=true is still there and just turns to Group=false when I expand and collapse the group manually. Created attachment 86272 [details]
A proposed solution for this bug
I've debugged this situation and the groups that didn't expand were always passed from rowsInserted to onNewGroupModelItemsInserted with invalid indices, so the method returns, not expanding these groups.
I was not able to understand why exactly this was happening, so I came with a working solution: even if the index passed to this method is invalid, it's possible to recover it from the model with the parameters from rowsInserted ("start", actually). Details on the submitted patch.
I've worked on the 0.8 branch, so this bug is reproducible on 0.8.1.
I didn't create a review request for the patch yet because this bug is marked as fixed. Please take a look at the solution and let me know if any further information or correction is needed. If it looks OK, I'll submit a review request.
Maybe you are onto something. The parent index being invalid makes perfect sense; the parent of a group node is nothing. What this code was currently doing is looking for when you insert a child of a group node and then seeing if you should expand the group node (which will be the parent of the newly inserted child) The reason we did this was because if you call expand() on a group node that doesn't have any children Qt just ignores your expand request; when I wrote that the code we had always inserted the group node, and then afterwards inserted the children. Your patch basically restores the more obvious way of operating on the group node itself when is inserted. Is the patch OK? Should I submit a review request targeting KDE/4.13? Yes. Could you try and add some comments explaining why it's needed and what the two paths are doing. I've submitted a review request with some changes to my original solution, I hope it is clear enough. https://git.reviewboard.kde.org/r/117791/ Git commit 57123038d097dd0fac80c31aadb27976ab2547a7 by David Edmundson, on behalf of Renato Atilio. Committed on 26/04/2014 at 18:03. Pushed by davidedmundson into branch 'kde-telepathy-0.8'. Fix for a bug that caused the contacts list to not expand some groups on opening and filtering I've fixed the 325506 bug by creating a decision upon the validity of the inserted item's parent. If it is valid, it works as before, considering it is a top-level element we want to collapse/expand. If it is invalid, the inserted item itself is probably the top-level node (hence the invalid parent - there's none), so we get it in another way. I don't think the second validity check is strictly needed, but I thought it was safer to keep it anyway. REVIEW: 117791 M +11 -2 contact-list-widget.cpp M +1 -1 contact-list-widget.h http://commits.kde.org/telepathy-contact-list/57123038d097dd0fac80c31aadb27976ab2547a7 |