Skip to content

Commit

Permalink
Fixing problem with very long data fields corrupting preview table (Q…
Browse files Browse the repository at this point in the history
…t framework not handling very long strings?)
  • Loading branch information
ccrook committed Apr 26, 2013
1 parent eb220fd commit 6ba9f4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
Expand Up @@ -30,6 +30,8 @@
#include <QTextCodec>
#include <QUrl>

const int MAX_SAMPLE_LENGTH=200;

QgsDelimitedTextSourceSelect::QgsDelimitedTextSourceSelect( QWidget * parent, Qt::WFlags fl, bool embedded ):
QDialog( parent, fl ),
mFile( new QgsDelimitedTextFile() ),
Expand Down Expand Up @@ -425,6 +427,7 @@ void QgsDelimitedTextSourceSelect::updateFieldLists()
for ( int i = 0; i < tblSample->columnCount(); i++ )
{
QString value = i < nv ? values[i] : "";
if( value.length() > MAX_SAMPLE_LENGTH ) value = value.mid(0,MAX_SAMPLE_LENGTH)+"...";
QTableWidgetItem *item = new QTableWidgetItem( value );
tblSample->setItem( counter - 1, i, item );
if ( ! value.isEmpty() )
Expand Down

0 comments on commit 6ba9f4d

Please sign in to comment.