mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 08:51:24 +00:00
Less special handling for the trash can, i.e. show "Open With" and applicable servicemenus.
Added support for X-KDE-Protocol in servicemenus. Added support for X-KDE-Require in servicemenus (for now, only "Write" is supported). This should prevent trying to rotate images over HTTP or other readonly protocols :) Still to be done is checking for write permissions in the current dir though. svn path=/trunk/kdebase/libkonq/; revision=348769
This commit is contained in:
parent
ef239581e6
commit
07482556d8
|
@ -461,14 +461,6 @@ void KonqPopupMenu::setup(KonqPopupFlags kpf)
|
|||
|
||||
act = new KAction( i18n( "&Empty Trash Bin" ), 0, this, SLOT( slotPopupEmptyTrashBin() ), &m_ownActions, "empytrash" );
|
||||
addAction( act );
|
||||
if ( KPropertiesDialog::canDisplay( m_lstItems ) && (kpf & ShowProperties) )
|
||||
{
|
||||
act = new KAction( i18n( "&Properties" ), 0, this, SLOT( slotPopupProperties() ),
|
||||
&m_ownActions, "properties" );
|
||||
addAction( act );
|
||||
}
|
||||
m_factory->addClient( this );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -602,7 +594,7 @@ void KonqPopupMenu::setup(KonqPopupFlags kpf)
|
|||
(*list) = KDEDesktopMimeType::userDefinedServices( path, cfg, url.isLocalFile() );
|
||||
}
|
||||
|
||||
if ( !isCurrentTrash && !isIntoTrash && sReading )
|
||||
if ( sReading )
|
||||
{
|
||||
|
||||
// 2 - Look for "servicesmenus" bindings (konqueror-specific user-defined services)
|
||||
|
@ -652,6 +644,21 @@ void KonqPopupMenu::setup(KonqPopupFlags kpf)
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( cfg.hasKey( "X-KDE-Protocol" ) )
|
||||
{
|
||||
const QString protocol = cfg.readEntry( "X-KDE-Protocol" );
|
||||
if ( protocol != m_sViewURL.protocol() )
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( cfg.hasKey( "X-KDE-Require" ) )
|
||||
{
|
||||
const QStringList capabilities = cfg.readListEntry( "X-KDE-Require" );
|
||||
// TODO we should also check for writing permissions in the current directory
|
||||
if ( capabilities.contains( "Write" ) && !sWriting )
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( cfg.hasKey( "Actions" ) && cfg.hasKey( "ServiceTypes" ) )
|
||||
{
|
||||
QStringList types = cfg.readListEntry( "ServiceTypes" );
|
||||
|
|
Loading…
Reference in a new issue