mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
fix crash from #2067. anyway loading of osm layers with custom renderers doesn't work (and won't work because of technical limitations)
git-svn-id: http://svn.osgeo.org/qgis/trunk@12041 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
c1b360bd93
commit
61d45be928
@ -2232,6 +2232,11 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
|
|||||||
// deal with unnecessary schema qualification to make v.in.ogr happy
|
// deal with unnecessary schema qualification to make v.in.ogr happy
|
||||||
mDataSource = mDataProvider->dataSourceUri();
|
mDataSource = mDataProvider->dataSourceUri();
|
||||||
}
|
}
|
||||||
|
else if ( mProviderKey == "osm" )
|
||||||
|
{
|
||||||
|
// make sure that the "observer" has been removed from URI to avoid crashes
|
||||||
|
mDataSource = mDataProvider->dataSourceUri();
|
||||||
|
}
|
||||||
|
|
||||||
// label
|
// label
|
||||||
mLabel = new QgsLabel( mDataProvider->fields() );
|
mLabel = new QgsLabel( mDataProvider->fields() );
|
||||||
|
@ -93,9 +93,25 @@ QgsOSMDataProvider::QgsOSMDataProvider( QString uri )
|
|||||||
}
|
}
|
||||||
if ( propName == "observer" )
|
if ( propName == "observer" )
|
||||||
{
|
{
|
||||||
|
// remove observer from the URI
|
||||||
|
// (because otherwise it would be saved into project file and would cause crashes)
|
||||||
|
QString newProps;
|
||||||
|
foreach ( QString p , props )
|
||||||
|
{
|
||||||
|
if (!p.startsWith("observer"))
|
||||||
|
{
|
||||||
|
if (!newProps.isEmpty())
|
||||||
|
newProps += "&";
|
||||||
|
newProps += p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QString newUri = uri.left( fileNameEnd + 1 ) + newProps;
|
||||||
|
setDataSourceUri(newUri);
|
||||||
|
|
||||||
ulong observerAddr = propValue.toULong();
|
ulong observerAddr = propValue.toULong();
|
||||||
mInitObserver = ( QObject* ) observerAddr;
|
mInitObserver = ( QObject* ) observerAddr;
|
||||||
mInitObserver->setProperty( "osm_state", QVariant( 1 ) );
|
mInitObserver->setProperty( "osm_state", QVariant( 1 ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
if ( propName == "tag" )
|
if ( propName == "tag" )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user