Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Modernize language
And avoid insensitive/trigger words (as far as possible -- some are
coming from Qt or other external APIs)
  • Loading branch information
nyalldawson committed Jun 13, 2020
1 parent 49c62a5 commit 561a832
Show file tree
Hide file tree
Showing 24 changed files with 189 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .ci/travis/linux/scripts/docker-qgis-test.sh
Expand Up @@ -97,7 +97,7 @@ echo "travis_fold:end:oracle"
CURRENT_TIME=$(date +%s)
TIMEOUT=$((( TRAVIS_AVAILABLE_TIME - TRAVIS_UPLOAD_TIME) * 60 - CURRENT_TIME + TRAVIS_TIMESTAMP))
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
EXCLUDE_TESTS=$(cat /root/QGIS/.ci/travis/linux/scripts/test_blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)
EXCLUDE_TESTS=$(cat /root/QGIS/.ci/travis/linux/scripts/test_blocklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)
if ! [[ ${RUN_FLAKY_TESTS} =~ ^true$ ]]; then
echo "Flaky tests are skipped!"
EXCLUDE_TESTS=${EXCLUDE_TESTS}"|"$(cat /root/QGIS/.ci/travis/linux/scripts/test_flaky.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .ci/travis/macos/script.sh
Expand Up @@ -33,7 +33,7 @@ TIMEOUT=$((40 * 60 - $(date +%s) + $(cat /tmp/travis_timestamp)))
export CTEST_BUILD_COMMAND=/usr/local/bin/ninja
export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}

gtimeout "${TIMEOUT}s" ctest -V -E "$(cat "${DIR}"/blacklist.txt | gsed -r '/^(#.*?)?$/d' | gpaste -sd '|' -)" -S "${DIR}/../travis.ctest" --output-on-failure
gtimeout "${TIMEOUT}s" ctest -V -E "$(cat "${DIR}"/blocklist.txt | gsed -r '/^(#.*?)?$/d' | gpaste -sd '|' -)" -S "${DIR}/../travis.ctest" --output-on-failure

rv=$?

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/auth/qgsauthcertutils.sip.in
Expand Up @@ -294,7 +294,7 @@ certIsCurrent checks if ``cert`` is viable for its not before and not after date

static QList<QSslError> certViabilityErrors( const QSslCertificate &cert );
%Docstring
certViabilityErrors checks basic characteristics (validity dates, blacklisting, etc.) of given ``cert``
certViabilityErrors checks basic characteristics (validity dates, blocklisting, etc.) of given ``cert``

:param cert: certificate to be checked

Expand Down
63 changes: 46 additions & 17 deletions python/core/auto_generated/qgsmaplayerproxymodel.sip.in
Expand Up @@ -76,58 +76,87 @@ Returns if the ``layer`` matches the given ``filters``
.. versionadded:: 3.14
%End

void setLayerWhitelist( const QList<QgsMapLayer *> &layers );
void setLayerWhitelist( const QList<QgsMapLayer *> &layers ) /Deprecated/;
%Docstring
Sets a whitelist of ``layers`` to include within the model. Only layers
Sets an allowlist of ``layers`` to include within the model. Only layers
from this list will be shown.

An empty list indicates that no whitelisting should be performed.
An empty list indicates that no filter by allowlist should be performed.

.. seealso:: :py:func:`layerWhitelist`
.. seealso:: :py:func:`layerAllowlist`

.. seealso:: :py:func:`setExceptedLayerList`

.. versionadded:: 3.4
.. deprecated::
use setLayerAllowList()
%End

void setLayerAllowlist( const QList<QgsMapLayer *> &layers );
%Docstring
Sets an allowlist of ``layers`` to include within the model. Only layers
from this list will be shown.

An empty list indicates that no filter by allowlist should be performed.

.. seealso:: :py:func:`layerAllowlist`

.. seealso:: :py:func:`setExceptedLayerList`

.. versionadded:: 3.14
%End

QList<QgsMapLayer *> layerWhitelist();
QList<QgsMapLayer *> layerWhitelist() /Deprecated/;
%Docstring
Returns the list of layers which are excluded from the model.

An empty list indicates that no whitelisting should be performed.
An empty list indicates that no filtering by allowlist should be performed.

.. seealso:: :py:func:`setLayerWhitelist`
.. seealso:: :py:func:`setLayerAllowlist`

.. seealso:: :py:func:`exceptedLayerList`

.. versionadded:: 3.4
.. deprecated::
use layerAllowlist() instead
%End

QList<QgsMapLayer *> layerAllowlist();
%Docstring
Returns the list of layers which are excluded from the model.

An empty list indicates that no filtering by allowlist should be performed.

.. seealso:: :py:func:`setLayerAllowlist`

.. seealso:: :py:func:`exceptedLayerList`

.. versionadded:: 3.14
%End

void setExceptedLayerList( const QList<QgsMapLayer *> &exceptList );
%Docstring
Sets a blacklist of layers to exclude from the model.
Sets a blocklist of layers to exclude from the model.

.. seealso:: :py:func:`exceptedLayerList`

.. seealso:: :py:func:`setExceptedLayerIds`

.. seealso:: :py:func:`setLayerWhitelist`
.. seealso:: :py:func:`setLayerAllowlist`
%End

QList<QgsMapLayer *> exceptedLayerList();
%Docstring
Returns the blacklist of layers which are excluded from the model.
Returns the blocklist of layers which are excluded from the model.

.. seealso:: :py:func:`setExceptedLayerList`

.. seealso:: :py:func:`exceptedLayerIds`

.. seealso:: :py:func:`layerWhitelist`
.. seealso:: :py:func:`layerAllowlist`
%End

void setExceptedLayerIds( const QStringList &ids );
%Docstring
Sets a blacklist of layers (by layer ID) to exclude from the model.
Sets a blocklist of layers (by layer ID) to exclude from the model.

.. seealso:: :py:func:`exceptedLayerIds`

Expand All @@ -136,7 +165,7 @@ Sets a blacklist of layers (by layer ID) to exclude from the model.

QStringList exceptedLayerIds() const;
%Docstring
Returns the blacklist of layer IDs which are excluded from the model.
Returns the blocklist of layer IDs which are excluded from the model.

.. seealso:: :py:func:`setExceptedLayerIds`

Expand All @@ -145,7 +174,7 @@ Returns the blacklist of layer IDs which are excluded from the model.

void setExcludedProviders( const QStringList &providers );
%Docstring
Sets a blacklist of data providers which should be excluded from the model.
Sets a blocklist of data providers which should be excluded from the model.

.. seealso:: :py:func:`excludedProviders`

Expand All @@ -154,7 +183,7 @@ Sets a blacklist of data providers which should be excluded from the model.

QStringList excludedProviders() const;
%Docstring
Returns the blacklist of data providers which are excluded from the model.
Returns the blocklist of data providers which are excluded from the model.

.. seealso:: :py:func:`setExcludedProviders`

Expand Down
36 changes: 28 additions & 8 deletions python/core/auto_generated/qgsvectorlayerjoininfo.sip.in
Expand Up @@ -170,32 +170,52 @@ join layer information.
.. versionadded:: 3.0
%End

void setJoinFieldNamesBlackList( const QStringList &blackList );
void setJoinFieldNamesBlackList( const QStringList &blackList ) /Deprecated/;
%Docstring
Sets a list of fields to ignore whatever happens.

.. versionadded:: 3.0
.. deprecated::
use setJoinFieldNamesBlockList() instead
%End

QStringList joinFieldNamesBlackList() const;
QStringList joinFieldNamesBlackList() const /Deprecated/;
%Docstring
Returns the list of fields to ignore.

.. versionadded:: 3.0
.. deprecated::
use joinFieldNamesBlockList() instead
%End

void setJoinFieldNamesBlockList( const QStringList &list );
%Docstring
Sets a ``list`` of fields to ignore whatever happens.

.. seealso:: :py:func:`joinFieldNamesBlockList`

.. versionadded:: 3.14
%End

QStringList joinFieldNamesBlockList() const;
%Docstring
Returns the list of fields to ignore.

.. seealso:: :py:func:`setJoinFieldNamesBlockList`

.. versionadded:: 3.14
%End

bool hasSubset( bool blacklisted = true ) const;
bool hasSubset( bool blocklisted = true ) const;
%Docstring
Returns ``True`` if blacklisted fields is not empty or if a subset of names
Returns ``True`` if blocklisted fields is not empty or if a subset of names
has been set.

.. versionadded:: 3.0
%End

static QStringList joinFieldNamesSubset( const QgsVectorLayerJoinInfo &info, bool blacklisted = true );
static QStringList joinFieldNamesSubset( const QgsVectorLayerJoinInfo &info, bool blocklisted = true );
%Docstring
Returns the list of field names to use for joining considering
blacklisted fields and subset.
blocklisted fields and subset.

.. versionadded:: 3.0
%End
Expand Down
4 changes: 2 additions & 2 deletions python/core/conversions.sip
Expand Up @@ -1700,8 +1700,8 @@ bool null_from_qvariant_converter( const QVariant *varp, PyObject **objp )

// If we deal with a NULL QVariant (and it's not a QByteArray which properly
// maps NULL values)
// If there are more cases like QByteArray, we should consider using a whitelist
// instead of a blacklist.
// If there are more cases like QByteArray, we should consider using a allowlist
// instead of a blocklist.
if ( varp->isNull() && varp->type() != QVariant::ByteArray )
{
sWatchDog = true;
Expand Down
2 changes: 1 addition & 1 deletion scripts/runtests_local_travis_config.sh
Expand Up @@ -2,5 +2,5 @@
DIR=$(git rev-parse --show-toplevel)
cd $1 || exit
FOLDER=linux
ctest -E "$(cat ${DIR}/.ci/travis/${FOLDER}/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" --output-on-failure
ctest -E "$(cat ${DIR}/.ci/travis/${FOLDER}/blocklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" --output-on-failure
cd $DIR || exit
2 changes: 1 addition & 1 deletion scripts/sipdiff
Expand Up @@ -27,7 +27,7 @@ for file in $*; do
f=${f%.*}
header="src/$d/$f.h"

if ! grep -Fxq "$d/$f.sip" python/auto_sip.blacklist; then
if ! grep -Fxq "$d/$f.sip" python/auto_sip.blocklist; then
echo -e "\033[0;31m$d/$f.sip is an automatically generated SIP file\033[0m"
echo -e " g) \x1B[4mg\x1B[0menerate the SIP file \033[0;32m./scripts/sipify.pl $header > python/$d/$f.sip\033[0m"
echo -e " s) \x1B[4ms\x1B[0mhow the diff"
Expand Down
4 changes: 2 additions & 2 deletions src/core/auth/qgsauthcertutils.cpp
Expand Up @@ -1201,7 +1201,7 @@ QString QgsAuthCertUtils::sslErrorEnumString( QSslError::SslError errenum )
case QSslError::UnspecifiedError:
return QObject::tr( "Unspecified Error" );
case QSslError::CertificateBlacklisted:
return QObject::tr( "Certificate Blacklisted" );
return QObject::tr( "Certificate Blocklisted" );
case QSslError::NoError:
return QObject::tr( "No Error" );
case QSslError::NoSslSupport:
Expand Down Expand Up @@ -1326,7 +1326,7 @@ QList<QSslError> QgsAuthCertUtils::validateCertChain( const QList<QSslCertificat
}
}

// Check that no certs in the chain are expired or not yet valid or blacklisted
// Check that no certs in the chain are expired or not yet valid or blocklisted
const QList<QSslCertificate> constTrustedChain( trustedChain );
for ( const auto &cert : constTrustedChain )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/auth/qgsauthcertutils.h
Expand Up @@ -336,7 +336,7 @@ class CORE_EXPORT QgsAuthCertUtils
static bool certIsCurrent( const QSslCertificate &cert );

/**
* \brief certViabilityErrors checks basic characteristics (validity dates, blacklisting, etc.) of given \a cert
* \brief certViabilityErrors checks basic characteristics (validity dates, blocklisting, etc.) of given \a cert
* \param cert certificate to be checked
* \return list of QSslError (will return NO ERRORS if a null QSslCertificate is passed)
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsauxiliarystorage.cpp
Expand Up @@ -79,7 +79,7 @@ QgsAuxiliaryLayer::QgsAuxiliaryLayer( const QString &pkField, const QString &fil
mJoinInfo.setEditable( true );
mJoinInfo.setUpsertOnEdit( true );
mJoinInfo.setCascadedDelete( true );
mJoinInfo.setJoinFieldNamesBlackList( QStringList() << QStringLiteral( "rowid" ) ); // introduced by ogr provider
mJoinInfo.setJoinFieldNamesBlockList( QStringList() << QStringLiteral( "rowid" ) ); // introduced by ogr provider
}

QgsAuxiliaryLayer *QgsAuxiliaryLayer::clone( QgsVectorLayer *target ) const
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsjsonutils.cpp
Expand Up @@ -144,8 +144,8 @@ json QgsJsonExporter::exportFeatureToJsonObject( const QgsFeature &feature, cons
{
QgsFields fields = mLayer ? mLayer->fields() : feature.fields();
// List of formatters through we want to pass the values
QStringList formattersWhiteList;
formattersWhiteList << QStringLiteral( "KeyValue" )
QStringList formattersAllowList;
formattersAllowList << QStringLiteral( "KeyValue" )
<< QStringLiteral( "List" )
<< QStringLiteral( "ValueRelation" )
<< QStringLiteral( "ValueMap" );
Expand All @@ -161,7 +161,7 @@ json QgsJsonExporter::exportFeatureToJsonObject( const QgsFeature &feature, cons
{
const QgsEditorWidgetSetup setup = fields.at( i ).editorWidgetSetup();
const QgsFieldFormatter *fieldFormatter = QgsApplication::fieldFormatterRegistry()->fieldFormatter( setup.type() );
if ( formattersWhiteList.contains( fieldFormatter->id() ) )
if ( formattersAllowList.contains( fieldFormatter->id() ) )
val = fieldFormatter->representValue( mLayer.data(), i, setup.config(), QVariant(), val );
}

Expand Down
13 changes: 9 additions & 4 deletions src/core/qgsmaplayerproxymodel.cpp
Expand Up @@ -84,10 +84,15 @@ bool QgsMapLayerProxyModel::layerMatchesFilters( const QgsMapLayer *layer, const

void QgsMapLayerProxyModel::setLayerWhitelist( const QList<QgsMapLayer *> &layers )
{
if ( mLayerWhitelist == layers )
setLayerAllowlist( layers );
}

void QgsMapLayerProxyModel::setLayerAllowlist( const QList<QgsMapLayer *> &layers )
{
if ( mLayerAllowlist == layers )
return;

mLayerWhitelist = layers;
mLayerAllowlist = layers;
invalidateFilter();
}

Expand Down Expand Up @@ -136,7 +141,7 @@ bool QgsMapLayerProxyModel::acceptsLayer( QgsMapLayer *layer ) const
if ( !layer )
return false;

if ( !mLayerWhitelist.isEmpty() && !mLayerWhitelist.contains( layer ) )
if ( !mLayerAllowlist.isEmpty() && !mLayerAllowlist.contains( layer ) )
return false;

if ( mExceptList.contains( layer ) )
Expand All @@ -162,7 +167,7 @@ void QgsMapLayerProxyModel::setFilterString( const QString &filter )

bool QgsMapLayerProxyModel::filterAcceptsRow( int source_row, const QModelIndex &source_parent ) const
{
if ( mFilters.testFlag( All ) && mExceptList.isEmpty() && mLayerWhitelist.isEmpty() && mExcludedProviders.isEmpty() && mFilterString.isEmpty() )
if ( mFilters.testFlag( All ) && mExceptList.isEmpty() && mLayerAllowlist.isEmpty() && mExcludedProviders.isEmpty() && mFilterString.isEmpty() )
return true;

QModelIndex index = sourceModel()->index( source_row, 0, source_parent );
Expand Down

0 comments on commit 561a832

Please sign in to comment.