Closing calculate occupied space window aborts the calculation
ClosedPublic

Authored by gengisdave on Feb 17 2018, 4:08 PM.

Details

Reviewers
nmel
asensi
martinkostolny
Group Reviewers
Krusader
Summary

As in bug #388266, pressing esc or closing the dialog does not stops the space calculation.

This patch adds closeEvent() and keyPressEvent() to solve the problem.

m_updateTimer->isActive() is checked in both functions to avoid calling m_updateTimer->stop() twice, causing a segfault when calculation is finished and the user closes the dialog without using the OK button.

Test Plan

Esc and the close command on the dialog both quit and the calculation ends. When calculation is completed, the same commands just close the dialog.

Diff Detail

Repository
R167 Krusader
Lint
Lint Skipped
Unit
Unit Tests Skipped
gengisdave requested review of this revision.Feb 17 2018, 4:08 PM
gengisdave created this revision.
gengisdave added a reviewer: Krusader.
nmel requested changes to this revision.Feb 17 2018, 9:37 PM
nmel added a subscriber: nmel.

Thanks for the bug fix. I checked the code and tested - it works nicely!

I only have a few minor asks regarding code style consistency as I marked inline.

Please also add the following text to the commit message:
FIXED: [ 388266 ] Closing calculate occupied space window does not abort the calculation
BUG: 388266

(FIXED tag is for release notes, BUG tag is for bugzilla)

krusader/Panel/krcalcspacedialog.cpp
41

QtGui

88

space: if (

This revision now requires changes to proceed.Feb 17 2018, 9:37 PM
asensi accepted this revision.Feb 21 2018, 11:33 AM
asensi added a subscriber: asensi.

Thanks Davide! The changes that Nikita (nmel) wrote are also improvements. For my part, I accept this because my performed tests (using Kubuntu 17.10) seemed to work correctly.

martinkostolny accepted this revision.Feb 22 2018, 12:19 AM
martinkostolny added a subscriber: martinkostolny.

Works nicely on Arch Linux. Thanks Davide! :)

I agree with the changes Nikita proposed, but I believe we don't necessarily need another diff update for them here. They can be directly pushed. Therefore I'm accepting.

nmel accepted this revision.Feb 22 2018, 8:30 AM

I also accept to prevent another code review iteration. Please integrate the requested changes into the final commit.

This revision is now accepted and ready to land.Feb 22 2018, 8:30 AM
nmel closed this revision.Feb 23 2018, 6:05 AM

It's pushed by Davide already.