@@ -58,11 +58,11 @@ QgsDelimitedTextPluginGui::QgsDelimitedTextPluginGui( QgisInterface * _qI, QWidg
58
58
}
59
59
60
60
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 ( " ," ) );
66
66
67
67
cmbXField->setDisabled ( true );
68
68
cmbYField->setDisabled ( true );
@@ -107,33 +107,33 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
107
107
else if ( delimiterRegexp->isChecked () )
108
108
delimiterType = " regexp" ;
109
109
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 );
113
113
114
114
if ( geomTypeXY->isChecked () )
115
115
{
116
116
if ( !cmbXField->currentText ().isEmpty () && !cmbYField->currentText ().isEmpty () )
117
117
{
118
- url.addQueryItem (" xField" ,cmbXField->currentText ());
119
- url.addQueryItem (" yField" ,cmbYField->currentText ());
118
+ url.addQueryItem ( " xField" , cmbXField->currentText () );
119
+ url.addQueryItem ( " yField" , cmbYField->currentText () );
120
120
}
121
121
}
122
122
else
123
123
{
124
124
if ( ! cmbWktField->currentText ().isEmpty () )
125
125
{
126
- url.addQueryItem (" wktField" ,cmbWktField->currentText ());
126
+ url.addQueryItem ( " wktField" , cmbWktField->currentText () );
127
127
}
128
128
}
129
129
130
130
int skipLines = rowCounter->value ();
131
131
if ( skipLines > 0 )
132
- url.addQueryItem (" skipLines" ,QString ( " %1" ).arg ( skipLines ));
132
+ url.addQueryItem ( " skipLines" , QString ( " %1" ).arg ( skipLines ) );
133
133
134
134
// add the layer to the map
135
135
136
- QString uri (url.toEncoded ());
136
+ QString uri ( url.toEncoded () );
137
137
emit drawVectorLayer ( uri, txtLayerName->text (), " delimitedtext" );
138
138
// store the settings
139
139
@@ -149,7 +149,7 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
149
149
settings.setValue ( key + " /delimiterType" , " plain" );
150
150
else
151
151
settings.setValue ( key + " /delimiterType" , " regexp" );
152
- settings.setValue ( key + " /delimiterChars" , selectedChars ());
152
+ settings.setValue ( key + " /delimiterChars" , selectedChars () );
153
153
154
154
accept ();
155
155
}
@@ -166,13 +166,13 @@ void QgsDelimitedTextPluginGui::on_buttonBox_rejected()
166
166
167
167
QString QgsDelimitedTextPluginGui::selectedChars ()
168
168
{
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;
176
176
}
177
177
178
178
QStringList QgsDelimitedTextPluginGui::splitLine ( QString line )
0 commit comments