[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.4/kdelibs/khtml
From:       Pascal Létourneau <pletourn () globetrotter ! net>
Date:       2005-05-12 18:25:40
Message-ID: 1115922340.559400.29067.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 412816 by pletourn:

Convert the pixmap to an image only when needed
BUG:105112


 M  +5 -5      branches/KDE/3.4/kdelibs/khtml/khtml_ext.cpp  


--- branches/KDE/3.4/kdelibs/khtml/khtml_ext.cpp #412815:412816
@@ -377,7 +377,7 @@
   KHTMLPart *m_khtml;
   KURL m_url;
   KURL m_imageURL;
-  QImage m_image;
+  QPixmap m_pixmap;
   QString m_suggestedFilename;
 };
 
@@ -530,7 +530,7 @@
       if(imageimpl) // should be true always.  right?
       {
         if(imageimpl->complete()) {
-	  d->m_image = imageimpl->currentImage();
+	  d->m_pixmap = imageimpl->currentPixmap();
 	}
       }
     }
@@ -544,10 +544,10 @@
 
 #ifndef QT_NO_MIMECLIPBOARD
     (new KAction( i18n( "Copy Image" ), 0, this, SLOT( slotCopyImage() ),   
-                 actionCollection(), "copyimage" \
))->setEnabled(!d->m_image.isNull()); +                 actionCollection(), \
"copyimage" ))->setEnabled(!d->m_pixmap.isNull());  #endif
     
-    if(d->m_image.isNull()) {    //fallback to image location if still loading the \
image.  this will always be true if ifdef QT_NO_MIMECLIPBOARD +    \
if(d->m_pixmap.isNull()) {    //fallback to image location if still loading the \
                image.  this will always be true if ifdef QT_NO_MIMECLIPBOARD
       new KAction( i18n( "Copy Image Location" ), 0, this, SLOT( \
slotCopyImageLocation() ),  actionCollection(), "copyimagelocation" );
     }
@@ -628,7 +628,7 @@
   lst.append( safeURL );
   KMultipleDrag *drag = new KMultipleDrag(d->m_khtml->view(), "Image");
 
-  drag->addDragObject( new QImageDrag(d->m_image) );
+  drag->addDragObject( new QImageDrag(d->m_pixmap.convertToImage()) );
   drag->addDragObject( new KURLDrag(lst, d->m_khtml->view(), "Image URL") );
 
   // Set it in both the mouse selection and in the clipboard


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic