D10149: baloo-widgets: Add autotest for asychronously extracted data

Elvis Angelaccio noreply at phabricator.kde.org
Sun Feb 25 17:01:07 GMT 2018


elvisangelaccio added a comment.


  Almost there!

INLINE COMMENTS

> filemetadatawidgettest.cpp:150-151
> +    // simple property
> +    QLabel* value;
> +    value = m_widget->findChild<QLabel*>("kfileitem#type");
> +    QVERIFY2(value, "Type data missing");

Can be merged in a single line.

Btw this is a QLabel so I'd call it `label` or maybe `valueLabel`. Just `value` can be confusing.

> filemetadatawidgettest.cpp:157
> +        // editable property
> +        KRatingWidget* rating = m_widget->findChild<KRatingWidget*>("rating");
> +        QVERIFY2(rating, "Rating data missing");

Please call it `ratingWidget`.

That will fix the weird `rating->rating()` line below ;)

> filemetadatawidgettest.cpp:181
> +    // simple property
> +    QLabel* value = m_widget->findChild<QLabel*>("kfileitem#type");
> +    QVERIFY(!value);

Same, don't call it `value`

> filemetadatawidgettest.cpp:190
> +    if (m_mayTestRating) {
> +        KRatingWidget* rating = m_widget->findChild<KRatingWidget*>("rating");
> +        QCOMPARE(rating->rating(), 5);

Same as above

REPOSITORY
  R824 Baloo Widgets

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

To: michaelh, #dolphin, elvisangelaccio
Cc: ngraham, ashaposhnikov, spoorun, nicolasfella, alexeymin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180225/7c64fd7a/attachment.htm>


More information about the kfm-devel mailing list