File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
src/providers/delimitedtext Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -502,8 +502,16 @@ QgsDelimitedTextFeatureSource::QgsDelimitedTextFeatureSource( const QgsDelimited
502502 , mXyDms( p->mXyDms )
503503 , attributeColumns( p->attributeColumns )
504504{
505+ QUrl url = p->mFile ->url ();
506+
507+ // make sure watcher not created when using iterator (e.g. for rendering, see issue #15558)
508+ if ( url.hasQueryItem ( " watchFile" ) )
509+ {
510+ url.removeQueryItem ( " watchFile" );
511+ }
512+
505513 mFile = new QgsDelimitedTextFile ();
506- mFile ->setFromUrl ( p-> mFile -> url () );
514+ mFile ->setFromUrl ( url );
507515
508516 mExpressionContext << QgsExpressionContextUtils::globalScope ()
509517 << QgsExpressionContextUtils::projectScope ();
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ QgsDelimitedTextFile::QgsDelimitedTextFile( const QString& url )
3535 , mEncoding( " UTF-8" )
3636 , mFile( nullptr )
3737 , mStream( nullptr )
38- , mUseWatcher( true )
38+ , mUseWatcher( false )
3939 , mWatcher( nullptr )
4040 , mDefinitionValid( false )
4141 , mUseHeader( true )
@@ -158,9 +158,9 @@ bool QgsDelimitedTextFile::setFromUrl( const QUrl &url )
158158 }
159159
160160 //
161- if ( url.hasQueryItem ( " useWatcher " ) )
161+ if ( url.hasQueryItem ( " watchFile " ) )
162162 {
163- mUseWatcher = ! url.queryItemValue ( " useWatcher " ).toUpper ().startsWith ( ' N ' );
163+ mUseWatcher = url.queryItemValue ( " watchFile " ).toUpper ().startsWith ( ' Y ' );
164164 }
165165
166166 // The default type is csv, to be consistent with the
@@ -269,9 +269,9 @@ QUrl QgsDelimitedTextFile::url()
269269 url.addQueryItem ( " encoding" , mEncoding );
270270 }
271271
272- if ( ! mUseWatcher )
272+ if ( mUseWatcher )
273273 {
274- url.addQueryItem ( " useWatcher " , " no " );
274+ url.addQueryItem ( " watchFile " , " yes " );
275275 }
276276
277277 url.addQueryItem ( " type" , type () );
You can’t perform that action at this time.
0 commit comments