Skip to content

Commit 972f10f

Browse files
author
jef
committed
fix #3490
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15177 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent bd6e6f0 commit 972f10f

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp

+21-21
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ QgsDelimitedTextPluginGui::QgsDelimitedTextPluginGui( QgisInterface * _qI, QWidg
5858
}
5959

6060
QString delimiterChars = settings.value( key + "/delimiterChars", " " ).toString();
61-
cbxDelimSpace->setChecked( delimiterChars.contains(" "));
62-
cbxDelimTab->setChecked( delimiterChars.contains("\\t"));
63-
cbxDelimColon->setChecked( delimiterChars.contains(":"));
64-
cbxDelimSemicolon->setChecked( delimiterChars.contains(":"));
65-
cbxDelimComma->setChecked( delimiterChars.contains(","));
61+
cbxDelimSpace->setChecked( delimiterChars.contains( " " ) );
62+
cbxDelimTab->setChecked( delimiterChars.contains( "\\t" ) );
63+
cbxDelimColon->setChecked( delimiterChars.contains( ":" ) );
64+
cbxDelimSemicolon->setChecked( delimiterChars.contains( ":" ) );
65+
cbxDelimComma->setChecked( delimiterChars.contains( "," ) );
6666

6767
cmbXField->setDisabled( true );
6868
cmbYField->setDisabled( true );
@@ -107,33 +107,33 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
107107
else if ( delimiterRegexp->isChecked() )
108108
delimiterType = "regexp";
109109

110-
QUrl url(txtFilePath->text());
111-
url.addQueryItem("delimiter",txtDelimiter->text());
112-
url.addQueryItem("delimiterType",delimiterType);
110+
QUrl url = QUrl::fromLocalFile( txtFilePath->text() );
111+
url.addQueryItem( "delimiter", txtDelimiter->text() );
112+
url.addQueryItem( "delimiterType", delimiterType );
113113

114114
if ( geomTypeXY->isChecked() )
115115
{
116116
if ( !cmbXField->currentText().isEmpty() && !cmbYField->currentText().isEmpty() )
117117
{
118-
url.addQueryItem("xField",cmbXField->currentText());
119-
url.addQueryItem("yField",cmbYField->currentText());
118+
url.addQueryItem( "xField", cmbXField->currentText() );
119+
url.addQueryItem( "yField", cmbYField->currentText() );
120120
}
121121
}
122122
else
123123
{
124124
if ( ! cmbWktField->currentText().isEmpty() )
125125
{
126-
url.addQueryItem("wktField",cmbWktField->currentText());
126+
url.addQueryItem( "wktField", cmbWktField->currentText() );
127127
}
128128
}
129129

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

134134
// add the layer to the map
135135

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

@@ -149,7 +149,7 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
149149
settings.setValue( key + "/delimiterType", "plain" );
150150
else
151151
settings.setValue( key + "/delimiterType", "regexp" );
152-
settings.setValue( key + "/delimiterChars", selectedChars());
152+
settings.setValue( key + "/delimiterChars", selectedChars() );
153153

154154
accept();
155155
}
@@ -166,13 +166,13 @@ void QgsDelimitedTextPluginGui::on_buttonBox_rejected()
166166

167167
QString QgsDelimitedTextPluginGui::selectedChars()
168168
{
169-
QString chars = "";
170-
if ( cbxDelimSpace->isChecked() ) chars += " ";
171-
if ( cbxDelimTab->isChecked() ) chars += "\\t";
172-
if ( cbxDelimSemicolon->isChecked() ) chars += ";";
173-
if ( cbxDelimComma->isChecked() ) chars += ",";
174-
if ( cbxDelimColon->isChecked() ) chars += ":";
175-
return chars;
169+
QString chars = "";
170+
if ( cbxDelimSpace->isChecked() ) chars += " ";
171+
if ( cbxDelimTab->isChecked() ) chars += "\\t";
172+
if ( cbxDelimSemicolon->isChecked() ) chars += ";";
173+
if ( cbxDelimComma->isChecked() ) chars += ",";
174+
if ( cbxDelimColon->isChecked() ) chars += ":";
175+
return chars;
176176
}
177177

178178
QStringList QgsDelimitedTextPluginGui::splitLine( QString line )

src/providers/delimitedtext/qgsdelimitedtextprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
154154

155155
// Extract the provider definition from the url
156156

157-
mFileName = url.path();
157+
mFileName = url.toLocalFile();
158158

159159
QString wktField( "" );
160160
QString xField( "" );

0 commit comments

Comments
 (0)