Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 451 Lines • ▼ Show 20 Line(s) | 451 | { | |||
---|---|---|---|---|---|
452 | m_tabWidget->readProperties(group); | 452 | m_tabWidget->readProperties(group); | ||
453 | } | 453 | } | ||
454 | 454 | | |||
455 | void DolphinMainWindow::updateNewMenu() | 455 | void DolphinMainWindow::updateNewMenu() | ||
456 | { | 456 | { | ||
457 | m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown()); | 457 | m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown()); | ||
458 | m_newFileMenu->checkUpToDate(); | 458 | m_newFileMenu->checkUpToDate(); | ||
459 | m_newFileMenu->setPopupFiles(activeViewContainer()->url()); | 459 | m_newFileMenu->setPopupFiles(activeViewContainer()->url()); | ||
460 | | ||||
461 | // If we're in the trash, also disable all the 'create new' items | ||||
462 | // TODO: remove this once https://phabricator.kde.org/T8234 is implemented | ||||
463 | slotWriteStateChanged(m_activeViewContainer->view()->url().scheme() != QLatin1String("trash")); | ||||
elvisangelaccio: This will detach the `actions()` container. Please use
```
const auto actions = m_newFileMenu… | |||||
460 | } | 464 | } | ||
461 | 465 | | |||
462 | void DolphinMainWindow::createDirectory() | 466 | void DolphinMainWindow::createDirectory() | ||
463 | { | 467 | { | ||
464 | m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown()); | 468 | m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown()); | ||
465 | m_newFileMenu->setPopupFiles(activeViewContainer()->url()); | 469 | m_newFileMenu->setPopupFiles(activeViewContainer()->url()); | ||
466 | m_newFileMenu->createDirectory(); | 470 | m_newFileMenu->createDirectory(); | ||
467 | } | 471 | } | ||
▲ Show 20 Lines • Show All 331 Lines • ▼ Show 20 Line(s) | 802 | if (entry.isDir()) { | |||
799 | activeViewContainer()->setUrl(url); | 803 | activeViewContainer()->setUrl(url); | ||
800 | } else { | 804 | } else { | ||
801 | new KRun(url, this); // Automatically deletes itself after being finished | 805 | new KRun(url, this); // Automatically deletes itself after being finished | ||
802 | } | 806 | } | ||
803 | } | 807 | } | ||
804 | 808 | | |||
805 | void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable) | 809 | void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable) | ||
806 | { | 810 | { | ||
807 | newFileMenu()->setEnabled(isFolderWritable); | 811 | qInfo() << "slotWriteStateChanged got called"; | ||
812 | const auto actions = m_newFileMenu->menu()->actions(); | ||||
813 | for (auto menuItem : actions) { | ||||
814 | menuItem->setEnabled(isFolderWritable); | ||||
815 | } | ||||
808 | } | 816 | } | ||
809 | 817 | | |||
810 | void DolphinMainWindow::openContextMenu(const QPoint& pos, | 818 | void DolphinMainWindow::openContextMenu(const QPoint& pos, | ||
811 | const KFileItem& item, | 819 | const KFileItem& item, | ||
812 | const QUrl& url, | 820 | const QUrl& url, | ||
813 | const QList<QAction*>& customActions) | 821 | const QList<QAction*>& customActions) | ||
814 | { | 822 | { | ||
815 | QPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, pos, item, url); | 823 | QPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, pos, item, url); | ||
▲ Show 20 Lines • Show All 802 Lines • Show Last 20 Lines |
This will detach the actions() container. Please use