[welcome] Use convenience function
- Introduce a hasDetails() for RequirementEntry, which is just a short-cut, but makes code more readable.
This commit is contained in:
parent
bfb5a4efb9
commit
54ba0aaf13
@ -45,14 +45,17 @@ struct RequirementEntry
|
||||
/// @brief name of this requirement; not shown to user and used as ID
|
||||
QString name;
|
||||
|
||||
/// @brief Description of this requirement, for use in user-visible lists
|
||||
/// @brief Detailed description of this requirement, for use in user-visible lists
|
||||
TextFunction enumerationText;
|
||||
|
||||
/// @brief User-visible string to show that the requirement is not met
|
||||
/// @brief User-visible string to show that the requirement is not met, short form
|
||||
TextFunction negatedText;
|
||||
|
||||
bool satisfied;
|
||||
bool mandatory;
|
||||
|
||||
/// @brief Convenience to check if this entry should be shown in details dialog
|
||||
bool hasDetails() const { return !enumerationText().isEmpty(); }
|
||||
};
|
||||
|
||||
using RequirementsList = QList< RequirementEntry >;
|
||||
|
@ -179,7 +179,7 @@ ResultsListWidget::showDetailsDialog( const Calamares::RequirementsList& checkEn
|
||||
|
||||
for ( const auto& entry : checkEntries )
|
||||
{
|
||||
if ( entry.enumerationText().isEmpty() )
|
||||
if ( !entry.hasDetails() )
|
||||
continue;
|
||||
|
||||
ResultWidget* ciw = new ResultWidget( entry.satisfied, entry.mandatory );
|
||||
|
Loading…
Reference in New Issue
Block a user