Skip to content

Commit f7a7a78

Browse files
radosuavvolaya
authored andcommitted
[Processing] Improve code readability (follow up 36d1377)
1 parent 507aeb0 commit f7a7a78

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/plugins/processing/core/Processing.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
343343
+ 'This can cause unexpected results.'
344344
QgsMessageLog.logMessage(Processing.tr('Warning: Not all input layers use the same CRS.\nThis can cause unexpected results.'), Processing.tr("Processing"))
345345

346+
# Don't set the wait cursor twice, because then when you
347+
# restore it, it will still be a wait cursor.
348+
overrideCursor = False
346349
if iface is not None:
347-
# Don't set the wait cursor twice, because then when you
348-
# restore it, it will still be a wait cursor.
349-
overrideCursor = False
350350
cursor = QApplication.overrideCursor()
351351
if cursor is None or cursor == 0:
352352
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
@@ -360,14 +360,15 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
360360
progress = kwargs["progress"]
361361
elif iface is not None :
362362
progress = MessageBarProgress()
363+
363364
ret = runalg(alg, progress)
364365
if ret:
365366
if onFinish is not None:
366367
onFinish(alg, progress)
367368
else:
368369
QgsMessageLog.logMessage(Processing.tr("There were errors executing the algorithm."), Processing.tr("Processing"))
369370

370-
if iface is not None and overrideCursor:
371+
if overrideCursor:
371372
QApplication.restoreOverrideCursor()
372373
if isinstance(progress, MessageBarProgress):
373374
progress.close()

0 commit comments

Comments
 (0)