Skip to content

Commit

Permalink
update english after PR review in the project validator
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Apr 22, 2020
1 parent 471979a commit 4e7018d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions python/core/auto_generated/qgsprojectservervalidator.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsprojectproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsprojectservervalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/core/qgsprojectservervalidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4e7018d

Please sign in to comment.