@ -98,48 +98,10 @@ WelcomeQmlViewStep::jobs() const
return Calamares : : JobList ( ) ;
}
/** @brief Look up a URL for a button
*
* Looks up @ p key in @ p map ; if it is a * boolean * value , then
* assume an old - style configuration , and fetch the string from
* the branding settings @ p e . If it is a string , not a boolean ,
* use it as - is . If not found , or a weird type , returns empty .
*
* This allows switching the showKnownIssuesUrl and similar settings
* in welcome . conf from a boolean ( deferring to branding ) to an
* actual string for immediate use . Empty strings , as well as
* " false " as a setting , will hide the buttons as before .
*/
static QString
jobOrBrandingSetting ( Calamares : : Branding : : StringEntry e , const QVariantMap & map , const QString & key )
{
if ( ! map . contains ( key ) )
{
return QString ( ) ;
}
auto v = map . value ( key ) ;
if ( v . type ( ) = = QVariant : : Bool )
{
return v . toBool ( ) ? ( Calamares : : Branding : : instance ( ) - > string ( e ) ) : QString ( ) ;
}
if ( v . type ( ) = = QVariant : : String )
{
return v . toString ( ) ;
}
return QString ( ) ;
}
void
WelcomeQmlViewStep : : setConfigurationMap ( const QVariantMap & configurationMap )
{
using Calamares : : Branding ;
m_config - > setSupportUrl ( jobOrBrandingSetting ( Branding : : SupportUrl , configurationMap , " showSupportUrl " ) ) ;
m_config - > setKnownIssuesUrl ( jobOrBrandingSetting ( Branding : : KnownIssuesUrl , configurationMap , " showKnownIssuesUrl " ) ) ;
m_config - > setReleaseNotesUrl ( jobOrBrandingSetting ( Branding : : ReleaseNotesUrl , configurationMap , " showReleaseNotesUrl " ) ) ;
m_config - > setDonateUrl ( CalamaresUtils : : getString ( configurationMap , " showDonateUrl " ) ) ;
// TODO: expand Config class and set the remaining fields // with the configurationMap all those properties can be accessed without having to declare a property, get and setter for each
m_config - > setConfigurationMap ( configurationMap ) ;
// TODO: figure out how the requirements (held by ModuleManager) should be accessible
// to QML as a model. //will be model as a qvariantmap containing a alert level and the message string