Fwd: [Bug 290875] [thumbnailer] Images files thumbnails generated by calligra have an obstrusive overlay icons

Friedrich W. H. Kossebau kossebau at kde.org
Mon Jul 2 17:15:10 BST 2012


Am Montag, 2. Juli 2012, 17:34:07 schrieb Friedrich W. H. Kossebau:
> Am Montag, 2. Juli 2012, 16:58:10 schrieb David Revoy:
> > Hi Friedrich,
> > 
> > (bug :https://bugs.kde.org/show_bug.cgi?id=290875   )
> > On the screenshot
> > (http://img861.imageshack.us/img861/7954/20120107screenshot01.jpg  ) the
> > one without the blendicon are *.ora files saved by Mypaint. Mypaint have
> > it's own *.ora writer, and generate the thumbnail inside the *.ora. Open
> > raster are open document with a subfolder for the thumbnails, so the
> > system
> > only copy the thumbnail in the cache if one is found, I think . (
> > certainly
> > to be faster ) , when no thumbnails are found, It rellies on Calligra ( On
> > Dolphin, I have to setup the 'calligra files' for the thumbnail preview ).
> 
> The icon blending is done by the thumbnail kio-slave (which is used by
> Dolphin and all other filesystem widgets and also the KIO::PreviewJob like
> used in KoRecentDocumentsPane), so outside of Calligra code.
> Whether the icon is blended or not is based on the flag returned by the
> thumbnail plugin. And the calligra thumbnail plugin is like this:
> 
> ThumbCreator::Flags CalligraCreator::flags() const
> {
>     if (m_doc && (m_doc->mimeType() == "image/openraster" ||
> m_doc->mimeType() == "application/x-krita")) {
>         return (Flags)(DrawFrame);
>     }
>     else {
>         return (Flags)(DrawFrame | BlendIcon);
>     }
> }
> 
> So all fine here.

Well... all fine... unless m_doc->mimeType() returns wrong data. Which it does 
for me (and then obviously for you as well).

"application/vnd.oasis.opendocument.graphics" for kra files, 
"application/vnd.oasis.opendocument.spreadsheet" for ora files (and other 
strings)

Something in
    m_doc = KMimeTypeTrader::self()->createPartInstanceFromQuery<KoDocument>( 
mimetype );
does funny things.

Investigating...

Cheers
Friedrich



More information about the calligra-devel mailing list