D8536: Add more hashing algorithms to KPropertiesDialog

Anthony Fieroni noreply at phabricator.kde.org
Wed Dec 27 16:58:49 UTC 2017


anthonyfieroni added inline comments.

INLINE COMMENTS

> kpropertiesdialog.cpp:2798-2804
> +        const QString cache = cachedChecksum(alg);
> +        if (!cache.isEmpty()) {
> +            return cache;
> +        }
>  
> -void KChecksumsPlugin::slotShowSha256()
> -{
> -    auto label = new QLabel(i18nc("@action:button", "Calculating..."), &d->m_widget);
> -    label->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
> +        const QString checksum = computeChecksum(alg, path);
> +        cacheChecksum(checksum, alg);

You don't understand me, now you have a race condition. cachedChecksum reads from cache while cacheChecksum writes. It's a race condition and you need mutex here. When you add here you will not needed anymore in cacheChecksum.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D8536

To: petermajchrak, elvisangelaccio, #vdg, colomar
Cc: colomar, anthonyfieroni, bcooksley, alexeymin, ngraham, elvisangelaccio, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171227/873dcef9/attachment.html>


More information about the Kde-frameworks-devel mailing list