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 @@ -501,8 +501,16 @@ QgsDelimitedTextFeatureSource::QgsDelimitedTextFeatureSource( const QgsDelimited
501
501
, mXyDms( p->mXyDms )
502
502
, attributeColumns( p->attributeColumns )
503
503
{
504
+ QUrl url = p->mFile ->url ();
505
+
506
+ // make sure watcher not created when using iterator (e.g. for rendering, see issue #15558)
507
+ if ( url.hasQueryItem ( " watchFile" ) )
508
+ {
509
+ url.removeQueryItem ( " watchFile" );
510
+ }
511
+
504
512
mFile = new QgsDelimitedTextFile ();
505
- mFile ->setFromUrl ( p-> mFile -> url () );
513
+ mFile ->setFromUrl ( url );
506
514
507
515
mExpressionContext << QgsExpressionContextUtils::globalScope ()
508
516
<< 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