Bug 308820 - Does not respond to style changes immediately
Summary: Does not respond to style changes immediately
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Unmaintained
Component: contactlist (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2012-10-22 17:40 UTC by David Edmundson
Modified: 2012-10-23 12:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.5.2
Sentry Crash Report:


Attachments

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