Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[delimitertext] fix watcher check ignored and harmful watcher created…
- Loading branch information
|
@@ -502,8 +502,16 @@ QgsDelimitedTextFeatureSource::QgsDelimitedTextFeatureSource( const QgsDelimited |
|
|
, mXyDms( p->mXyDms ) |
|
|
, attributeColumns( p->attributeColumns ) |
|
|
{ |
|
|
QUrl url = p->mFile->url(); |
|
|
|
|
|
// make sure watcher not created when using iterator (e.g. for rendering, see issue #15558) |
|
|
if ( url.hasQueryItem( "watchFile" ) ) |
|
|
{ |
|
|
url.removeQueryItem( "watchFile" ); |
|
|
} |
|
|
|
|
|
mFile = new QgsDelimitedTextFile(); |
|
|
mFile->setFromUrl( p->mFile->url() ); |
|
|
mFile->setFromUrl( url ); |
|
|
|
|
|
mExpressionContext << QgsExpressionContextUtils::globalScope() |
|
|
<< QgsExpressionContextUtils::projectScope(); |
|
|
|
@@ -35,7 +35,7 @@ QgsDelimitedTextFile::QgsDelimitedTextFile( const QString& url ) |
|
|
, mEncoding( "UTF-8" ) |
|
|
, mFile( nullptr ) |
|
|
, mStream( nullptr ) |
|
|
, mUseWatcher( true ) |
|
|
, mUseWatcher( false ) |
|
|
, mWatcher( nullptr ) |
|
|
, mDefinitionValid( false ) |
|
|
, mUseHeader( true ) |
|
@@ -158,9 +158,9 @@ bool QgsDelimitedTextFile::setFromUrl( const QUrl &url ) |
|
|
} |
|
|
|
|
|
// |
|
|
if ( url.hasQueryItem( "useWatcher" ) ) |
|
|
if ( url.hasQueryItem( "watchFile" ) ) |
|
|
{ |
|
|
mUseWatcher = ! url.queryItemValue( "useWatcher" ).toUpper().startsWith( 'N' ); |
|
|
mUseWatcher = url.queryItemValue( "watchFile" ).toUpper().startsWith( 'Y' ); |
|
|
} |
|
|
|
|
|
// The default type is csv, to be consistent with the |
|
@@ -269,9 +269,9 @@ QUrl QgsDelimitedTextFile::url() |
|
|
url.addQueryItem( "encoding", mEncoding ); |
|
|
} |
|
|
|
|
|
if ( !mUseWatcher ) |
|
|
if ( mUseWatcher ) |
|
|
{ |
|
|
url.addQueryItem( "useWatcher", "no" ); |
|
|
url.addQueryItem( "watchFile", "yes" ); |
|
|
} |
|
|
|
|
|
url.addQueryItem( "type", type() ); |
|
|