Skip to content
Permalink
Browse files

update english after PR review in the project validator

  • Loading branch information
Gustry committed Apr 22, 2020
1 parent 471979a commit 4e7018db79a14775ffd7725b5f717a195165200a
@@ -13,7 +13,7 @@
class QgsProjectServerValidator
{
%Docstring
Project server validator.
Validates the server specific parts of the configuration of a QGIS project.

.. versionadded:: 3.14
%End
@@ -59,7 +59,7 @@ Constructor for ValidationResult.

static bool validate( QgsProject *project, QList< QgsProjectServerValidator::ValidationResult > &results /Out/ );
%Docstring
Validates a project to avoid some problems on QGIS Server, and returns ``True`` if it's considered valid.
Validates a project to detect problems on QGIS Server, and returns ``True`` if it's considered valid.
If validation fails, the ``results`` list will be filled with a list of
items describing why the validation failed and what needs to be rectified

@@ -1922,7 +1922,7 @@ void QgsProjectProperties::pbnLaunchOWSChecker_clicked()
}
else
{
errors += QString( tr( "Ok, it seems valid." ) );
errors += tr( "Project is valid." );
}

QString myStyle = QgsApplication::reportStyleSheet();
@@ -27,11 +27,11 @@ QString QgsProjectServerValidator::displayValidationError( QgsProjectServerValid
switch ( error )
{
case QgsProjectServerValidator::Encoding:
return QObject::tr( "Encoding is not set properly. A non 'System' encoding is required" );
return QObject::tr( "Encoding is not correctly set. A non 'System' encoding is required" );
case QgsProjectServerValidator::ShortNames:
return QObject::tr( "Layer short name is not valid. It must start with an unaccented alphabetical letter, followed by any alphanumeric letters, dot, dash or underscore" );
case QgsProjectServerValidator::DuplicatedNames:
return QObject::tr( "One or more layers or groups have the same name or short name. Both the 'name' and 'short name' for layers and groups needs to be unique" );
return QObject::tr( "One or more layers or groups have the same name or short name. Both the 'name' and 'short name' for layers and groups must be unique" );
}
return QString();
}
@@ -67,7 +67,7 @@ void QgsProjectServerValidator::browseLayerTree( QgsLayerTreeGroup *treeGroup, Q
if ( layer->type() == QgsMapLayerType::VectorLayer )
{
QgsVectorLayer *vl = static_cast<QgsVectorLayer *>( layer );
if ( vl->dataProvider()->encoding() == QLatin1String( "System" ) )
if ( vl->dataProvider() && vl->dataProvider()->encoding() == QLatin1String( "System" ) )
encodingMessages << layer->name();
}
}
@@ -19,14 +19,15 @@
#define QGSPROJECTSERVERVALIDATOR_H

#include "qgis_core.h"
#include "qgis_sip.h"
#include "qgslayertreegroup.h"
#include "qgslayertree.h"


/**
* \ingroup core
* \class QgsProjectServerValidator
* \brief Project server validator.
* \brief Validates the server specific parts of the configuration of a QGIS project.
* \since QGIS 3.14
*/
class CORE_EXPORT QgsProjectServerValidator
@@ -76,13 +77,13 @@ class CORE_EXPORT QgsProjectServerValidator
QgsProjectServerValidator::ValidationError error;

/**
* Identifier related to the error.
* Identifier related to the error. It can be a layer/group name.
*/
QVariant identifier;
};

/**
* Validates a project to avoid some problems on QGIS Server, and returns TRUE if it's considered valid.
* Validates a project to detect problems on QGIS Server, and returns TRUE if it's considered valid.
* If validation fails, the \a results list will be filled with a list of
* items describing why the validation failed and what needs to be rectified
* \param project input project to check

0 comments on commit 4e7018d

Please sign in to comment.
You can’t perform that action at this time.