Skip to content
Permalink
Browse files

[locator] add a way to invalidate results from python API

otherwise if you access the config of the filter (or change app settings) from outside the main application settings dialog, results are not invalidate

for instance, if you update a URL of a service, results won't be updated
  • Loading branch information
3nids committed May 31, 2018
1 parent 6192b5e commit a15d8903ed2dc2ee314f07a963cf690acd239625
@@ -1102,6 +1102,15 @@ deregisterLocatorFilter() to deregister their filters upon plugin unload to avoi
.. seealso:: :py:func:`registerLocatorFilter`

.. versionadded:: 3.0
%End

virtual void invalidateLocatorResults() = 0;
%Docstring
Invalidate results from the locator filter.

This might be useful if the configuration of the filter changed without going through main application settings.

.. versionadded:: 3.2
%End

virtual bool askForDatumTransform( QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs ) = 0;
@@ -774,6 +774,11 @@ void QgisAppInterface::deregisterLocatorFilter( QgsLocatorFilter *filter )
qgis->mLocatorWidget->locator()->deregisterFilter( filter );
}

void QgisAppInterface::invalidateLocatorResults()
{
qgis->mLocatorWidget->invalidateResults();
}

bool QgisAppInterface::askForDatumTransform( QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs )
{
return qgis->askUserForDatumTransform( sourceCrs, destinationCrs );
@@ -544,6 +544,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface

void registerLocatorFilter( QgsLocatorFilter *filter ) override;
void deregisterLocatorFilter( QgsLocatorFilter *filter ) override;
void invalidateLocatorResults() override;

bool askForDatumTransform( QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs ) override;

@@ -902,6 +902,15 @@ class GUI_EXPORT QgisInterface : public QObject
*/
virtual void deregisterLocatorFilter( QgsLocatorFilter *filter ) = 0;

/**
* Invalidate results from the locator filter.
*
* This might be useful if the configuration of the filter changed without going through main application settings.
*
* \since QGIS 3.2
*/
virtual void invalidateLocatorResults() = 0;

/**
* Checks available datum transforms and ask user if several are available and none
* is chosen. Dialog is shown only if global option is set accordingly.

0 comments on commit a15d890

Please sign in to comment.
You can’t perform that action at this time.