Bug 284907 - KPresence operator< code is nonsense
Summary: KPresence operator< code is nonsense
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: common-internals (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: 0.4.0
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 00:44 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-10-25 00:44:06 UTC
it constructs a lookup table each time, and this is incorrectly called m_presenceSorting despite not being a member variable. Result of bad copy+pasting.

---

Needs moving to static variable, with a static initialiser. (and probably a static bool to say it's been initialised).

OR

get rid of the hash and replace it with a private method that returns an int based on a switch statement.
Comment 1 David Edmundson 2011-10-25 00:48:42 UTC
Edit: I meant KPresence not K
Comment 2 Martin Klapetek 2011-10-28 16:16:49 UTC
Git commit 751cf71a63996deff524573c9f46ab68371c809a by Martin Klapetek.
Committed on 28/10/2011 at 18:13.
Pushed by mklapetek into branch 'master'.

Fix KPresence operator< ineffectivness by splitting the priority checking to a separate method with switch()

BUG: 284907

M  +30   -17   kpresence.cpp
M  +3    -0    kpresence.h

http://commits.kde.org/telepathy-common-internals/751cf71a63996deff524573c9f46ab68371c809a