From 23ddfaae67eca73454b2f754aa9456cf41920d1e Mon Sep 17 00:00:00 2001
From: Teo Mrnjavac <teo@kde.org>
Date: Thu, 2 Apr 2015 12:27:54 +0200
Subject: [PATCH] Read configuration map into GreetingViewStep.

---
 src/modules/greeting/GreetingViewStep.cpp | 24 +++++++++++++++++++++++
 src/modules/greeting/GreetingViewStep.h   |  4 ++++
 2 files changed, 28 insertions(+)

diff --git a/src/modules/greeting/GreetingViewStep.cpp b/src/modules/greeting/GreetingViewStep.cpp
index 269ed2ca0a..e1e74d883b 100644
--- a/src/modules/greeting/GreetingViewStep.cpp
+++ b/src/modules/greeting/GreetingViewStep.cpp
@@ -20,6 +20,8 @@
 
 #include "GreetingPage.h"
 
+#include <QVariant>
+
 GreetingViewStep::GreetingViewStep( QObject* parent )
     : Calamares::ViewStep( parent )
     , m_widget( new GreetingPage() )
@@ -95,3 +97,25 @@ GreetingViewStep::jobs() const
     return QList< Calamares::job_ptr >();
 }
 
+
+void
+GreetingViewStep::setConfigurationMap( const QVariantMap& configurationMap )
+{
+    bool showSupportUrl =
+        configurationMap.contains( "showSupportUrl" ) &&
+        configurationMap.value( "showSupportUrl" ).type() == QVariant::Bool &&
+        configurationMap.value( "showSupportUrl" ).toBool();
+    bool showKnownIssuesUrl =
+        configurationMap.contains( "showKnownIssuesUrl" ) &&
+        configurationMap.value( "showKnownIssuesUrl" ).type() == QVariant::Bool &&
+        configurationMap.value( "showKnownIssuesUrl" ).toBool();
+    bool showReleaseNotesUrl =
+        configurationMap.contains( "showReleaseNotesUrl" ) &&
+        configurationMap.value( "showReleaseNotesUrl" ).type() == QVariant::Bool &&
+        configurationMap.value( "showReleaseNotesUrl" ).toBool();
+
+    m_widget->setUpLinks( showSupportUrl,
+                          showKnownIssuesUrl,
+                          showReleaseNotesUrl );
+}
+
diff --git a/src/modules/greeting/GreetingViewStep.h b/src/modules/greeting/GreetingViewStep.h
index bb6f194f6a..4ed4da6d42 100644
--- a/src/modules/greeting/GreetingViewStep.h
+++ b/src/modules/greeting/GreetingViewStep.h
@@ -24,6 +24,8 @@
 #include "viewpages/ViewStep.h"
 #include "PluginDllMacro.h"
 
+#include <QVariantMap>
+
 class GreetingPage;
 
 class PLUGINDLLEXPORT GreetingViewStep : public Calamares::ViewStep
@@ -52,6 +54,8 @@ public:
 
     QList< Calamares::job_ptr > jobs() const override;
 
+    void setConfigurationMap( const QVariantMap& configurationMap ) override;
+
 private:
     GreetingPage* m_widget;
 };
-- 
GitLab