Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 17, 2017
1 parent e260be1 commit 5a0bcf0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/gui/locator/qgslocatorfilter.sip
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions python/plugins/processing/gui/AlgorithmLocatorFilter.py
Expand Up @@ -34,6 +34,7 @@
from processing.gui.AlgorithmDialog import AlgorithmDialog
from qgis.utils import iface


class AlgorithmLocatorFilter(QgsLocatorFilter):

def __init__(self, parent=None):
Expand All @@ -51,20 +52,20 @@ def priority(self):
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
Expand Down
2 changes: 1 addition & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/gui/locator/qgslocatorfilter.h
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/locator/qgslocatorwidget.cpp
Expand Up @@ -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() )
{
Expand Down

0 comments on commit 5a0bcf0

Please sign in to comment.