[Gwenview] Fix SaveAs
ClosedPublic

Authored by cfeck on Feb 2 2017, 12:41 PM.

Details

Summary

With Qt 5.8 I get:

  • invalid mimetype for QMimeDatabase ::mimeTypeForName("name.jpeg")
  • JPEG mimetype for QMimeDatabase::mimeTypeForFile("name.jpeg", QMimeDatabase::MatchExtension)

Not sure if this is a Qt bug or intended.

Test Plan

Opened a GIF image, saved as JPEG image.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cfeck updated this revision to Diff 10845.Feb 2 2017, 12:41 PM
cfeck retitled this revision from to [Gwenview] Fix SaveAs.
cfeck updated this object.
cfeck edited the test plan for this revision. (Show Details)
cfeck added reviewers: lbeltrame, sandsmark, dfaure.
cfeck set the repository for this revision to R260 Gwenview.
dfaure edited edge metadata.Feb 2 2017, 1:10 PM

There is no Qt bug here.
mimeTypeForName("image/jpeg") would be the correct way to use mimeTypeForName.

Indeed this code wants mimeTypeForFile instead.

But if the goal is then suffixes().first(), then preferredSuffix() is a more direct way to do this.

PS: if the repo was set I could look into the context more easily...

cfeck added a comment.Feb 2 2017, 1:18 PM

Thanks for the clarification. Repository was set to Gwenview already.

dfaure added a comment.Feb 2 2017, 1:32 PM

True. Why does phabricator say "Context not available" then? Missing branch information maybe?

cfeck updated this revision to Diff 10848.Feb 2 2017, 2:16 PM
cfeck edited edge metadata.

Use preferredSuffix()

cfeck added a comment.Feb 2 2017, 2:16 PM

No idea.

Fare well, ReviewBoard :/

dfaure accepted this revision.Feb 2 2017, 2:23 PM
dfaure edited edge metadata.

Looks ok now.

This revision is now accepted and ready to land.Feb 2 2017, 2:23 PM
This revision was automatically updated to reflect the committed changes.