themeChanged() and colorsChanged() now are Q_PRIVATE_SLOTS

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797745
This commit is contained in:
Marco Martin 2008-04-16 20:30:18 +00:00
parent 6024f48475
commit b08e8ae782
2 changed files with 37 additions and 36 deletions

66
svg.cpp
View File

@ -68,8 +68,9 @@ class SharedSvgRenderer : public KSvgRenderer, public QSharedData
class Svg::Private
{
public:
Private(const QString& imagePath, Svg *q)
: renderer(0),
Private(const QString& imagePath, Svg *svg)
: q(svg),
renderer(0),
contentType(Svg::SingleImage),
themed(false)
{
@ -290,6 +291,37 @@ class Svg::Private
return renderer->matrixForElement(elementId);
}
void themeChanged()
{
if (!themed) {
return;
}
QString newPath = Theme::self()->imagePath(themePath);
if (path == newPath) {
return;
}
removeFromCache();
path = newPath;
//delete d->renderer; we're a KSharedPtr
eraseRenderer();
emit q->repaintNeeded();
}
void colorsChanged()
{
if (!applyColors) {
return;
}
removeFromCache();
eraseRenderer();
emit q->repaintNeeded();
}
Svg *q;
static QHash<QString, SharedSvgRenderer::Ptr> renderers;
SharedSvgRenderer::Ptr renderer;
QString themePath;
@ -432,36 +464,6 @@ QString Svg::file() const
return d->themed ? d->themePath : d->path;
}
void Svg::themeChanged()
{
if (!d->themed) {
return;
}
QString newPath = Theme::self()->imagePath(d->themePath);
if (d->path == newPath) {
return;
}
d->removeFromCache();
d->path = newPath;
//delete d->renderer; we're a KSharedPtr
d->eraseRenderer();
emit repaintNeeded();
}
void Svg::colorsChanged()
{
if (!d->applyColors) {
return;
}
d->removeFromCache();
d->eraseRenderer();
emit repaintNeeded();
}
} // Plasma namespace
#include "svg.moc"

7
svg.h
View File

@ -207,13 +207,12 @@ class PLASMA_EXPORT Svg : public QObject
Q_SIGNALS:
void repaintNeeded();
private Q_SLOTS:
void themeChanged();
void colorsChanged();
private:
class Private;
Private* const d;
Q_PRIVATE_SLOT(d, void themeChanged());
Q_PRIVATE_SLOT(d, void colorsChanged());
};
} // Plasma namespace