! Shows/hides docks depending on the current visibility policy. */
| 2313 | Shows/hides docks depending on the current visibility policy. |
| 2314 | */ |
| 2315 | void MainWin::updateDockWindowVisibility() const { |
| 2316 | auto windows = m_dockManagerContent->dockWidgetsMap(); |
| 2317 | switch (m_project->dockVisibility()) { |
| 2318 | case Project::DockVisibility::allDocks: |
| 2319 | for (auto* window : windows) |
| 2320 | window->toggleView(true); |
| 2321 | |
| 2322 | break; |
| 2323 | case Project::DockVisibility::folderOnly: |
| 2324 | for (auto* window : windows) { |
| 2325 | auto* view = dynamic_cast<ContentDockWidget*>(window); |
| 2326 | if (view) { |
| 2327 | bool visible = view->part()->folder() == m_currentFolder; |
| 2328 | window->toggleView(visible); |
| 2329 | } |
| 2330 | } |
| 2331 | break; |
| 2332 | case Project::DockVisibility::folderAndSubfolders: |
| 2333 | for (auto* window : windows) { |
| 2334 | auto* view = dynamic_cast<ContentDockWidget*>(window); |
| 2335 | if (view) { |
| 2336 | bool visible = view->part()->isDescendantOf(m_currentFolder); |
| 2337 | window->toggleView(visible); |
| 2338 | } |
| 2339 | } |
| 2340 | break; |
| 2341 | } |
| 2342 | } |
| 2343 | |
| 2344 | void MainWin::toggleDockWidget(QAction* action) { |
| 2345 | if (action->objectName() == QLatin1String("toggle_project_explorer_dock")) { |
nothing calls this directly
no test coverage detected