Konqueror RMB popup menu & khtml referrer

David Faure dfaure at trolltech.com
Mon Aug 11 11:57:13 BST 2003


On Sunday 10 August 2003 16:53, Waldo Bastian wrote:
> Hi David,
> 
> I have a problem with konqie's popup menu. There are several actions that
> operate on the selected URL, such as "Open in New Window" and for those to
> work correctly, the referrer must be set correctly. Konqueror doesn't know
> how to do that, it only knows about the URL of the part as a whole, but it
> doesn't know about frames that may influence the referrer. So khtml should
> tell konqueror about the refererrer.

This could be accessible via a property of the part....

> I have made a patch that makes it possible to attach the referrer to a KFileItem. 
I don't like this idea very much. KFileItems tend to be created in very large number,
and when listing /usr we really don't need a referrer per item (ok an empty QString
is only 4 bytes, but still...). I feel that KFileItem is much too low-level for this kind
of information.

> now everything works great except that void KonqMainWindow::slotPopupMenu(...)
> sets "bool showPropsAndFileType" depending on the function signature that was
> used.
Hmm, yeah, the problem of a generic framework which wants to adapt
popup menus to the kind of part requesting the popupmenu....

> Any ideas how to set showPropsAndFileType based on something else?
Can I suggest to rewind a little bit on the possible solutions?

We have 4 variants of the popupMenu signal already... I feel that this should
have been done with a struct as parameter instead, like we did with URLArgs.
What about adding a 5th popupMenu signal, with a struct as param? In fact
we could even use URLArgs for this, AFAICS, since opening the url which the
popup menu is about, is just like a openURL call - we need all the URLArgs data,
including all the metadata etc.

So I'd suggest
  void popupMenu( KXMLGUIClient *client,
                  const QPoint &global, const KURL &url,
                  const URLArgs& args, mode_t mode = (mode_t)-1 );

(Note that the URLArgs ship the mimetype already, in the "serviceType" member).

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list