Skip to content

Commit

Permalink
Do not show standard message bar error with geometry validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent 2abb13f commit 91cd1ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -6965,11 +6965,18 @@ void QgisApp::labelingFontNotFound( QgsVectorLayer *vlayer, const QString &fontf

void QgisApp::commitError( QgsVectorLayer *vlayer )
{
const QStringList commitErrors = vlayer->commitErrors();
if ( !vlayer->allowCommit() && commitErrors.empty() )
{
QgsMessageLog::logMessage( tr( "Could not save changes. Geometry validation failed." ) );
return;
}

QgsMessageViewer *mv = new QgsMessageViewer();
mv->setWindowTitle( tr( "Commit Errors" ) );
mv->setMessageAsPlainText( tr( "Could not commit changes to layer %1" ).arg( vlayer->name() )
+ "\n\n"
+ tr( "Errors: %1\n" ).arg( vlayer->commitErrors().join( QStringLiteral( "\n " ) ) )
+ tr( "Errors: %1\n" ).arg( commitErrors.join( QStringLiteral( "\n " ) ) )
);

QToolButton *showMore = new QToolButton();
Expand Down

0 comments on commit 91cd1ed

Please sign in to comment.