kdeplasma-addons: adjust to Katie changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-06-11 19:16:13 +03:00
parent 18861df1f3
commit 1cc12738f4
2 changed files with 26 additions and 2 deletions

View file

@ -50,7 +50,15 @@ WallpaperQml::WallpaperQml(QObject *parent, const QVariantList &args)
kdeclarative.setupBindings();
m_component = new QDeclarativeComponent(m_engine);
connect(m_component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), SLOT(componentStatusChanged(QDeclarativeComponent::Status)));
connect(
#if QT_VERSION < 0x041300
m_component, SIGNAL(statusChanged(QDeclarativeComponent::Status)),
this, SLOT(componentStatusChanged(QDeclarativeComponent::Status))
#else
m_component, SIGNAL(statusChanged(QDeclarativeComponent::ComponentStatus)),
this, SLOT(componentStatusChanged(QDeclarativeComponent::ComponentStatus))
#endif
);
connect(this, SIGNAL(renderHintsChanged()), SLOT(resizeWallpaper()));
connect(m_scene, SIGNAL(changed(QList<QRectF>)), SLOT(shouldRepaint(QList<QRectF>)));
}
@ -83,7 +91,11 @@ void WallpaperQml::setPackageName(const QString& packageName)
kWarning() << "couldn't load the package named" << packageName;
}
#if QT_VERSION < 0x041300
void WallpaperQml::componentStatusChanged(QDeclarativeComponent::Status s)
#else
void WallpaperQml::componentStatusChanged(QDeclarativeComponent::ComponentStatus s)
#endif
{
if (s==QDeclarativeComponent::Ready) {
if (m_item) {
@ -100,7 +112,15 @@ void WallpaperQml::componentStatusChanged(QDeclarativeComponent::Status s)
} else if (s==QDeclarativeComponent::Error) {
delete m_component;
m_component = new QDeclarativeComponent(m_engine);
connect(m_component, SIGNAL(statusChanged(QDeclarativeComponent::Status)), SLOT(componentStatusChanged(QDeclarativeComponent::Status)));
connect(
#if QT_VERSION < 0x041300
m_component, SIGNAL(statusChanged(QDeclarativeComponent::Status)),
this, SLOT(componentStatusChanged(QDeclarativeComponent::Status))
#else
m_component, SIGNAL(statusChanged(QDeclarativeComponent::ComponentStatus)),
this, SLOT(componentStatusChanged(QDeclarativeComponent::ComponentStatus))
#endif
);
}
if (!m_component->errors().isEmpty())
kDebug() << "wallpaper errors:" << m_component->errors();

View file

@ -40,7 +40,11 @@ class WallpaperQml : public Plasma::Wallpaper
private slots:
void resizeWallpaper();
void shouldRepaint(const QList< QRectF >& rects);
#if QT_VERSION < 0x041300
void componentStatusChanged(QDeclarativeComponent::Status s);
#else
void componentStatusChanged(QDeclarativeComponent::ComponentStatus s);
#endif
void setPackageName(const QString& name);
void changeWallpaper(const QModelIndex& idx);
void setBackgroundColor(const QColor& color);