Skip to content
Permalink
Browse files

[Processing] Improve code readability (follow up 36d1377)

  • Loading branch information
radosuav authored and volaya committed Nov 4, 2015
1 parent 507aeb0 commit f7a7a78cbad365a69a978178fd86ae568a132dd6
Showing with 5 additions and 4 deletions.
  1. +5 −4 python/plugins/processing/core/Processing.py
@@ -343,10 +343,10 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
+ 'This can cause unexpected results.'
QgsMessageLog.logMessage(Processing.tr('Warning: Not all input layers use the same CRS.\nThis can cause unexpected results.'), Processing.tr("Processing"))

# Don't set the wait cursor twice, because then when you
# restore it, it will still be a wait cursor.
overrideCursor = False
if iface is not None:
# Don't set the wait cursor twice, because then when you
# restore it, it will still be a wait cursor.
overrideCursor = False
cursor = QApplication.overrideCursor()
if cursor is None or cursor == 0:
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
@@ -360,14 +360,15 @@ def runAlgorithm(algOrName, onFinish, *args, **kwargs):
progress = kwargs["progress"]
elif iface is not None :
progress = MessageBarProgress()

ret = runalg(alg, progress)
if ret:
if onFinish is not None:
onFinish(alg, progress)
else:
QgsMessageLog.logMessage(Processing.tr("There were errors executing the algorithm."), Processing.tr("Processing"))

if iface is not None and overrideCursor:
if overrideCursor:
QApplication.restoreOverrideCursor()
if isinstance(progress, MessageBarProgress):
progress.close()

0 comments on commit f7a7a78

Please sign in to comment.
You can’t perform that action at this time.