Review Request 124963: New widget: KNewPasswordWidget

David Faure faure at kde.org
Sat Oct 10 13:56:56 UTC 2015


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



autotests/knewpasswordwidgettest.cpp (line 23)
<https://git.reviewboard.kde.org/r/124963/#comment59626>

    this includes all of QtTest and all of QtCore.
    Prefer #include <QTest> (+ #include <QSignalSpy> if using that).



autotests/knewpasswordwidgettest.cpp (line 60)
<https://git.reviewboard.kde.org/r/124963/#comment59627>

    if you used QString instead of auto here, the QLatin1String->QString conversion would only happen once...



autotests/knewpasswordwidgettest.cpp (line 128)
<https://git.reviewboard.kde.org/r/124963/#comment59628>

    Keep Ass ? :-)



src/knewpasswordwidget.h (line 65)
<https://git.reviewboard.kde.org/r/124963/#comment59629>

    these 9 lines could be done in one or two:
    
        const bool passOk = m_passwordWidget->passwordStatus() == WeakPassword || m_passwordWidget->passwordStatus() == StrongPassword;
        m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(passOk);
    
    But I guess you wanted to show a switch so people could add more code in there like showing "your password is too weak"?



src/knewpasswordwidget.h (line 100)
<https://git.reviewboard.kde.org/r/124963/#comment59630>

    missing @since 5.16 ?



src/knewpasswordwidget.h (line 122)
<https://git.reviewboard.kde.org/r/124963/#comment59631>

    typo: lenght -> length



src/knewpasswordwidget.cpp (line 299)
<https://git.reviewboard.kde.org/r/124963/#comment59632>

    the whole method in a single line:
    
    d->reasonablePasswordLength = qBound(reasonableLength, 1, maximumPasswordLength());



src/knewpasswordwidget.cpp (line 311)
<https://git.reviewboard.kde.org/r/124963/#comment59633>

    same here, use qBound



src/knewpasswordwidget.cpp (line 317)
<https://git.reviewboard.kde.org/r/124963/#comment59634>

    Ouch! A stylesheet! I strongly recommend against that. It messe up fonts and palettes.
    
    Use pal = palette(), pal.setColor(Base, ...), setPalette(pal) and setAutoFillBackground(true) on the lineedit whose background color you want to change.


- David Faure


On Aug. 30, 2015, 8:26 a.m., Elvis Angelaccio wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124963/
> -----------------------------------------------------------
> 
> (Updated Aug. 30, 2015, 8:26 a.m.)
> 
> 
> Review request for KDE Frameworks and Christoph Feck.
> 
> 
> Repository: kwidgetsaddons
> 
> 
> Description
> -------
> 
> This widget is a stripped-down version of KNewPasswordDialog, without any dialog-specific stuff.
> 
> ### Why a new widget?
> 
> This widget is meant to be easily embedded in any custom password dialog, including KNewPasswordDialog. It's the least common denominator of features that any password dialog should offer to the user.
> 
> ### Features
> 
> * Password visibility action (same as RR 124698). The password verification field is hidden if the user shows the password.
> * Background warning colour. The password verification field gets a coloured background whenever the password and its verification don't match. (feature borrowed from Keepass)
> * Password status signal. This allows the upper level dialogs to update their stuff (enable/disable OK button, show warnings for low password strength, etc.)
> * Password strength bar can be hidden.
> * Unit test.
> 
> ### Use cases
> At least the following:
> 
> * Ark (new archive dialog)
> * KNewPasswordDialog refactoring (my next RR if this one gets accepted)
> 
> 
> Diffs
> -----
> 
>   autotests/CMakeLists.txt ac708ef33e3be89db85d43911f96e536c52f741d 
>   autotests/knewpasswordwidgettest.h PRE-CREATION 
>   autotests/knewpasswordwidgettest.cpp PRE-CREATION 
>   src/CMakeLists.txt e03e9bbd6d73811873b0a465f86da269f4295138 
>   src/knewpasswordwidget.h PRE-CREATION 
>   src/knewpasswordwidget.cpp PRE-CREATION 
>   src/knewpasswordwidget.ui PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/124963/diff/
> 
> 
> Testing
> -------
> 
> 
> File Attachments
> ----------------
> 
> knewpasswordwidget1.png
>   https://git.reviewboard.kde.org/media/uploaded/files/2015/08/28/5796469c-28b7-4151-b9cb-6a327631db75__knewpasswordwidget1.png
> knewpasswordwidget2.png
>   https://git.reviewboard.kde.org/media/uploaded/files/2015/08/28/b3bfc9ac-ab8e-404c-8091-b5ad9e3e054f__knewpasswordwidget2.png
> knewpasswordwidget3.png
>   https://git.reviewboard.kde.org/media/uploaded/files/2015/08/28/dfaeea4e-65da-4961-b266-986a21f54ca7__knewpasswordwidget3.png
> 
> 
> Thanks,
> 
> Elvis Angelaccio
> 
>

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


More information about the Kde-frameworks-devel mailing list