Skip to content

Commit ffae79b

Browse files
committedJan 22, 2019
Consider feedback
1 parent abd6297 commit ffae79b

File tree

9 files changed

+54
-31
lines changed

9 files changed

+54
-31
lines changed
 

‎python/core/auto_generated/layout/qgslayoutitemmap.sip.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,9 @@ in the area of the map item covered by the item.
571571

572572
QgsMapRendererJob::Errors renderingErrors() const;
573573
%Docstring
574-
renderingErrors
575-
@return list of layer id / error message
574+
Returns map rendering errors
575+
576+
:return: list of errors
576577
%End
577578

578579
protected:

‎src/core/layout/qgslayoutitemmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ class CORE_EXPORT QgsLayoutItemMap : public QgsLayoutItem
512512
bool isLabelBlockingItem( QgsLayoutItem *item ) const;
513513

514514
/**
515-
* @brief renderingErrors
516-
* @return list of layer id / error message
515+
* \brief Returns map rendering errors
516+
* \returns list of errors
517517
*/
518518
QgsMapRendererJob::Errors renderingErrors() const { return mRenderingErrors; }
519519

‎src/core/qgsmaprendererjob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct LayerRenderJob
5555
bool cached; // if true, img already contains cached image from previous rendering
5656
QgsWeakMapLayerPointer layer;
5757
int renderingTime; //!< Time it took to render the layer in ms (it is -1 if not rendered or still rendering)
58-
QStringList errors; //! rendering errors
58+
QStringList errors; //!< Rendering errors
5959
};
6060

6161
typedef QList<LayerRenderJob> LayerRenderJobs;

‎src/server/qgsconfigcache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ const QgsProject *QgsConfigCache::project( const QString &path )
4646
prj->setBadLayerHandler( badLayerHandler );
4747
if ( prj->read( path ) )
4848
{
49-
if ( badLayerHandler->badLayers().size() > 0 )
49+
if ( !badLayerHandler->badLayers().isEmpty() )
5050
{
51-
QString errorMsg = QString( "Layer(s) %1 not valid" ).arg( badLayerHandler->badLayers().join( ',' ) );
51+
QString errorMsg = QStringLiteral( "Layer(s) %1 not valid" ).arg( badLayerHandler->badLayers().join( ',' ) );
5252
QgsMessageLog::logMessage( errorMsg, QStringLiteral( "Server" ), Qgis::Critical );
5353
throw QgsServerException( QStringLiteral( "Layer(s) not valid" ) );
5454
}

‎src/server/qgsstorebadlayerinfo.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
#include "qgsstorebadlayerinfo.h"
2-
#include <QDomElement>
1+
/***************************************************************************
2+
qgsstorebadlayerinfo.cpp
3+
------------------------
4+
begin : Jan 2019
5+
copyright : (C) 2019 by Marco Hugentobler
6+
email : marco dot hugentobler at sourcepole dot ch
7+
***************************************************************************/
38

4-
QgsStoreBadLayerInfo::QgsStoreBadLayerInfo(): QgsProjectBadLayerHandler()
5-
{
6-
}
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
717

8-
QgsStoreBadLayerInfo::~QgsStoreBadLayerInfo()
9-
{
10-
}
18+
#include "qgsstorebadlayerinfo.h"
19+
#include <QDomElement>
1120

1221
void QgsStoreBadLayerInfo::handleBadLayers( const QList<QDomNode> &layers )
1322
{

‎src/server/qgsstorebadlayerinfo.h

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/***************************************************************************
2+
qgsstorebadlayerinfo.h
3+
----------------------
4+
begin : Jan 2019
5+
copyright : (C) 2019 by Marco Hugentobler
6+
email : marco dot hugentobler at sourcepole dot ch
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
118
#ifndef QGSSTOREBADLAYERINFO_H
219
#define QGSSTOREBADLAYERINFO_H
320

@@ -13,21 +30,17 @@ class QgsStoreBadLayerInfo: public QgsProjectBadLayerHandler
1330
public:
1431
/*Default constructor
1532
*/
16-
QgsStoreBadLayerInfo();
17-
18-
/*Destructor
19-
*/
20-
~QgsStoreBadLayerInfo();
33+
QgsStoreBadLayerInfo() = default;
2134

2235
/**
23-
* @brief handleBadLayers
24-
* @param layers layer nodes
36+
* \brief handleBadLayers
37+
* \param layers layer nodes
2538
*/
2639
void handleBadLayers( const QList<QDomNode> &layers );
2740

2841
/**
29-
* @brief badLayers
30-
* @return ids of bad layers
42+
* \brief badLayers
43+
* \returns ids of bad layers
3144
*/
3245
QStringList badLayers() const { return mBadLayerIds; }
3346

‎src/server/services/wms/qgsmaprendererjobproxy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ namespace QgsWms
6363
QPainter *takePainter();
6464

6565
/**
66-
* @brief Returns reported errors
67-
* @return error list
66+
* \brief Returns map rendering errors
67+
* \returns error list
6868
*/
6969
QgsMapRendererJob::Errors errors() const { return mErrors; }
7070

‎src/server/services/wms/qgswmsrenderer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,9 +2938,9 @@ namespace QgsWms
29382938
}
29392939

29402940
//Log first error
2941-
QString errorMsg = QString( "Map rendering error in layer '%1'" ).arg( firstErrorLayerId );
2942-
QgsMessageLog::logMessage( errorMsg, "Server", Qgis::Critical );
2943-
throw QgsServerException( QString( "Map rendering error in layer '%1'" ).arg( layerWMSName ) );
2941+
QString errorMsg = QStringLiteral( "Map rendering error in layer '%1'" ).arg( firstErrorLayerId );
2942+
QgsMessageLog::logMessage( errorMsg, QStringLiteral( "Server" ), Qgis::Critical );
2943+
throw QgsServerException( QStringLiteral( "Map rendering error in layer '%1'" ).arg( layerWMSName ) );
29442944
}
29452945
}
29462946

@@ -3265,7 +3265,7 @@ namespace QgsWms
32653265
return tmpImage->dotsPerMeterX() / 1000.0;
32663266
}
32673267

3268-
void QgsRenderer::handlePrintErrors( const QgsLayout *layout )
3268+
void QgsRenderer::handlePrintErrors( const QgsLayout *layout ) const
32693269
{
32703270
if ( !layout )
32713271
{

‎src/server/services/wms/qgswmsrenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ namespace QgsWms
285285

286286
void removeTemporaryLayers();
287287

288-
void handlePrintErrors( const QgsLayout *layout );
288+
void handlePrintErrors( const QgsLayout *layout ) const;
289289

290290
private:
291291

0 commit comments

Comments
 (0)
Please sign in to comment.