Review Request 120160: KMessageWidget: fix handling of rapid succession of animatedHide+animatedShow calls

Milian Wolff mail at milianw.de
Sat Sep 13 15:20:21 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120160/#review66411
-----------------------------------------------------------


Nice, I think I've seen this behavior before and always wondered about it. Thanks for this contribution, it makes it behave much better. Also a big +1 for the unit test. Just some suggestions below on how to make that even more explicit.


autotests/kmessagewidgetautotest.cpp
<https://git.reviewboard.kde.org/r/120160/#comment46318>

    Couldn't this actually check that no animation is running at all now? We triggered the hide directly after the show, without going into the eventloop inbetween. I'd expect no animation to be triggered at all.
    
    generally, I'd urge you to split this test function into smaller ones and give each test a good name so that its clear what you check.
    
    Then also add a case for the case you try to test here, but don't actually (as far as I can see). Namely:
    
        w.animatedShow();
        QTest::qWait(10);
        QVERIFY(w.isShowAnimationRunning());
        w.animatedHide();
        QVERIFY(w.isHideAnimationRunning());
        QTest::qWait(10);
        QVERIFY(!w.isHideAnimationRunning());
        QVERIFY(!w.isVisible());
    
    and similar for the animatedShow/Hide when it is shown already.



autotests/kmessagewidgetautotest.cpp
<https://git.reviewboard.kde.org/r/120160/#comment46319>

    same as above


- Milian Wolff


On Sept. 12, 2014, 12:16 p.m., Fabio D'Urso wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120160/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2014, 12:16 p.m.)
> 
> 
> Review request for KDE Frameworks, Christoph Feck and Aurélien Gâteau.
> 
> 
> Repository: kwidgetsaddons
> 
> 
> Description
> -------
> 
> Hi, I've found that if you call animatedShow() immediatly after animatedHide(), without waiting for the hide animation to finish first, the hide animation goes on and, in the end, the message widget becomes hidden.
> 
> The attached patch adds checks in animatedShow and animatedHide so that, if an opposite animation is currently running, they just reverse it.
> 
> 
> Diffs
> -----
> 
>   autotests/kmessagewidgetautotest.h 062e2b3 
>   autotests/kmessagewidgetautotest.cpp f46bab0 
>   src/kmessagewidget.cpp bc7ba32 
>   tests/kmessagewidgettest.cpp f621b5a 
> 
> Diff: https://git.reviewboard.kde.org/r/120160/diff/
> 
> 
> Testing
> -------
> 
> I've added buttons to invoke animatedShow and animatedHide in tests/kmessagewidget.cpp and used them to test the behavior.
> 
> I've also added an autotest that checks the final height and isVisible() value, both after single animatedShow/animatedHide calls and after animatedShow+animatedHide and animatedHide+animatedShow.
> 
> 
> Thanks,
> 
> Fabio D'Urso
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140913/fb45a36a/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list