-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Server: throw exception if one or more layers are not available. Proj…
…ects with missing layers are not cached, the layer may become available in future if e.g. the db connection has been temporarly interupted
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "qgsstorebadlayerinfo.h" | ||
#include <QDomElement> | ||
|
||
QgsStoreBadLayerInfo::QgsStoreBadLayerInfo(): QgsProjectBadLayerHandler() | ||
{ | ||
} | ||
|
||
QgsStoreBadLayerInfo::~QgsStoreBadLayerInfo() | ||
{ | ||
} | ||
|
||
void QgsStoreBadLayerInfo::handleBadLayers( const QList<QDomNode> &layers ) | ||
{ | ||
mBadLayerIds.clear(); | ||
QList<QDomNode>::const_iterator it = layers.constBegin(); | ||
for ( ; it != layers.constEnd(); ++it ) | ||
{ | ||
if ( !it->isNull() ) | ||
{ | ||
QDomElement idElem = it->firstChildElement( "id" ); | ||
if ( !idElem.isNull() ) | ||
{ | ||
mBadLayerIds.append( idElem.text() ); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef QGSSTOREBADLAYERINFO_H | ||
#define QGSSTOREBADLAYERINFO_H | ||
|
||
#include "qgsprojectbadlayerhandler.h" | ||
#include <QStringList> | ||
|
||
/** | ||
* \ingroup server | ||
* Stores layer ids of bad layers | ||
*/ | ||
class QgsStoreBadLayerInfo: public QgsProjectBadLayerHandler | ||
{ | ||
public: | ||
QgsStoreBadLayerInfo(); | ||
~QgsStoreBadLayerInfo(); | ||
/** | ||
* @brief handleBadLayers | ||
* @param layers layer nodes | ||
*/ | ||
void handleBadLayers( const QList<QDomNode> &layers ); | ||
|
||
/** | ||
* @brief badLayers | ||
* @return ids of bad layers | ||
*/ | ||
QStringList badLayers() const { return mBadLayerIds; } | ||
|
||
private: | ||
QStringList mBadLayerIds; | ||
}; | ||
|
||
#endif // QGSSTOREBADLAYERINFO_H |