Skip to content

Commit

Permalink
import vector layer: don't clear the error message if too many errors…
Browse files Browse the repository at this point in the history
… occur
  • Loading branch information
brushtyler committed Apr 16, 2012
1 parent 51ff2b5 commit c5c4c7e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/core/qgsvectorlayerimport.cpp
Expand Up @@ -268,6 +268,15 @@ QgsVectorLayerImport::importLayer( QgsVectorLayer* layer,
// write all features
while ( layer->nextFeature( fet ) )
{
if ( writer->errorCount() > 1000 )
{
if ( errorMessage )
{
*errorMessage += "\n" + QObject::tr( "Stopping after %1 errors" ).arg( writer->errorCount() );
}
break;
}

if ( onlySelected && !ids.contains( fet.id() ) )
continue;

Expand Down Expand Up @@ -304,17 +313,6 @@ QgsVectorLayerImport::importLayer( QgsVectorLayer* layer,
{
*errorMessage += "\n" + writer->errorMessage();
}

if ( writer->errorCount() > 1000 )
{
if ( errorMessage )
{
*errorMessage += "\n" + QObject::tr( "Stopping after %1 errors" ).arg( writer->errorCount() );
}

n = -1;
break;
}
}
n++;
}
Expand All @@ -338,7 +336,7 @@ QgsVectorLayerImport::importLayer( QgsVectorLayer* layer,

if ( errorMessage )
{
if ( n > 0 && errors > 0 )
if ( errors > 0 )
{
*errorMessage += "\n" + QObject::tr( "Only %1 of %2 features written." ).arg( n - errors ).arg( n );
}
Expand Down

0 comments on commit c5c4c7e

Please sign in to comment.