File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2232,6 +2232,11 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
2232
2232
// deal with unnecessary schema qualification to make v.in.ogr happy
2233
2233
mDataSource = mDataProvider ->dataSourceUri ();
2234
2234
}
2235
+ else if ( mProviderKey == " osm" )
2236
+ {
2237
+ // make sure that the "observer" has been removed from URI to avoid crashes
2238
+ mDataSource = mDataProvider ->dataSourceUri ();
2239
+ }
2235
2240
2236
2241
// label
2237
2242
mLabel = new QgsLabel ( mDataProvider ->fields () );
Original file line number Diff line number Diff line change @@ -93,9 +93,25 @@ QgsOSMDataProvider::QgsOSMDataProvider( QString uri )
93
93
}
94
94
if ( propName == " observer" )
95
95
{
96
+ // remove observer from the URI
97
+ // (because otherwise it would be saved into project file and would cause crashes)
98
+ QString newProps;
99
+ foreach ( QString p , props )
100
+ {
101
+ if (!p.startsWith (" observer" ))
102
+ {
103
+ if (!newProps.isEmpty ())
104
+ newProps += " &" ;
105
+ newProps += p;
106
+ }
107
+ }
108
+ QString newUri = uri.left ( fileNameEnd + 1 ) + newProps;
109
+ setDataSourceUri (newUri);
110
+
96
111
ulong observerAddr = propValue.toULong ();
97
112
mInitObserver = ( QObject* ) observerAddr;
98
113
mInitObserver ->setProperty ( " osm_state" , QVariant ( 1 ) );
114
+
99
115
}
100
116
if ( propName == " tag" )
101
117
{
You can’t perform that action at this time.
0 commit comments