Skip to content

Commit

Permalink
remove unuseful message managed by pushMessage from provider
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Sep 26, 2017
1 parent 1e2a213 commit 8a4d32f
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 23 deletions.
5 changes: 0 additions & 5 deletions src/app/qgisapp.cpp
Expand Up @@ -7179,11 +7179,6 @@ void QgisApp::mergeSelectedFeatures()
// addFeature can fail if newFeature has no compatibile geometry
if ( !vl->addFeature( newFeature, false ) )
{
messageBar()->pushMessage(
tr( "Merge features" ),
tr( "Invalid edit operation see the log for more info" ),
QgsMessageBar::WARNING );

vl->destroyEditCommand();
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsfieldcalculator.cpp
Expand Up @@ -298,7 +298,7 @@ void QgsFieldCalculator::accept()
if ( !mVectorLayer->changeGeometry( feature.id(), &geom ) )
{
calculationSuccess = false;
error = tr( "Invalid edit operation see the log for more info" );
error = tr( "Can not change geometry for feature: %1", "Field calculator" ).arg( feature.id() );
break;
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/app/qgsmaptooldeletepart.cpp
Expand Up @@ -106,11 +106,9 @@ void QgsMapToolDeletePart::canvasReleaseEvent( QgsMapMouseEvent* e )
{
vlayer->beginEditCommand( tr( "Part of multipart feature deleted" ) );
if ( !vlayer->changeGeometry( f.id(), g ) )
{
emit messageEmitted( tr( "Invalid edit operation see the log for more info" ) );
vlayer->destroyEditCommand();
}
vlayer->endEditCommand();
else
vlayer->endEditCommand();
vlayer->triggerRepaint();
}
else
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsmaptooldeletering.cpp
Expand Up @@ -115,7 +115,6 @@ void QgsMapToolDeleteRing::canvasReleaseEvent( QgsMapMouseEvent* e )
vlayer->beginEditCommand( tr( "Ring deleted" ) );
if ( !vlayer->changeGeometry( mPressedFid, g ) )
{
emit messageEmitted( tr( "Invalid edit operation see the log for more info" ) );
vlayer->destroyEditCommand();
return;
}
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -183,7 +183,6 @@ void QgsMapToolOffsetCurve::applyOffset()
}
else
{
emit messageEmitted( tr( "Invalid edit operation see the log for more info" ) );
layer->destroyEditCommand();
}

Expand Down
1 change: 0 additions & 1 deletion src/app/qgsmaptoolreshape.cpp
Expand Up @@ -136,7 +136,6 @@ void QgsMapToolReshape::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
}
else
{
emit messageEmitted( tr( "Invalid edit operation see the log for more info" ) );
vlayer->destroyEditCommand();
}

Expand Down
1 change: 0 additions & 1 deletion src/app/qgsmaptoolsimplify.cpp
Expand Up @@ -183,7 +183,6 @@ void QgsMapToolSimplify::storeSimplified()
{
if ( !vlayer->changeGeometry( feat.id(), g ) )
{
emit messageEmitted( tr( "Invalid edit operation see the log for more info" ) );
success = false;
}
delete g;
Expand Down
5 changes: 1 addition & 4 deletions src/core/qgsofflineediting.cpp
Expand Up @@ -320,7 +320,7 @@ void QgsOfflineEditing::synchronize()
else
{
remoteLayer->rollBack();
showWarning( tr( "Syncronization failed. see log for more details" ) );
showWarning( tr( "Syncronization failed" ) );
}
}
else
Expand Down Expand Up @@ -703,10 +703,7 @@ QgsVectorLayer* QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlit
}

if ( !newLayer->addFeature( f, false ) )
{
showWarning( tr( "Invalid edit operation see the log for more info" ) );
return nullptr;
}

emit progressUpdated( featureCount++ );
}
Expand Down
4 changes: 0 additions & 4 deletions src/core/qgsvectorlayereditbuffer.cpp
Expand Up @@ -200,10 +200,7 @@ bool QgsVectorLayerEditBuffer::adaptGeometry( QgsGeometry* geometry )
{
QgsGeometry* newGeom = provider->convertToProviderType( geometry );
if ( !newGeom )
{
QgsMessageLog::logMessage( tr( "Geometry type is not compatible with the layer.", "not compatible geometry" ), "adaptGeometry", QgsMessageLog::CRITICAL );
return false;
}
geometry = newGeom;
}
}
Expand All @@ -228,7 +225,6 @@ bool QgsVectorLayerEditBuffer::changeGeometry( QgsFeatureId fid, QgsGeometry* ge
// if not then try to convert to a compatible geometry type
if ( !adaptGeometry( geom ) )
{
QgsMessageLog::logMessage( tr( "Feature %1 not updated", "not updated feature" ).arg( fid ), "changeGeometry", QgsMessageLog::CRITICAL );
return false;
}

Expand Down
Expand Up @@ -250,7 +250,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
}
if ( !newlayer->dataProvider()->addFeatures( features ) )
{
QMessageBox::critical( this, tr( "Populate output Layer" ), tr( "See message log. Can not add features to output layer: %1." ).arg( filename ) );
QMessageBox::critical( this, tr( "Populate output Layer" ), tr( "Can not add features to output layer: %1." ).arg( filename ) );
return;
}

Expand Down

0 comments on commit 8a4d32f

Please sign in to comment.