Bug 65553 - funny bug: dragging an attachment icon to desktop copies icon!
Summary: funny bug: dragging an attachment icon to desktop copies icon!
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml event (show other bugs)
Version: SVN
Platform: unspecified Linux
: NOR grave
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 68185 69419 77275 80216 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-05 19:36 UTC by Wilbert Berendsen
Modified: 2004-04-23 19:08 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch-71162.diff (2.37 KB, text/x-diff)
2004-03-16 23:36 UTC, Dawit Alemayehu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wilbert Berendsen 2003-10-05 19:36:29 UTC
Version:           1.5.9 (using KDE 3.1.92 (alpha2, CVS >= 20030921), compiled sources)
Compiler:          gcc version 3.2.1
OS:          Linux (i686) release 2.4.22-ck2

I dragged a .po attachment to the desktop from KMail and selected Copy Here. It created a png file with the name gettext.png!
I must drag the attachment file_name_, not the icon, to get the attachment copied to the desktop.
Comment 1 Ingo Klöcker 2003-11-14 10:09:49 UTC
*** Bug 68185 has been marked as a duplicate of this bug. ***
Comment 2 Ingo Klöcker 2003-11-14 11:15:07 UTC
That's a great new feature of KHTML. I don't think we (the KMail developers) can do anything about it. Reassigning to the guys who implemented this new feature without thinking about the consequences (or maybe they did but just forgot to tell us what we have to change).

BTW, this isn't specific to .po files but applies to all attachments which are shown as icon in KMail.
Comment 3 Waldo Bastian 2003-11-28 14:46:56 UTC
Raising severity, blocking bug for 3.2, regression.

Selecting the icon of KMail attachments drags the icon (the image that is shown) but not the attachment itself (the URL associated with the icon).
Comment 4 George Staikos 2003-11-28 14:51:20 UTC
Subject: Re:  funny bug: dragging an attachment icon to desktop copies icon!

On Friday 28 November 2003 08:46, Waldo Bastian wrote:
> Raising severity, blocking bug for 3.2, regression.
>
> Selecting the icon of KMail attachments drags the icon (the image that is
> shown) but not the attachment itself (the URL associated with the icon).

  I've seen this too, and I think my report about it was closed.  Are you 
using load-on-demand imap?

Comment 5 Wilbert Berendsen 2003-11-28 15:42:09 UTC
I didn't use IMAP (when I reported the bug), just local mail folders.
Comment 6 Ingo Klöcker 2003-12-01 14:44:56 UTC
*** Bug 69419 has been marked as a duplicate of this bug. ***
Comment 7 Ingo Klöcker 2003-12-03 10:22:52 UTC
*** Bug 69540 has been marked as a duplicate of this bug. ***
Comment 8 J E Drews 2003-12-04 06:01:34 UTC
Hello Ingo: 
 
 No it happens no matter where I click on the attachment. I tried clicking on the text and clicking on the mime symbol. In both cases the result of the drag and drop is still "unknown.png". 
 
Comment 9 Till Adam 2003-12-07 19:46:08 UTC
*** Bug 69540 has been marked as a duplicate of this bug. ***
Comment 10 Wilbert Berendsen 2004-02-06 11:22:27 UTC
Still there in KDE 3.2.0

When I drag the icon from KMail, I get a PNG image.
When I drag the filename, I get the attachment.

I think this is a very severe bug.

Think of a user who drags an attachment to his/her desktop, thinks it's OK, and then deletes the message and closes KMail, only to discover that the nice looking icon (which looks the same if previews are turned on!) is only a little PNG file, and that the original attachment is lost!
Comment 11 J E Drews 2004-02-07 01:37:19 UTC
> That's a great new feature of KHTML. I don't think we (the KMail developers) can > do anything about it.

The KHTML changes  are a great new feature but they break things?  THEN WHY THE HELL DID YOU SHIP IT!
Comment 12 Maksim Orlovich 2004-03-11 16:51:13 UTC
*** Bug 77275 has been marked as a duplicate of this bug. ***
Comment 13 Michael Brug 2004-03-14 18:10:12 UTC
In KDE 3.2.1 I can drag the icon and get an (unwanted) png image on the desktop. I cannot drag the filename anymore to the desktop (worked in 3.2). 

The behavior is the same, when I try to drag an attachment to a new message.

So unless I missed something the functionality is completely broken now.
Comment 14 Wilbert Berendsen 2004-03-14 20:47:24 UTC
This is caused by this KHTML bug #71162, which really needs fixing, because the behaviour of dragging the image, while the link the image links to should be dragged/pasted.
Comment 15 Dawit Alemayehu 2004-03-16 23:36:26 UTC
Hi,

The attached patch is intended to address the regression with dragging links 
and images as described in these reports. Please test...



Created an attachment (id=5247)
patch-71162.diff
Comment 16 David Baron 2004-03-17 08:14:40 UTC
I am not working from source but installed from SID.

On Tuesday 16 March 2004 23:36, Dawit Alemayehu wrote:
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>
> http://bugs.kde.org/show_bug.cgi?id=65553
>
>
>
>
> ------- Additional Comments From adawit kde org  2004-03-16 23:36 -------
> Hi,
>
> The attached patch is intended to address the regression with dragging
> links and images as described in these reports. Please test...
>
>
>
> Created an attachment (id=5247)
>  --> (http://bugs.kde.org/attachment.cgi?id=5247&action=view)
> patch-71162.diff

Comment 17 Dawit Alemayehu 2004-03-17 14:17:35 UTC
CVS commit by adawit: 

Backport:
- Regression fix for BR# 71162 & BR# 65553.
- Set the suggested filename if available when prompting user to save files.

CCMAIL: 71162-done@bugs.kde.org
CCMAIL: 65553-done@bugs.kde.org


  M +19 -17    khtml_part.cpp   1.959.2.9


--- kdelibs/khtml/khtml_part.cpp  #1.959.2.8:1.959.2.9
@@ -3777,9 +3777,13 @@ bool KHTMLPart::processObjectRequest( kh
     if ( child->m_type != khtml::ChildFrame::Object )
     {
+      QString suggestedFilename;
+      if ( child->m_run )
+        suggestedFilename = child->m_run->suggestedFilename();
+
       KParts::BrowserRun::AskSaveResult res = KParts::BrowserRun::askEmbedOrSave(
-        url, mimetype/*, suggestedFilename */ );
+        url, mimetype, suggestedFilename  );
       switch( res ) {
       case KParts::BrowserRun::Save:
-        KHTMLPopupGUIClient::saveURL( widget(), i18n( "Save As" ), url, child->m_args.metaData(), QString::null, 0 /*, suggestedFilename */ );
+        KHTMLPopupGUIClient::saveURL( widget(), i18n( "Save As" ), url, child->m_args.metaData(), QString::null, 0, suggestedFilename);
         // fall-through
       case KParts::BrowserRun::Cancel:
@@ -5364,4 +5368,9 @@ void KHTMLPart::khtmlMouseMoveEvent( kht
     d->m_bRightMousePressed = false;
   }
+
+  DOM::DOMString url = event->url();
+  DOM::DOMString target = event->target();
+  DOM::Node innerNode = event->innerNode();
+
 #ifndef QT_NO_DRAGANDDROP
   if( d->m_bDnd && d->m_bMousePressed &&
@@ -5375,21 +5384,18 @@ void KHTMLPart::khtmlMouseMoveEvent( kht
     QDragObject *drag = 0;
     KURL u;
-    if ( d->m_mousePressNode.handle() && d->m_mousePressNode.handle()->id() == ID_IMG )
+
+    // qDebug("****************** Event URL: %s", url.string().latin1());
+    // qDebug("****************** Event Target: %s", target.string().latin1());
+
+    // Normal image...
+    if ( url.length() == 0 && innerNode.handle() && innerNode.handle()->id() == ID_IMG )
     {
-      // Normal image
-      img = static_cast<HTMLImageElementImpl *>(d->m_mousePressNode.handle());
+      img = static_cast<HTMLImageElementImpl *>(innerNode.handle());
       u = KURL( completeURL( khtml::parseURL(img->getAttribute(ATTR_SRC)).string() ) );
       pix = KMimeType::mimeType("image/png")->pixmap(KIcon::Desktop);
     }
-    else if ( event->innerNode().handle() && event->innerNode().handle()->id() == ID_IMG )
-    {
-      // Image inside a link?
-      img = static_cast<HTMLImageElementImpl *>(event->innerNode().handle());
-      u = completeURL( d->m_strSelectedURL );
-      pix = KMimeType::mimeType("image/png")->pixmap(KIcon::Desktop);
-    }
     else
     {
-      // Text link
+      // Text or image link...
       u = completeURL( d->m_strSelectedURL );
       pix = KMimeType::pixmapForURL(u, 0, KIcon::Desktop, KIcon::SizeMedium);
@@ -5423,8 +5429,4 @@ void KHTMLPart::khtmlMouseMoveEvent( kht
 #endif
 
-  DOM::DOMString url = event->url();
-  DOM::DOMString target = event->target();
-  DOM::Node innerNode = event->innerNode();
-
   // Not clicked -> mouse over stuff
   if ( !d->m_bMousePressed )


Comment 18 Maksim Orlovich 2004-04-23 19:08:49 UTC
*** Bug 80216 has been marked as a duplicate of this bug. ***