Skip to content

Commit

Permalink
[Processing] Improve code readability (follow up 36d1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
radosuav authored and volaya committed Nov 4, 2015
1 parent 507aeb0 commit f7a7a78
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/plugins/processing/core/Processing.py
Expand Up @@ -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))
Expand All @@ -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()
Expand Down

0 comments on commit f7a7a78

Please sign in to comment.