Review Request: (1/2) Improve groups expansion in contact list

David Edmundson kde at davidedmundson.co.uk
Tue Aug 14 22:30:18 UTC 2012



> On Aug. 14, 2012, 10:26 p.m., David Edmundson wrote:
> > Ship It!

Wait - 
>From ContactListWidget

            Q_ASSERT(contact);
            QString group;
            if (index.data(AccountsModel::ItemRole).canConvert<GroupsModelItem*>()) {
                // contact is dropped on a group, so take it's name
                group = index.data(GroupsModel::GroupNameRole).toString();
            } else {
                // contact is dropped on another contact, so take it's parents (group) name
                group = index.parent().data(GroupsModel::GroupNameRole).toString();
            }

            kDebug() << contact->contact().data()->alias() << "added to group" << group;

            if (!group.isEmpty()) {
                Tp::PendingOperation *op = contact->contact().data()->addToGroup(group);

                connect(op, SIGNAL(finished(Tp::PendingOperation*)),
                        this, SIGNAL(genericOperationFinished(Tp::PendingOperation*)));
            }


this is checking group.isEmpty() and that group comes from GroupNameRole

so as I see it, this will now create it on the server. Which is why this patch was made in the first place.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106024/#review17419
-----------------------------------------------------------


On Aug. 14, 2012, 10:13 p.m., Martin Klapetek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106024/
> -----------------------------------------------------------
> 
> (Updated Aug. 14, 2012, 10:13 p.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Description
> -------
> 
> If the contact has no groups, it is placed into "Ungrouped" group. This is done when the group name is empty. However the group still needs some id in the model to properly handle the expanded/collapsed state, ie. you can't save an empty string into config file. The AccountsModel::IdRole & GroupsModel::GroupNameRole is not used anywhere in the UI, so the user won't see this. And returning this on the model level makes sure this group is actually not created on the server.
> 
> 
> Diffs
> -----
> 
>   KTp/Models/groups-model-item.cpp c85ffbf 
> 
> Diff: http://git.reviewboard.kde.org/r/106024/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Martin Klapetek
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20120814/40503978/attachment-0001.html>


More information about the KDE-Telepathy mailing list