Skip to content

Commit

Permalink
Don't show errors in a dialog for QgsDelimitedTextProvider
Browse files Browse the repository at this point in the history
This causes issues with scripted use of the provider. Instead, just
log messages to the standard message log.
  • Loading branch information
nyalldawson committed Jun 24, 2015
1 parent 0016ab6 commit 19767cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <QDataStream>
#include <QTextStream>
#include <QStringList>
#include <QMessageBox>
#include <QSettings>
#include <QRegExp>
#include <QUrl>
Expand Down Expand Up @@ -758,7 +757,7 @@ void QgsDelimitedTextProvider::rescanFile()
}
if ( messages.size() > 0 )
{
reportErrors( messages, false );
reportErrors( messages );
QgsDebugMsg( "Delimited text source invalid on rescan - missing geometry fields" );
mValid = false;
return;
Expand Down Expand Up @@ -1098,7 +1097,7 @@ void QgsDelimitedTextProvider::onFileUpdated()
{
QStringList messages;
messages.append( tr( "The file has been updated by another application - reloading" ) );
reportErrors( messages, false );
reportErrors( messages );
mRescanRequired = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/delimitedtext/qgsdelimitedtextprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class QgsDelimitedTextProvider : public QgsVectorDataProvider
void resetIndexes();
void clearInvalidLines();
void recordInvalidLine( QString message );
void reportErrors( QStringList messages = QStringList(), bool showDialog = true );
void reportErrors( QStringList messages = QStringList(), bool showDialog = false );
static bool recordIsEmpty( QStringList &record );
void setUriParameter( QString parameter, QString value );

Expand Down

0 comments on commit 19767cb

Please sign in to comment.