file() and setFile() -> imagePath() and setImagePath()
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=797772
This commit is contained in:
parent
b08e8ae782
commit
f522c38eeb
@ -90,17 +90,17 @@ PanelSvg::~PanelSvg()
|
|||||||
|
|
||||||
void PanelSvg::setImagePath(const QString& imagePath)
|
void PanelSvg::setImagePath(const QString& imagePath)
|
||||||
{
|
{
|
||||||
if (imagePath == d->background->file()) {
|
if (imagePath == d->background->imagePath()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->background->setFile(imagePath);
|
d->background->setImagePath(imagePath);
|
||||||
setElementPrefix(prefix());
|
setElementPrefix(prefix());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PanelSvg::imagePath() const
|
QString PanelSvg::imagePath() const
|
||||||
{
|
{
|
||||||
return d->background->file();
|
return d->background->imagePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PanelSvg::setEnabledBorders(const EnabledBorders borders)
|
void PanelSvg::setEnabledBorders(const EnabledBorders borders)
|
||||||
|
4
svg.cpp
4
svg.cpp
@ -453,13 +453,13 @@ Svg::ContentType Svg::contentType()
|
|||||||
return d->contentType;
|
return d->contentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Svg::setFile(const QString &svgFilePath)
|
void Svg::setImagePath(const QString &svgFilePath)
|
||||||
{
|
{
|
||||||
d->setImagePath(svgFilePath, this);
|
d->setImagePath(svgFilePath, this);
|
||||||
d->eraseRenderer();
|
d->eraseRenderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Svg::file() const
|
QString Svg::imagePath() const
|
||||||
{
|
{
|
||||||
return d->themed ? d->themePath : d->path;
|
return d->themed ? d->themePath : d->path;
|
||||||
}
|
}
|
||||||
|
6
svg.h
6
svg.h
@ -50,7 +50,7 @@ class PLASMA_EXPORT Svg : public QObject
|
|||||||
Q_ENUMS( ContentType )
|
Q_ENUMS( ContentType )
|
||||||
Q_PROPERTY( QSize size READ size )
|
Q_PROPERTY( QSize size READ size )
|
||||||
Q_PROPERTY( ContentType contentType READ contentType WRITE setContentType )
|
Q_PROPERTY( ContentType contentType READ contentType WRITE setContentType )
|
||||||
Q_PROPERTY( QString file READ file WRITE setFile )
|
Q_PROPERTY( QString filePath READ imagePath WRITE setImagePath )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -196,13 +196,13 @@ class PLASMA_EXPORT Svg : public QObject
|
|||||||
* Convenience method for setting the svg file to use for the Svg.
|
* Convenience method for setting the svg file to use for the Svg.
|
||||||
* @arg svgFilePath the filepath including name of the svg.
|
* @arg svgFilePath the filepath including name of the svg.
|
||||||
*/
|
*/
|
||||||
void setFile(const QString &svgFilePath);
|
void setImagePath(const QString &svgFilePath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience method to get the svg filepath and name of svg.
|
* Convenience method to get the svg filepath and name of svg.
|
||||||
* @return the svg's filepath including name of the svg.
|
* @return the svg's filepath including name of the svg.
|
||||||
*/
|
*/
|
||||||
QString file() const;
|
QString imagePath() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void repaintNeeded();
|
void repaintNeeded();
|
||||||
|
@ -473,7 +473,7 @@ void Icon::setSvg(const QString &svgFilePath, const QString &elementId)
|
|||||||
if (!d->iconSvg) {
|
if (!d->iconSvg) {
|
||||||
d->iconSvg = new Plasma::Svg(svgFilePath);
|
d->iconSvg = new Plasma::Svg(svgFilePath);
|
||||||
} else {
|
} else {
|
||||||
d->iconSvg->setFile(svgFilePath);
|
d->iconSvg->setImagePath(svgFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
d->iconSvgElement = elementId;
|
d->iconSvgElement = elementId;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user