delim_text_fix.diff

Chris Crook, 2011-03-08 11:44 AM

Download (3.1 KB)

View differences:

src/app/qgshandlebadlayers.cpp (working copy)
26 26

  
27 27
#include <QDomDocument>
28 28
#include <QDomElement>
29
#include <QUrl>
29 30
#include <QPushButton>
30 31
#include <QMessageBox>
31 32

  
......
102 103
      }
103 104
      else if ( provider == "delimitedtext" )
104 105
      {
105
        QStringList theURIParts = datasource.split( "?" );
106
        filename = theURIParts[0];
106
        filename = QUrl::fromEncoded(datasource.toAscii()).toLocalFile();
107 107
      }
108 108
      else if ( provider == "postgres" || provider == "sqlanywhere" )
109 109
      {
......
296 296
      }
297 297
      else if ( provider == "delimitedtext" )
298 298
      {
299
        QStringList theURIParts = datasource.split( "?" );
300
        theURIParts[0] = filename;
301
        datasource = theURIParts.join( "?" );
299
        QUrl uriSource = QUrl::fromEncoded(datasource.toAscii());
300
        QUrl uriNew = QUrl::fromLocalFile(filename);
301
        uriNew.setQueryItems(uriSource.queryItems());
302
        datasource = QString::fromAscii(uriNew.toEncoded());
302 303
      }
303 304
    }
304 305
    else
src/core/qgsmaplayer.cpp (working copy)
24 24
#include <QDir>
25 25
#include <QFile>
26 26
#include <QFileInfo>
27
#include <QUrl>
27 28
#include <QDomDocument>
28 29
#include <QDomElement>
29 30
#include <QDomImplementation>
......
179 180
  }
180 181
  else if ( provider == "delimitedtext" )
181 182
  {
182
    QStringList theURIParts = mDataSource.split( "?" );
183
    theURIParts[0] = QgsProject::instance()->readPath( theURIParts[0] );
184
    mDataSource = theURIParts.join( "?" );
183
    QUrl url = QUrl::fromEncoded(mDataSource.toAscii());
184
    QString file = url.toLocalFile();
185
    file = QgsProject::instance()->readPath(file);
186
    QUrl urlNew = QUrl::fromLocalFile(file);
187
    urlNew.setQueryItems( url.queryItems());
188
    mDataSource = QString::fromAscii( urlNew.toEncoded());
185 189
  }
186 190
  else
187 191
  {
src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp (working copy)
133 133

  
134 134
    // add the layer to the map
135 135

  
136
    QString uri( url.toEncoded() );
136
    QString uri = QString::fromAscii( url.toEncoded() );
137 137
    emit drawVectorLayer( uri, txtLayerName->text(), "delimitedtext" );
138 138
    // store the settings
139 139

  
src/providers/delimitedtext/qgsdelimitedtextprovider.cpp (working copy)
150 150
    , mWkbType( QGis::WKBNoGeometry )
151 151
{
152 152

  
153
  QUrl url = QUrl::fromEncoded( uri.toUtf8() );
153
  QUrl url = QUrl::fromEncoded( uri.toAscii() );
154 154

  
155 155
  // Extract the provider definition from the url
156 156