From 0947da3d41f8a861020cca3a778899cd6f5244aa Mon Sep 17 00:00:00 2001
From: Adriaan de Groot <groot@kde.org>
Date: Tue, 19 May 2020 17:08:49 +0200
Subject: [PATCH] [libcalamaresui] Report on QML errors

- If the slideshow fails to load entirely, say so
---
 src/libcalamaresui/viewpages/Slideshow.cpp | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/libcalamaresui/viewpages/Slideshow.cpp b/src/libcalamaresui/viewpages/Slideshow.cpp
index 85551f797..db994029c 100644
--- a/src/libcalamaresui/viewpages/Slideshow.cpp
+++ b/src/libcalamaresui/viewpages/Slideshow.cpp
@@ -23,7 +23,9 @@
 #include "Branding.h"
 #include "utils/Dirs.h"
 #include "utils/Logger.h"
+#ifdef WITH_QML
 #include "utils/Qml.h"
+#endif
 #include "utils/Retranslator.h"
 
 #include <QLabel>
@@ -50,6 +52,8 @@ SlideshowQML::SlideshowQML( QWidget* parent )
     , m_qmlComponent( nullptr )
     , m_qmlObject( nullptr )
 {
+    CalamaresUtils::registerCalamaresModels();
+
     m_qmlShow->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
     m_qmlShow->setResizeMode( QQuickWidget::SizeRootObjectToView );
     m_qmlShow->engine()->addImportPath( CalamaresUtils::qmlModulesDir().absolutePath() );
@@ -126,6 +130,21 @@ SlideshowQML::loadQmlV2Complete()
             }
         }
     }
+    else
+    {
+        if ( m_qmlObject )
+        {
+            cWarning() << "QML object already created";
+        }
+        else if ( !m_qmlComponent )
+        {
+            cWarning() << "QML component does not exist";
+        }
+        else if ( m_qmlComponent && !m_qmlComponent->isReady() )
+        {
+            cWarning() << "QML component not ready:" << m_qmlComponent->errors();
+        }
+    }
 }
 
 /*