Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinviewactionhandler.cpp
Show First 20 Lines • Show All 478 Lines • ▼ Show 20 Line(s) | 470 | { | |||
---|---|---|---|---|---|
479 | 479 | | |||
480 | showHiddenFilesAction->setIcon(QIcon::fromTheme(shown ? QStringLiteral("visibility") : QStringLiteral("hint"))); | 480 | showHiddenFilesAction->setIcon(QIcon::fromTheme(shown ? QStringLiteral("visibility") : QStringLiteral("hint"))); | ||
481 | } | 481 | } | ||
482 | 482 | | |||
483 | void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable) | 483 | void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable) | ||
484 | { | 484 | { | ||
485 | m_actionCollection->action(QStringLiteral("create_dir"))->setEnabled(isFolderWritable && | 485 | m_actionCollection->action(QStringLiteral("create_dir"))->setEnabled(isFolderWritable && | ||
486 | KProtocolManager::supportsMakeDir(currentView()->url())); | 486 | KProtocolManager::supportsMakeDir(currentView()->url())); | ||
487 | m_actionCollection->action(QStringLiteral("new_menu"))->setEnabled( | ||||
488 | isFolderWritable && KProtocolManager::supportsMakeDir(currentView()->url())); | ||||
elvisangelaccio: In theory an ioslave could support creating new files but not new folders, so this is wrong. | |||||
What's the purpose to create new files in the trash at all? rominf: > In theory an ioslave could support creating new files but not new folders, so this is wrong… | |||||
487 | } | 489 | } | ||
488 | 490 | | |||
489 | KToggleAction* DolphinViewActionHandler::iconsModeAction() | 491 | KToggleAction* DolphinViewActionHandler::iconsModeAction() | ||
490 | { | 492 | { | ||
491 | KToggleAction* iconsView = m_actionCollection->add<KToggleAction>(QStringLiteral("icons")); | 493 | KToggleAction* iconsView = m_actionCollection->add<KToggleAction>(QStringLiteral("icons")); | ||
492 | iconsView->setText(i18nc("@action:inmenu View Mode", "Icons")); | 494 | iconsView->setText(i18nc("@action:inmenu View Mode", "Icons")); | ||
493 | iconsView->setToolTip(i18nc("@info", "Icons view mode")); | 495 | iconsView->setToolTip(i18nc("@info", "Icons view mode")); | ||
494 | m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL + Qt::Key_1); | 496 | m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL + Qt::Key_1); | ||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |
In theory an ioslave could support creating new files but not new folders, so this is wrong.
As I said, this problem should be addressed in KNewFileMenu.
The short-term workaround is to check whether the url is a trash:/ url. The proper fix would be to implement what was discussed here: https://git.reviewboard.kde.org/r/129741/