File tree 2 files changed +14
-6
lines changed
src/providers/delimitedtext
2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -500,8 +500,16 @@ QgsDelimitedTextFeatureSource::QgsDelimitedTextFeatureSource( const QgsDelimited
500
500
, mXyDms( p->mXyDms )
501
501
, attributeColumns( p->attributeColumns )
502
502
{
503
+ QUrl url = p->mFile ->url ();
504
+
505
+ // make sure watcher not created when using iterator (e.g. for rendering, see issue #15558)
506
+ if ( url.hasQueryItem ( " watchFile" ) )
507
+ {
508
+ url.removeQueryItem ( " watchFile" );
509
+ }
510
+
503
511
mFile = new QgsDelimitedTextFile ();
504
- mFile ->setFromUrl ( p-> mFile -> url () );
512
+ mFile ->setFromUrl ( url );
505
513
506
514
mExpressionContext << QgsExpressionContextUtils::globalScope ()
507
515
<< QgsExpressionContextUtils::projectScope ();
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ QgsDelimitedTextFile::QgsDelimitedTextFile( const QString& url )
35
35
, mEncoding( " UTF-8" )
36
36
, mFile( nullptr )
37
37
, mStream( nullptr )
38
- , mUseWatcher( true )
38
+ , mUseWatcher( false )
39
39
, mWatcher( nullptr )
40
40
, mDefinitionValid( false )
41
41
, mUseHeader( true )
@@ -158,9 +158,9 @@ bool QgsDelimitedTextFile::setFromUrl( const QUrl &url )
158
158
}
159
159
160
160
//
161
- if ( url.hasQueryItem ( " useWatcher " ) )
161
+ if ( url.hasQueryItem ( " watchFile " ) )
162
162
{
163
- mUseWatcher = ! url.queryItemValue ( " useWatcher " ).toUpper ().startsWith ( ' N ' );
163
+ mUseWatcher = url.queryItemValue ( " watchFile " ).toUpper ().startsWith ( ' Y ' );
164
164
}
165
165
166
166
// The default type is csv, to be consistent with the
@@ -269,9 +269,9 @@ QUrl QgsDelimitedTextFile::url()
269
269
url.addQueryItem ( " encoding" , mEncoding );
270
270
}
271
271
272
- if ( ! mUseWatcher )
272
+ if ( mUseWatcher )
273
273
{
274
- url.addQueryItem ( " useWatcher " , " no " );
274
+ url.addQueryItem ( " watchFile " , " yes " );
275
275
}
276
276
277
277
url.addQueryItem ( " type" , type () );
You can’t perform that action at this time.
0 commit comments