Bug 273725

Summary: Ugly hack in AccountFilterModel
Product: [Frameworks and Libraries] telepathy Reporter: David Edmundson <kde>
Component: contactlistAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git-latest   
Target Milestone: 0.4.0   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description David Edmundson 2011-05-20 14:20:43 UTC
Version:           git-latest (using KDE 4.6.3) 
OS:                Linux

The accountFilterModel contains a really ugly hack that invalidates the filter each time any row changes. This is not only slow, but a sign of something else being fundamentally broken.

This is needed as otherwise the filter doesn't seem to apply presence filtering when using the group model (or flat-proxy-model).

When using a groups model, the dataChanged() signal appears to emit the wrong indexes (?). When asking for presences it's returning invalided QVariants.

Reproducible: Didn't try
Comment 1 David Edmundson 2011-05-30 02:44:18 UTC
Found it.

In ProxyTreeNode a signal is emitted when data changes.
A treenode should send itself as a paremeter of the signal, this is used to build the index.

The buggy code:
    connect(sourceNode,
            SIGNAL(changed(TreeNode*)),
            SIGNAL(changed(TreeNode*)));

sent the id of the real ContactModelItem* in the accounts model, not the proxyModeItem in the groups model. This caused messed up indexes to be created which weren't sure which model they were from.

Will push fix to RB tomorrow.
Comment 2 David Edmundson 2011-05-30 13:56:16 UTC
Git commit 0657159b437591fbfe98e4e2cb671d21071fd37e by David Edmundson.
Committed on 30/05/2011 at 13:13.
Pushed by davidedmundson into branch 'master'.

Fix groups model "note updated" signal, removed horrific hack which kept invalidating the model filter.

BUG: 273725
REVIEW: 101473

M  +0    -4    main-widget.cpp     
M  +7    -1    proxy-tree-node.cpp     
M  +1    -0    proxy-tree-node.h     

http://commits.kde.org/telepathy-contact-list/0657159b437591fbfe98e4e2cb671d21071fd37e