mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Style fixes
This commit is contained in:
parent
e260be111e
commit
5a0bcf0776
@ -118,7 +118,7 @@ class QgsLocatorFilter : QObject
|
||||
results from this filter.
|
||||
.. note::
|
||||
|
||||
Plugins are not permitted to utilise prefixes with < 3 characters,
|
||||
Plugins are not permitted to utilize prefixes with < 3 characters,
|
||||
as these are reserved for core QGIS functions. If a plugin registers
|
||||
a filter with a prefix shorter than 3 characters then the prefix will
|
||||
be ignored.
|
||||
|
@ -34,6 +34,7 @@ from processing.gui.MessageDialog import MessageDialog
|
||||
from processing.gui.AlgorithmDialog import AlgorithmDialog
|
||||
from qgis.utils import iface
|
||||
|
||||
|
||||
class AlgorithmLocatorFilter(QgsLocatorFilter):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@ -51,20 +52,20 @@ class AlgorithmLocatorFilter(QgsLocatorFilter):
|
||||
def prefix(self):
|
||||
return 'a'
|
||||
|
||||
def fetchResults(self,string,context,feedback):
|
||||
def fetchResults(self, string, context, feedback):
|
||||
for a in QgsApplication.processingRegistry().algorithms():
|
||||
if feedback.isCanceled():
|
||||
return
|
||||
if a.flags() & QgsProcessingAlgorithm.FlagHideFromToolbox:
|
||||
continue
|
||||
|
||||
if QgsLocatorFilter.stringMatches(a.displayName(),string) or [t for t in a.tags() if QgsLocatorFilter.stringMatches(t,string)]:
|
||||
if QgsLocatorFilter.stringMatches(a.displayName(), string) or [t for t in a.tags() if QgsLocatorFilter.stringMatches(t, string)]:
|
||||
result = QgsLocatorResult()
|
||||
result.filter = self
|
||||
result.displayString = a.displayName()
|
||||
result.icon = a.icon()
|
||||
result.userData = a.id()
|
||||
if QgsLocatorFilter.stringMatches(a.displayName(),string):
|
||||
if string and QgsLocatorFilter.stringMatches(a.displayName(), string):
|
||||
result.score = float(len(string)) / len(a.displayName())
|
||||
else:
|
||||
result.score = 0
|
||||
|
@ -108,7 +108,7 @@ QgsActionLocatorFilter::QgsActionLocatorFilter( const QList<QWidget *> &parentOb
|
||||
setUseWithoutPrefix( false );
|
||||
}
|
||||
|
||||
void QgsActionLocatorFilter::fetchResults( const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback )
|
||||
void QgsActionLocatorFilter::fetchResults( const QString &string, const QgsLocatorContext &, QgsFeedback *feedback )
|
||||
{
|
||||
QList<QAction *> found;
|
||||
|
||||
|
@ -137,7 +137,7 @@ class GUI_EXPORT QgsLocatorFilter : public QObject
|
||||
* Returns the search prefix character(s) for this filter. Prefix a search
|
||||
* with these characters will restrict the locator search to only include
|
||||
* results from this filter.
|
||||
* \note Plugins are not permitted to utilise prefixes with < 3 characters,
|
||||
* \note Plugins are not permitted to utilize prefixes with < 3 characters,
|
||||
* as these are reserved for core QGIS functions. If a plugin registers
|
||||
* a filter with a prefix shorter than 3 characters then the prefix will
|
||||
* be ignored.
|
||||
|
@ -510,7 +510,7 @@ QgsLocatorFilterFilter::QgsLocatorFilterFilter( QgsLocatorWidget *locator, QObje
|
||||
, mLocator( locator )
|
||||
{}
|
||||
|
||||
void QgsLocatorFilterFilter::fetchResults( const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback )
|
||||
void QgsLocatorFilterFilter::fetchResults( const QString &string, const QgsLocatorContext &, QgsFeedback *feedback )
|
||||
{
|
||||
if ( !string.isEmpty() )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user