OSDN Git Service

kdeplasma-addons: adjust to Katie changes
authorIvailo Monev <xakepa10@gmail.com>
Sun, 11 Jun 2023 16:16:13 +0000 (19:16 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 11 Jun 2023 16:16:13 +0000 (19:16 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kdeplasma-addons/wallpapers/qmlwallpapers/wallpapersqml.cpp
kdeplasma-addons/wallpapers/qmlwallpapers/wallpapersqml.h

index 1249382..64a70b1 100644 (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();
index b7a4d71..4d8ceb6 100644 (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);