Bug 273725 - Ugly hack in AccountFilterModel
Summary: Ugly hack in AccountFilterModel
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: contactlist (show other bugs)
Version: git-latest
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 0.4.0
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 14:20 UTC by David Edmundson
Modified: 2012-07-06 12:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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