37 results <<
ValidationResult( QObject::tr(
"identifier" ), QObject::tr(
"Identifier element is required." ) );
40 if ( metadata->
language().isEmpty() )
43 results <<
ValidationResult( QObject::tr(
"language" ), QObject::tr(
"Language element is required." ) );
46 if ( metadata->
type().isEmpty() )
49 results <<
ValidationResult( QObject::tr(
"type" ), QObject::tr(
"Type element is required." ) );
52 if ( metadata->
title().isEmpty() )
55 results <<
ValidationResult( QObject::tr(
"title" ), QObject::tr(
"Title element is required." ) );
58 if ( metadata->
abstract().isEmpty() )
61 results <<
ValidationResult( QObject::tr(
"abstract" ), QObject::tr(
"Abstract element is required." ) );
64 if ( metadata->
contacts().isEmpty() )
67 results <<
ValidationResult( QObject::tr(
"contacts" ), QObject::tr(
"At least one contact is required." ) );
70 if ( metadata->
links().isEmpty() )
73 results <<
ValidationResult( QObject::tr(
"links" ), QObject::tr(
"At least one link is required." ) );
78 QgsAbstractMetadataBase::KeywordMap::const_iterator keywordIt = keywords.constBegin();
80 for ( ; keywordIt != keywords.constEnd(); ++keywordIt )
82 if ( keywordIt.key().isEmpty() )
85 results <<
ValidationResult( QObject::tr(
"keywords" ), QObject::tr(
"Keyword vocabulary cannot be empty." ), index );
87 if ( keywordIt.value().isEmpty() )
90 results <<
ValidationResult( QObject::tr(
"keywords" ), QObject::tr(
"Keyword list cannot be empty." ), index );
97 const auto constContacts = metadata->
contacts();
100 if ( contact.name.isEmpty() )
103 results <<
ValidationResult( QObject::tr(
"contacts" ), QObject::tr(
"Contact name cannot be empty." ), index );
110 const auto constLinks = metadata->
links();
113 if ( link.name.isEmpty() )
116 results <<
ValidationResult( QObject::tr(
"links" ), QObject::tr(
"Link name cannot be empty." ), index );
118 if ( link.type.isEmpty() )
121 results <<
ValidationResult( QObject::tr(
"links" ), QObject::tr(
"Link type cannot be empty." ), index );
123 if ( link.url.isEmpty() )
126 results <<
ValidationResult( QObject::tr(
"links" ), QObject::tr(
"Link url cannot be empty." ), index );
150 if ( metadata->
licenses().isEmpty() )
153 results <<
ValidationResult( QObject::tr(
"license" ), QObject::tr(
"At least one license is required." ) );
159 results <<
ValidationResult( QObject::tr(
"crs" ), QObject::tr(
"A valid CRS element is required." ) );
166 if ( !extent.extentCrs.isValid() )
169 results <<
ValidationResult( QObject::tr(
"extent" ), QObject::tr(
"A valid CRS element for the spatial extent is required." ), index );
172 if ( extent.bounds.width() == 0.0 || extent.bounds.height() == 0.0 )
175 results <<
ValidationResult( QObject::tr(
"extent" ), QObject::tr(
"A valid spatial extent is required." ), index );
200 if ( metadata->
author().isEmpty() )
203 results <<
ValidationResult( QObject::tr(
"author" ), QObject::tr(
"A project author is required." ) );
209 results <<
ValidationResult( QObject::tr(
"creation" ), QObject::tr(
"The project creation date/time is required." ) );
bool isValid() const
Returns whether this CRS is correctly initialized and usable.