Bug 308820

Summary: Does not respond to style changes immediately
Product: [Unmaintained] telepathy Reporter: David Edmundson <kde>
Component: contactlistAssignee: Telepathy Bugs <kde-telepathy-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: mklapetek
Priority: NOR Keywords: junior-jobs
Version: unspecified   
Target Milestone: Future   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 0.5.2
Sentry Crash Report:

Description David Edmundson 2012-10-22 17:40:33 UTC
Changing the KDE colour scheme does not immediately update the contact list.

This is because we have the following code in AbstractContactDelegate which we then use
    m_palette = new QPalette(QApplication::palette());
QApplication::palette is a very fast operation, so there's no point keeping it as a member variable.
This call just needs moving into each of the paintEvents.
Comment 1 David Edmundson 2012-10-22 17:47:01 UTC
Marking as a junior job. 

To solve find every instance of m_palette in the subclass and replace it with QApplication::palette() instead
Then remove m_palette completely.
Comment 2 Christoph Feck 2012-10-22 19:30:07 UTC
Note that the palette is also passed in the QStyleOption and available per widget. Generally, there is no need to access the application's global palette.
Comment 3 Martin Klapetek 2012-10-23 09:48:19 UTC
Btw. isn't there some signal saying "color scheme has changed"? I know I saw it somewhere, but can't find it now.
Comment 4 Martin Klapetek 2012-10-23 12:18:37 UTC
Git commit d57901ab55947c1f3bae152c7d30bd6704b056b7 by Martin Klapetek.
Committed on 23/10/2012 at 14:14.
Pushed by mklapetek into branch 'master'.

Use option's palette instead of storing app's palette in class var

Reviewed-by: Rohan Garg
REVIEW: 107008
Related: bug 308802

M  +4    -6    abstract-contact-delegate.cpp
M  +0    -1    abstract-contact-delegate.h
M  +4    -4    contact-delegate-compact.cpp
M  +4    -4    contact-delegate.cpp

http://commits.kde.org/telepathy-contact-list/d57901ab55947c1f3bae152c7d30bd6704b056b7