Bug 328816

Summary: New Function: Bitmaps in Editor as visible Picture
Product: [Applications] kmail2 Reporter: Martin Brugger <martin.brugger>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: wishlist CC: montel
Priority: NOR    
Version: 4.11.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Martin Brugger 2013-12-14 22:30:18 UTC
Its a wish! 
I want to insert Bitmaps into the Emaileditor. Not as Attachment!

Reproducible: Always
Comment 1 Laurent Montel 2013-12-15 06:12:16 UTC
Html mode -> insert image -> bmp ?
Comment 2 Martin Brugger 2013-12-24 15:12:59 UTC
Thanks I found it.
A wish from me is:
If i do with drag and drop a Picture into Emaileditor that i become a menu with a third option that do the same funktion as Html mode -> insert image -> bmp.

Best Regards
Martin
Comment 3 Laurent Montel 2014-01-25 10:13:59 UTC
Ok just in html mode.
Will investigate it.
It's a good idea.
Comment 4 Laurent Montel 2014-01-25 10:51:50 UTC
  // If this is a PNG image, either add it as an attachment or as an inline image
    qDebug()<<" source->format()"<<source->formats();
  if ( source->hasImage() && source->hasFormat( QLatin1String("image/png") ) ) {
    // Get the image data before showing the dialog, since that processes events which can delete
    // the QMimeData object behind our back
    const QByteArray imageData = source->data( QLatin1String("image/png") );
    if ( imageData.isEmpty() ) {
       return true;
    }
    if ( !forceAttachment ) {
      if ( mComposerBase->editor()->textMode() == KRichTextEdit::Rich && mComposerBase->editor()->isEnableImageActions() ) {
        QImage image = qvariant_cast<QImage>( source->imageData() );
        QFileInfo fi( source->text() );

We have a code in kmail but any program send QMimeData as png or other.
They send as url.
So kmail can but I don't know a program which send as image.
a dnd is just a url not a data.

when you make 'copy' on a image in firefox for example you can paste and menu will ask you if you want to insert image
but dnd can't .