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

Elvis Angelaccio noreply at phabricator.kde.org
Sun Feb 18 17:42:36 GMT 2018


elvisangelaccio added a comment.


  Crash is gone, but now I get two failures:
  
    FAIL!  : FileMetadataWidgetTest::shouldShowProperties() 'value' returned FALSE. (albumArtist data was not found)
       Loc: [../autotests/filemetadatawidgettest.cpp(151)]
    PASS   : FileMetadataWidgetTest::shouldShowCommonProperties()
    PASS   : FileMetadataWidgetTest::cleanupTestCase()
    Totals: 7 passed, 1 failed, 0 skipped, 0 blacklisted, 175ms
    ********* Finished testing of FileMetadataWidgetTest *********
    
        Start 4: filemetadataitemcounttest
    4/4 Test #4: filemetadataitemcounttest ........***Failed    0.30 sec
    ********* Start testing of FileMetadataItemCountTest *********
    Config: Using QtTest library 5.10.1, Qt 5.10.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.3.0)
    PASS   : FileMetadataItemCountTest::initTestCase()
    FAIL!  : FileMetadataItemCountTest::testItemCount() Compared values are not the same
       Actual   (items.count())                 : 16
       Expected (expectedItems * widgetsPerItem): 38
       Loc: [../autotests/filemetadataitemcounttest.cpp(73)]

INLINE COMMENTS

> filemetadatawidget.cpp:72
>      QStringList sortedKeys(const QVariantMap& data) const;
> +    QLabel* createLabel(const QString &key,  QString itemLabel, FileMetaDataWidget* parent);
>  

Pass by const reference also `itemLabel`.

> filemetadatawidget.cpp:120
> +    // Clear widget to avoid duplicates
> +    deleteRows();
> +    for (auto w: q->findChildren<QWidget*>(QString(), Qt::FindDirectChildrenOnly)) {

Isn't this already called in `slotDataAvailable()` ?

> filemetadatawidget.cpp:130
>  
> +QLabel* FileMetaDataWidget::Private::createLabel(const QString &key,  QString itemLabel, FileMetaDataWidget* parent) {
> +    itemLabel.append(QLatin1Char(':'));

code style: opening brace should go to the next line

> filemetadatawidget.cpp:152
>  
> -    // Filter the data
> +    // Filter the data by 'baloofileinformationrc' config
>      QVariantMap data = m_filter->filter( m_provider->data() );

This information should probably go in the documentation of `filter()` in metadatafilter.h

> filemetadatawidget.cpp:159
> +    // Embed the label and the value as new row in the widget
> +    for (const auto key: sortedKeys(data)) {
> +        Row row;

Same detaching issue as before. Don't remove the `const QStringList keys = sortedKeys(data);` line and we'll be fine.

REPOSITORY
  R824 Baloo Widgets

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

To: michaelh, #dolphin, elvisangelaccio
Cc: ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180218/88bb5ce0/attachment.htm>


More information about the kfm-devel mailing list