Skip to content

Commit ed27442

Browse files
committed
Disable message bar feedback from geometryvalidator
1 parent 91cd1ed commit ed27442

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

src/gui/qgsmaptoolcapture.cpp

+1-18
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@ void QgsMapToolCapture::deactivate()
8181
QgsMapToolAdvancedDigitizing::deactivate();
8282
}
8383

84-
void QgsMapToolCapture::validationFinished()
85-
{
86-
emit messageDiscarded();
87-
QString msgFinished = tr( "Validation finished" );
88-
if ( !mValidationWarnings.isEmpty() )
89-
{
90-
emit messageEmitted( mValidationWarnings.join( QStringLiteral( "\n" ) ).append( "\n" ).append( msgFinished ), Qgis::Warning );
91-
}
92-
}
93-
9484
void QgsMapToolCapture::currentLayerChanged( QgsMapLayer *layer )
9585
{
9686
if ( !mCaptureModeFromLayer )
@@ -688,7 +678,6 @@ void QgsMapToolCapture::validateGeometry()
688678
mValidator = nullptr;
689679
}
690680

691-
mValidationWarnings.clear();
692681
mGeomErrors.clear();
693682
while ( !mGeomErrorMarkers.isEmpty() )
694683
{
@@ -726,20 +715,17 @@ void QgsMapToolCapture::validateGeometry()
726715
method = QgsGeometry::ValidatorGeos;
727716
mValidator = new QgsGeometryValidator( geom, nullptr, method );
728717
connect( mValidator, &QgsGeometryValidator::errorFound, this, &QgsMapToolCapture::addError );
729-
connect( mValidator, &QThread::finished, this, &QgsMapToolCapture::validationFinished );
730718
mValidator->start();
731719
QgsDebugMsgLevel( "Validation started", 4 );
732720
}
733721

734-
void QgsMapToolCapture::addError( QgsGeometry::Error e )
722+
void QgsMapToolCapture::addError( const QgsGeometry::Error &e )
735723
{
736724
mGeomErrors << e;
737725
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
738726
if ( !vlayer )
739727
return;
740728

741-
mValidationWarnings << e.what();
742-
743729
if ( e.hasWhere() )
744730
{
745731
QgsVertexMarker *vm = new QgsVertexMarker( mCanvas );
@@ -751,9 +737,6 @@ void QgsMapToolCapture::addError( QgsGeometry::Error e )
751737
vm->setZValue( vm->zValue() + 1 );
752738
mGeomErrorMarkers << vm;
753739
}
754-
755-
emit messageDiscarded();
756-
emit messageEmitted( mValidationWarnings.join( QStringLiteral( "\n" ) ), Qgis::Warning );
757740
}
758741

759742
int QgsMapToolCapture::size()

src/gui/qgsmaptoolcapture.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
107107
void clean() override;
108108

109109
private slots:
110-
void validationFinished();
111-
void addError( QgsGeometry::Error );
110+
void addError( const QgsGeometry::Error &error );
112111
void currentLayerChanged( QgsMapLayer *layer );
113112

114-
115113
protected:
116114

117115
/**
@@ -264,7 +262,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
264262
QList<QgsPointLocator::Match> mSnappingMatches;
265263

266264
void validateGeometry();
267-
QStringList mValidationWarnings;
268265
QgsGeometryValidator *mValidator = nullptr;
269266
QList< QgsGeometry::Error > mGeomErrors;
270267
QList< QgsVertexMarker * > mGeomErrorMarkers;

0 commit comments

Comments
 (0)