Skip to content
Permalink
Browse files

fix #3573 and apply #3570

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15420 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 10, 2011
1 parent 86895ff commit 635bc69a8e5fb93e54df457a0c25bb79bcb7c918
@@ -28,6 +28,7 @@
#include <QDomElement>
#include <QPushButton>
#include <QMessageBox>
#include <QUrl>

QgsHandleBadLayersHandler::QgsHandleBadLayersHandler()
{
@@ -49,7 +50,6 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList<QDomNode> &layers, const QDo
{
setupUi( this );


mVectorFileFilter = QgsProviderRegistry::instance()->fileVectorFilters();
QgsRasterLayer::buildSupportedRasterFileFilter( mRasterFileFilter );

@@ -102,8 +102,7 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList<QDomNode> &layers, const QDo
}
else if ( provider == "delimitedtext" )
{
QStringList theURIParts = datasource.split( "?" );
filename = theURIParts[0];
filename = QUrl::fromEncoded( datasource.toAscii() ).toLocalFile();
}
else if ( provider == "postgres" || provider == "sqlanywhere" )
{
@@ -296,9 +295,10 @@ void QgsHandleBadLayers::apply()
}
else if ( provider == "delimitedtext" )
{
QStringList theURIParts = datasource.split( "?" );
theURIParts[0] = filename;
datasource = theURIParts.join( "?" );
QUrl uriSource = QUrl::fromEncoded( datasource.toAscii() );
QUrl uriDest = QUrl::fromLocalFile( filename );
uriDest.setQueryItems( uriSource.queryItems() );
datasource = QString::fromAscii( uriDest.toEncoded() );
}
}
else
@@ -27,6 +27,7 @@
#include <QDomElement>
#include <QDomImplementation>
#include <QTextStream>
#include <QUrl>

#include <sqlite3.h>

@@ -177,9 +178,10 @@ bool QgsMapLayer::readXML( QDomNode & layer_node )
}
else if ( provider == "delimitedtext" )
{
QStringList theURIParts = mDataSource.split( "?" );
theURIParts[0] = QgsProject::instance()->readPath( theURIParts[0] );
mDataSource = theURIParts.join( "?" );
QUrl urlSource = QUrl::fromEncoded( mDataSource.toAscii() );
QUrl urlDest = QUrl::fromLocalFile( QgsProject::instance()->readPath( urlSource.toLocalFile() ) );
urlDest.setQueryItems( urlSource.queryItems() );
mDataSource = QString::fromAscii( urlDest.toEncoded() );
}
else
{
@@ -860,8 +860,9 @@ bool QgsProject::read()
QPair< bool, QList<QDomNode> > getMapLayersResults = _getMapLayers( *doc );

// review the integrity of the retrieved map layers
bool clean = getMapLayersResults.first;

if ( ! getMapLayersResults.first )
if ( !clean )
{
QgsDebugMsg( "Unable to get map layers from project file." );

@@ -878,8 +879,9 @@ bool QgsProject::read()
// read the project: used by map canvas and legend
emit readProject( *doc );

// can't be dirty since we're allegedly in pristine state
dirty( false );
// if all went well, we're allegedly in pristine state
if ( clean )
dirty( false );

return true;

@@ -132,11 +132,9 @@ void QgsDelimitedTextPluginGui::on_buttonBox_accepted()
url.addQueryItem( "skipLines", QString( "%1" ).arg( skipLines ) );

// add the layer to the map
emit drawVectorLayer( QString::fromAscii( url.toEncoded() ), txtLayerName->text(), "delimitedtext" );

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

QSettings settings;
QString key = "/Plugin-DelimitedText";
settings.setValue( key + "/delimiter", txtDelimiter->text() );
@@ -150,7 +150,7 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
, mWkbType( QGis::WKBNoGeometry )
{

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

// Extract the provider definition from the url

0 comments on commit 635bc69

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