• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

libkonq

Public Member Functions | List of all members
KonqMenuActions Class Reference

#include <konq_menuactions.h>

Public Member Functions

 KonqMenuActions ()
 
 ~KonqMenuActions ()
 
int addActionsTo (QMenu *menu)
 
void addOpenWithActionsTo (QMenu *menu, const QString &traderConstraint)
 
KAction * preferredOpenWithAction (const QString &traderConstraint)
 
void setItemListProperties (const KFileItemListProperties &itemList)
 
void setParentWidget (QWidget *widget)
 
KDE_DEPRECATED void setPopupMenuInfo (const KonqPopupMenuInformation &info)
 

Detailed Description

This class handles the user-defined actions for a url in a popupmenu.

User-defined actions include:

  • builtin services like mount/unmount for old-style device desktop files
  • user-defined actions for a .desktop file, defined in the file itself (see the desktop entry standard)
  • servicemenus actions, defined in .desktop files and selected based on the mimetype of the url

In addition it can also add "open with" actions.

Definition at line 42 of file konq_menuactions.h.

Constructor & Destructor Documentation

KonqMenuActions::KonqMenuActions ( )

Creates a KonqMenuActions instance.

Note that this instance must stay alive for at least as long as the popupmenu; it has the slots for the actions created by addActionsTo.

Definition at line 26 of file konq_menuactions.cpp.

KonqMenuActions::~KonqMenuActions ( )

Destructor.

Definition at line 32 of file konq_menuactions.cpp.

Member Function Documentation

int KonqMenuActions::addActionsTo ( QMenu *  menu)

Generate the user-defined actions and submenus, and adds them to the menu.

User-defined actions include:

  • builtin services like mount/unmount for old-style device desktop files
  • user-defined actions for a .desktop file, defined in the file itself (see the desktop entry standard)
  • servicemenus actions, defined in .desktop files and selected based on the mimetype of the url

When KFileItemListProperties::supportsWriting() is false, actions that modify the files are not shown. This is controlled by Require=Write in the servicemenu desktop files.

All actions are created as children of the menu.

Returns
the number of actions added

Definition at line 47 of file konq_menuactions.cpp.

void KonqMenuActions::addOpenWithActionsTo ( QMenu *  menu,
const QString &  traderConstraint 
)

Generate the "Open With <Application>" actions, and adds them to the menu.

All actions are created as children of the menu.

Parameters
menuthe QMenu where to add actions
traderConstraintthis constraint allows to exclude the current application from the "open with" list. Example: "DesktopEntryName != 'kfmclient'".

Definition at line 52 of file konq_menuactions.cpp.

KAction * KonqMenuActions::preferredOpenWithAction ( const QString &  traderConstraint)

Returns an action for the preferred app only.

Parameters
traderConstraintthis constraint allows to exclude the current application from the "open with" list. Example: "DesktopEntryName != 'kfmclient'".
Returns
the action - or 0 if no application was found.
Since
4.3 – TODO REMOVE AND PORT FOLDERVIEW

Definition at line 57 of file konq_menuactions.cpp.

void KonqMenuActions::setItemListProperties ( const KFileItemListProperties &  itemList)

Sets all the data for the next instance of the popupmenu.

See also
KFileItemListProperties
Since
4.3

Definition at line 42 of file konq_menuactions.cpp.

void KonqMenuActions::setParentWidget ( QWidget *  widget)

Set the parent widget for any dialogs being shown.

This should normally be your mainwindow, not a popup menu, so that it still exists even after the popup is closed (e.g. error message from KRun) and so that QAction::setStatusTip can find a statusbar, too.

Since
4.3

Definition at line 62 of file konq_menuactions.cpp.

void KonqMenuActions::setPopupMenuInfo ( const KonqPopupMenuInformation &  info)

Sets all the data for the next instance of the popupmenu.

See also
KonqPopupMenuInformation
Deprecated:
use setItemList+setParentWidget

Definition at line 37 of file konq_menuactions.cpp.


The documentation for this class was generated from the following files:
  • konq_menuactions.h
  • konq_menuactions.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkonq

Skip menu "libkonq"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Applications
  •   Libraries
  •     libkonq
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal