Skip to content
Permalink
Browse files

Fixing problem with very long data fields corrupting preview table (Q…

…t framework not handling very long strings?)
  • Loading branch information
ccrook committed Apr 26, 2013
1 parent eb220fd commit 6ba9f4d2ecda6f4c5222f85676695f014ec133be
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
@@ -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() ),
@@ -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() )

0 comments on commit 6ba9f4d

Please sign in to comment.
You can’t perform that action at this time.