Skip to content

Commit

Permalink
fix #3490
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15177 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 16, 2011
1 parent 788d61b commit 2464884
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
42 changes: 21 additions & 21 deletions src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
Expand Up @@ -58,11 +58,11 @@ QgsDelimitedTextPluginGui::QgsDelimitedTextPluginGui( QgisInterface * _qI, QWidg
}

QString delimiterChars = settings.value( key + "/delimiterChars", " " ).toString();
cbxDelimSpace->setChecked( delimiterChars.contains(" "));
cbxDelimTab->setChecked( delimiterChars.contains("\\t"));
cbxDelimColon->setChecked( delimiterChars.contains(":"));
cbxDelimSemicolon->setChecked( delimiterChars.contains(":"));
cbxDelimComma->setChecked( delimiterChars.contains(","));
cbxDelimSpace->setChecked( delimiterChars.contains( " " ) );
cbxDelimTab->setChecked( delimiterChars.contains( "\\t" ) );
cbxDelimColon->setChecked( delimiterChars.contains( ":" ) );
cbxDelimSemicolon->setChecked( delimiterChars.contains( ":" ) );
cbxDelimComma->setChecked( delimiterChars.contains( "," ) );

cmbXField->setDisabled( true );
cmbYField->setDisabled( true );
Expand Down Expand Up @@ -107,33 +107,33 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
else if ( delimiterRegexp->isChecked() )
delimiterType = "regexp";

QUrl url(txtFilePath->text());
url.addQueryItem("delimiter",txtDelimiter->text());
url.addQueryItem("delimiterType",delimiterType);
QUrl url = QUrl::fromLocalFile( txtFilePath->text() );
url.addQueryItem( "delimiter", txtDelimiter->text() );
url.addQueryItem( "delimiterType", delimiterType );

if ( geomTypeXY->isChecked() )
{
if ( !cmbXField->currentText().isEmpty() && !cmbYField->currentText().isEmpty() )
{
url.addQueryItem("xField",cmbXField->currentText());
url.addQueryItem("yField",cmbYField->currentText());
url.addQueryItem( "xField", cmbXField->currentText() );
url.addQueryItem( "yField", cmbYField->currentText() );
}
}
else
{
if ( ! cmbWktField->currentText().isEmpty() )
{
url.addQueryItem("wktField",cmbWktField->currentText());
url.addQueryItem( "wktField", cmbWktField->currentText() );
}
}

int skipLines = rowCounter->value();
if ( skipLines > 0 )
url.addQueryItem("skipLines",QString( "%1" ).arg( skipLines ));
url.addQueryItem( "skipLines", QString( "%1" ).arg( skipLines ) );

// add the layer to the map

QString uri(url.toEncoded());
QString uri( url.toEncoded() );
emit drawVectorLayer( uri, txtLayerName->text(), "delimitedtext" );
// store the settings

Expand All @@ -149,7 +149,7 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
settings.setValue( key + "/delimiterType", "plain" );
else
settings.setValue( key + "/delimiterType", "regexp" );
settings.setValue( key + "/delimiterChars", selectedChars());
settings.setValue( key + "/delimiterChars", selectedChars() );

accept();
}
Expand All @@ -166,13 +166,13 @@ void QgsDelimitedTextPluginGui::on_buttonBox_rejected()

QString QgsDelimitedTextPluginGui::selectedChars()
{
QString chars = "";
if ( cbxDelimSpace->isChecked() ) chars += " ";
if ( cbxDelimTab->isChecked() ) chars += "\\t";
if ( cbxDelimSemicolon->isChecked() ) chars += ";";
if ( cbxDelimComma->isChecked() ) chars += ",";
if ( cbxDelimColon->isChecked() ) chars += ":";
return chars;
QString chars = "";
if ( cbxDelimSpace->isChecked() ) chars += " ";
if ( cbxDelimTab->isChecked() ) chars += "\\t";
if ( cbxDelimSemicolon->isChecked() ) chars += ";";
if ( cbxDelimComma->isChecked() ) chars += ",";
if ( cbxDelimColon->isChecked() ) chars += ":";
return chars;
}

QStringList QgsDelimitedTextPluginGui::splitLine( QString line )
Expand Down
2 changes: 1 addition & 1 deletion src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
Expand Up @@ -154,7 +154,7 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )

// Extract the provider definition from the url

mFileName = url.path();
mFileName = url.toLocalFile();

QString wktField( "" );
QString xField( "" );
Expand Down

0 comments on commit 2464884

Please sign in to comment.