mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
cancelled => canceled etc. //#spellok
This commit is contained in:
parent
487a7a00b7
commit
5bd2e88a7c
@ -4366,7 +4366,7 @@ methaphors:metaphors
|
||||
metres:meters
|
||||
Michagan:Michigan
|
||||
micoscopy:microscopy
|
||||
microprocesspr:microprocessor
|
||||
microprocesspr\>:microprocessor
|
||||
midwifes:midwives
|
||||
mileau:milieu
|
||||
milennia:millennia
|
||||
@ -5381,7 +5381,7 @@ proceses:processes
|
||||
processer:processor:*
|
||||
processess:processes
|
||||
processessing:processing
|
||||
processpr:processor
|
||||
processpr\>:processor
|
||||
processs:process:*
|
||||
processsed:processed
|
||||
processses:processes
|
||||
|
@ -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;
|
||||
@ -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];
|
||||
@ -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 )
|
||||
{
|
||||
@ -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 )
|
||||
{
|
||||
@ -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] )
|
||||
|
@ -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] );
|
||||
|
||||
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
@ -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();
|
||||
|
||||
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
@ -188,7 +188,7 @@ ACCEPTABLE_MISSING_DOCS = {
|
||||
"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"],
|
||||
@ -615,7 +615,7 @@ ACCEPTABLE_MISSING_DOCS = {
|
||||
"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 "],
|
||||
|
@ -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():
|
||||
@ -138,9 +138,9 @@ class TestQgsTaskManager(unittest.TestCase):
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user