Skip to content

Commit a15d890

Browse files
committedJun 1, 2018
[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
1 parent 6192b5e commit a15d890

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed
 

‎python/gui/auto_generated/qgisinterface.sip.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,15 @@ deregisterLocatorFilter() to deregister their filters upon plugin unload to avoi
11021102
.. seealso:: :py:func:`registerLocatorFilter`
11031103

11041104
.. versionadded:: 3.0
1105+
%End
1106+
1107+
virtual void invalidateLocatorResults() = 0;
1108+
%Docstring
1109+
Invalidate results from the locator filter.
1110+
1111+
This might be useful if the configuration of the filter changed without going through main application settings.
1112+
1113+
.. versionadded:: 3.2
11051114
%End
11061115

11071116
virtual bool askForDatumTransform( QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs ) = 0;

‎src/app/qgisappinterface.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,11 @@ void QgisAppInterface::deregisterLocatorFilter( QgsLocatorFilter *filter )
774774
qgis->mLocatorWidget->locator()->deregisterFilter( filter );
775775
}
776776

777+
void QgisAppInterface::invalidateLocatorResults()
778+
{
779+
qgis->mLocatorWidget->invalidateResults();
780+
}
781+
777782
bool QgisAppInterface::askForDatumTransform( QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs )
778783
{
779784
return qgis->askUserForDatumTransform( sourceCrs, destinationCrs );

‎src/app/qgisappinterface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
544544

545545
void registerLocatorFilter( QgsLocatorFilter *filter ) override;
546546
void deregisterLocatorFilter( QgsLocatorFilter *filter ) override;
547+
void invalidateLocatorResults() override;
547548

548549
bool askForDatumTransform( QgsCoordinateReferenceSystem sourceCrs, QgsCoordinateReferenceSystem destinationCrs ) override;
549550

‎src/gui/qgisinterface.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,15 @@ class GUI_EXPORT QgisInterface : public QObject
902902
*/
903903
virtual void deregisterLocatorFilter( QgsLocatorFilter *filter ) = 0;
904904

905+
/**
906+
* Invalidate results from the locator filter.
907+
*
908+
* This might be useful if the configuration of the filter changed without going through main application settings.
909+
*
910+
* \since QGIS 3.2
911+
*/
912+
virtual void invalidateLocatorResults() = 0;
913+
905914
/**
906915
* Checks available datum transforms and ask user if several are available and none
907916
* is chosen. Dialog is shown only if global option is set accordingly.

0 commit comments

Comments
 (0)
Please sign in to comment.