Skip to content

Commit

Permalink
cancelled => canceled etc. //#spellok
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Aug 6, 2017
1 parent 487a7a0 commit 5bd2e88
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions scripts/spell_check/spelling.dat
Original file line number Diff line number Diff line change
Expand Up @@ -4366,7 +4366,7 @@ methaphors:metaphors
metres:meters
Michagan:Michigan
micoscopy:microscopy
microprocesspr:microprocessor
microprocesspr\>:microprocessor
midwifes:midwives
mileau:milieu
milennia:millennia
Expand Down Expand Up @@ -5381,7 +5381,7 @@ proceses:processes
processer:processor:*
processess:processes
processessing:processing
processpr:processor
processpr\>:processor
processs:process:*
processsed:processed
processses:processes
Expand Down
16 changes: 8 additions & 8 deletions src/core/pal/pal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Pal::Pal()
// do not init and exit GEOS - we do it inside QGIS
//initGEOS( geosNotice, geosError );

fnIsCancelled = nullptr;
fnIsCancelledContext = nullptr;
fnIsCanceled = nullptr;
fnIsCanceledContext = nullptr;

ejChainDeg = 50;
tenure = 10;
Expand Down Expand Up @@ -208,7 +208,7 @@ bool filteringCallback( FeaturePart *featurePart, void *ctx )
RTree<LabelPosition *, double, 2, double> *cdtsIndex = ( reinterpret_cast< FilterContext * >( ctx ) )->cdtsIndex;
Pal *pal = ( reinterpret_cast< FilterContext * >( ctx ) )->pal;

if ( pal->isCancelled() )
if ( pal->isCanceled() )
return false; // do not continue searching

double amin[2], amax[2];
Expand Down Expand Up @@ -335,7 +335,7 @@ Problem *Pal::extract( double lambda_min, double phi_min, double lambda_max, dou
filterCtx.pal = this;
obstacles->Search( amin, amax, filteringCallback, static_cast< void * >( &filterCtx ) );

if ( isCancelled() )
if ( isCanceled() )
{
Q_FOREACH ( Feats *feat, *fFeats )
{
Expand Down Expand Up @@ -400,7 +400,7 @@ Problem *Pal::extract( double lambda_min, double phi_min, double lambda_max, dou

while ( !fFeats->isEmpty() ) // foreach feature
{
if ( isCancelled() )
if ( isCanceled() )
{
Q_FOREACH ( Feats *feat, *fFeats )
{
Expand Down Expand Up @@ -503,10 +503,10 @@ QList<LabelPosition *> *Pal::labeller( double bbox[4], PalStat **stats, bool dis
return solution;
}

void Pal::registerCancellationCallback( Pal::FnIsCancelled fnCancelled, void *context )
void Pal::registerCancelationCallback( Pal::FnIsCanceled fnCanceled, void *context )
{
fnIsCancelled = fnCancelled;
fnIsCancelledContext = context;
fnIsCanceled = fnCanceled;
fnIsCanceledContext = context;
}

Problem *Pal::extractProblem( double bbox[4] )
Expand Down
18 changes: 9 additions & 9 deletions src/core/pal/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ namespace pal
*/
QList<LabelPosition *> *labeller( double bbox[4], PalStat **stats, bool displayAll );

typedef bool ( *FnIsCancelled )( void *ctx );
typedef bool ( *FnIsCanceled )( void *ctx );

//! Register a function that returns whether this job has been cancelled - PAL calls it during the computation
void registerCancellationCallback( FnIsCancelled fnCancelled, void *context );
//! Register a function that returns whether this job has been canceled - PAL calls it during the computation
void registerCancelationCallback( FnIsCanceled fnCanceled, void *context );

//! Check whether the job has been cancelled
inline bool isCancelled() { return fnIsCancelled ? fnIsCancelled( fnIsCancelledContext ) : false; }
//! Check whether the job has been canceled
inline bool isCanceled() { return fnIsCanceled ? fnIsCanceled( fnIsCanceledContext ) : false; }

Problem *extractProblem( double bbox[4] );

Expand Down Expand Up @@ -263,10 +263,10 @@ namespace pal
*/
bool showPartial;

//! Callback that may be called from PAL to check whether the job has not been cancelled in meanwhile
FnIsCancelled fnIsCancelled;
//! Application-specific context for the cancellation check function
void *fnIsCancelledContext = nullptr;
//! Callback that may be called from PAL to check whether the job has not been canceled in meanwhile
FnIsCanceled fnIsCanceled;
//! Application-specific context for the cancelation check function
void *fnIsCanceledContext = nullptr;

/**
* \brief Problem factory
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void Problem::init_sol_falp()

while ( list->getSize() > 0 ) // O (log size)
{
if ( pal->isCancelled() )
if ( pal->isCanceled() )
{
delete context;
delete list;
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgslabelingengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


// helper function for checking for job cancelation within PAL
static bool _palIsCancelled( void *ctx ) //#spellok
static bool _palIsCanceled( void *ctx )
{
return ( reinterpret_cast< QgsRenderContext * >( ctx ) )->renderingStopped();
}
Expand Down Expand Up @@ -111,7 +111,7 @@ void QgsLabelingEngine::removeProvider( QgsAbstractLabelProvider *provider )
}
}

void QgsLabelingEngine::processProvider( QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p ) //#spellok
void QgsLabelingEngine::processProvider( QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p )
{
QgsAbstractLabelProvider::Flags flags = provider->flags();

Expand Down Expand Up @@ -179,7 +179,7 @@ void QgsLabelingEngine::processProvider( QgsAbstractLabelProvider *provider, Qgs
Q_FOREACH ( QgsAbstractLabelProvider *subProvider, provider->subProviders() )
{
mSubProviders << subProvider;
processProvider( subProvider, context, p ); //#spellok
processProvider( subProvider, context, p );
}
}

Expand Down Expand Up @@ -230,7 +230,7 @@ void QgsLabelingEngine::run( QgsRenderContext &context )
appendedLayerScope = true;
context.expressionContext().appendScope( QgsExpressionContextUtils::layerScope( ml ) );
}
processProvider( provider, context, p ); //#spellok
processProvider( provider, context, p );
if ( appendedLayerScope )
delete context.expressionContext().popScope();
}
Expand All @@ -249,7 +249,7 @@ void QgsLabelingEngine::run( QgsRenderContext &context )

QgsRectangle extent = extentGeom.boundingBox();

p.registerCancellationCallback( &_palIsCancelled, reinterpret_cast< void * >( &context ) ); //#spellok
p.registerCancelationCallback( &_palIsCanceled, reinterpret_cast< void * >( &context ) );

QTime t;
t.start();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgslabelingengine.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class CORE_EXPORT QgsLabelingEngine
QgsLabelingResults *results() const { return mResults.get(); }

protected:
void processProvider( QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p ); //#spellok
void processProvider( QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p );

protected:
//! Associated map settings instance
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgstaskmanagerwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class GUI_EXPORT QgsTaskStatusWidget : public QWidget
signals:

/**
* Emitted when the user clicks a cancellable task.
* Emitted when the user clicks a cancelable task.
*/
void cancelClicked();

Expand Down
4 changes: 2 additions & 2 deletions tests/code_layout/acceptable_missing_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"QgsComposerGroupItem": ["QgsComposerGroupItem(const QString &text)"],
"QgsGraphDirector": ["buildProgress(int, int) const ", "buildMessage(const QString &) const ", "addProperter(QgsArcProperter *prop)"],
"QgsScaleComboBox": ["QgsScaleComboBox(QWidget *parent=nullptr)", "updateScales(const QStringList &scales=QStringList())"],
"QgsLabelingEngine": ["processProvider(QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p)", "Flag"], # spellok
"QgsLabelingEngine": ["processProvider(QgsAbstractLabelProvider *provider, QgsRenderContext &context, pal::Pal &p)", "Flag"],
"QgsSymbolSelectorDialog": ["moveLayerByOffset(int offset)", "QgsSymbolSelectorDialog(QgsSymbol *symbol, QgsStyle *style, const QgsVectorLayer *vl, QWidget *parent=nullptr, bool embedded=false)", "lockLayer()", "moveLayerUp()", "updateUi()", "addLayer()", "moveLayerDown()", "layerChanged()", "loadSymbol()", "loadSymbol(QgsSymbol *symbol, SymbolLayerItem *parent)", "setWidget(QWidget *widget)", "updateLayerPreview()", "symbolModified()", "updateLockButton()", "removeLayer()", "currentLayer()", "updatePreview()"],
"QgsCacheIndexFeatureId": ["QgsCacheIndexFeatureId(QgsVectorLayerCache *)"],
"QgsSymbolLayerWidget": ["setSymbolLayer(QgsSymbolLayer *layer)=0", "updateDataDefinedProperty()", "QgsSymbolLayerWidget(QWidget *parent, const QgsVectorLayer *vl=nullptr)", "symbolLayer()=0"],
Expand Down Expand Up @@ -615,7 +615,7 @@
"QgsZipItem": ["QgsZipItem(QgsDataItem *parent, const QString &name, const QString &filePath, const QString &path)", "itemFromPath(QgsDataItem *parent, QString path, QString name)", "getZipFileList()", "QgsZipItem(QgsDataItem *parent, const QString &name, const QString &path)", "iconZip()", "vsiPrefix(const QString &uri)"],
"NormVecDecorator": ["NormVecDecorator(Triangulation *tin)"],
"QgsVectorLayerJoinBuffer": ["vectorJoins() const ", "QgsVectorLayerJoinBuffer(QgsVectorLayer *layer=nullptr)"],
"pal::Pal": ["solveProblem(Problem *prob, bool displayAll)", "extractProblem(double bbox[4])", "FnIsCancelled)(void *ctx)"], # spellok
"pal::Pal": ["solveProblem(Problem *prob, bool displayAll)", "extractProblem(double bbox[4])", "FnIsCanceled)(void *ctx)"],
"QgsSearchWidgetWrapper": ["setExpression(QString value)=0"],
"QgsRasterFillSymbolLayer": ["create(const QgsStringMap &properties=QgsStringMap())", "QgsRasterFillSymbolLayer(const QString &imageFilePath=QString())", "FillCoordinateMode"],
"QgsExpression::NodeInOperator": ["NodeInOperator(Node *node, NodeList *list, bool notin=false)", "node() const ", "isNotIn() const ", "list() const "],
Expand Down
6 changes: 3 additions & 3 deletions tests/src/python/test_qgstaskmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run_with_kwargs(task, password, result):
return result


def cancellable(task):
def cancelable(task):
while not task.isCanceled():
pass
if task.isCanceled():
Expand Down Expand Up @@ -138,9 +138,9 @@ def testTaskFromFunctionWithKwargs(self):
self.assertFalse(task.exception)
self.assertEqual(task.status(), QgsTask.Complete)

def testTaskFromFunctionIsCancellable(self):
def testTaskFromFunctionIsCancelable(self):
""" test that task from function can check canceled status """
bad_task = QgsTask.fromFunction('test task4', cancellable)
bad_task = QgsTask.fromFunction('test task4', cancelable)
QgsApplication.taskManager().addTask(bad_task)
while bad_task.status() != QgsTask.Running:
pass
Expand Down

0 comments on commit 5bd2e88

Please sign in to comment.