mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-17 15:31:20 +00:00
Properly disable create_dir action in Trash
`isFolderWritable` is set in DolphinView::updateWritableState() according to KFileItemListProperties::supportsWriting(). However, `writing=true` does not imply `makedir=true`, in an ioslave's .protocol file. An example is the trash protocol. So we need to enable the `create_dir` action only if the protocol is actually able to create folders. CCBUG: 332463 REVIEW: 129712
This commit is contained in:
parent
c456c5d528
commit
24ed38d77f
|
@ -37,6 +37,7 @@
|
|||
#include <KSelectAction>
|
||||
#include <KToggleAction>
|
||||
#include <KPropertiesDialog>
|
||||
#include <KProtocolManager>
|
||||
#include <QIcon>
|
||||
|
||||
#include "dolphindebug.h"
|
||||
|
@ -486,7 +487,8 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown)
|
|||
|
||||
void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable)
|
||||
{
|
||||
m_actionCollection->action(QStringLiteral("create_dir"))->setEnabled(isFolderWritable);
|
||||
m_actionCollection->action(QStringLiteral("create_dir"))->setEnabled(isFolderWritable &&
|
||||
KProtocolManager::supportsMakeDir(currentView()->url()));
|
||||
}
|
||||
|
||||
KToggleAction* DolphinViewActionHandler::iconsModeAction()
|
||||
|
|
Loading…
Reference in a new issue