Skip to content
Permalink
Browse files

fix #2029

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11833 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Oct 24, 2009
1 parent e704040 commit 0ae204384ba0ed874b504b89666b2d93f5cd93f3
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/app/qgsattributetypedialog.cpp
@@ -27,6 +27,7 @@
#include <QFile>
#include <QMessageBox>
#include <QFileDialog>
#include <QTextStream>

#include <climits>
#include <cfloat>
@@ -120,21 +121,25 @@ void QgsAttributeTypeDialog::loadFromCSVButtonPushed()
{
QMessageBox::information( NULL,
tr( "Error" ),
tr( "Could not open file %1\nError was:%2" ).arg( fileName ).arg( f.errorString() ), QMessageBox::Cancel );
tr( "Could not open file %1\nError was:%2" ).arg( fileName ).arg( f.errorString() ),
QMessageBox::Cancel );
return;
}

QTextStream s(&f);
s.setAutoDetectUnicode(true);

QRegExp re0( "^([^;]*);(.*)$" );
re0.setMinimal( true );
QRegExp re1( "^([^,]*),(.*)$" );
re1.setMinimal( true );
QMap<QString, QVariant> map;

f.readLine();
s.readLine();

while ( !f.atEnd() )
while ( !s.atEnd() )
{
QString l = f.readLine().trimmed();
QString l = s.readLine().trimmed();

QString key, val;
if ( re0.indexIn( l ) >= 0 && re0.numCaptures() == 2 )

0 comments on commit 0ae2043

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