[Differential] [Updated] D2365: Add failing test case for selected filter from mimetype

elvisangelaccio (Elvis Angelaccio) noreply at phabricator.kde.org
Sun Aug 7 15:43:35 UTC 2016


elvisangelaccio added a comment.


  I think I figured out what's going on. This seems to be a regression introduced by https://phabricator.kde.org/rPLASMAINTEGRATION25be75542f831863e905b590b6429127df1b13d3. If I revert this commit, this test passes.
  
  So, this is what's happening. In this example I'm considering the `text/x-chdr` test case:
  
  1. The test calls `dialog.setMimeTypeFilters("text/x-chdr")` and then `dialog.show()`
  2. `KDEPlatformFileDialogHelper::show()` calls `initializeDialog()`
  3. In `initiliazeDialog()` we end up appending `text/x-chdr` to the filters of `m_fileWidget`'s KFileFilterCombo (`d->m_filters` in `kio.git/src/filewidgets/kfilefiltercombo.cpp`)
  4. In the test we call `dialog.selectMimeTypeFilter("text/x-chdr")`
  5. QFileDialog calls `selectNameFilter("C header (*.h)")`
  6. KDEPlatformFileDialogHelper calls `selectNameFilter(qt2KdeFilter(QStringList("C header (*.h)")))`
  7. KDEPlatformFileDialog calls `filterWidget()->setCurrentFilter("*.h|C header ")`
  8. The KFileFilterCombo ends up calling `setCurrentIndex(d->m_filters.indexOf("*.h|C header "))` which fails because `d->m_filters` contains only `text/x-chdr`.
  9. `dialog.selectedNameFilter()` returns an empty string because of step 8.
  
  So the bug seems to be in the step 3. Before of commit https://phabricator.kde.org/rPLASMAINTEGRATION25be75542f831863e905b590b6429127df1b13d3, `d->m_filters` would also receive `*.h|C header ` which would make the test pass.
  
  But I'm still not sure how to properly fix this...

REPOSITORY
  rPLASMAINTEGRATION Integration for Qt applications in Plasma

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: elvisangelaccio, dfaure, graesslin
Cc: plasma-devel, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160807/b5eedc4b/attachment.html>


More information about the Plasma-devel mailing list