| 321 | } |
| 322 | |
| 323 | QWidget* ToolViewWidgetCache::remove(const Document* document) |
| 324 | { |
| 325 | Q_ASSERT(document); |
| 326 | |
| 327 | const auto it = m_widgets.constFind(document); |
| 328 | if (it == m_widgets.cend()) { |
| 329 | qCDebug(SUBLIME) << "no tool view widget to destroy for the removed tool view" << document->documentSpecifier(); |
| 330 | return nullptr; |
| 331 | } |
| 332 | qCDebug(SUBLIME).nospace() << "destroying the tool view widget for the removed tool view " |
| 333 | << document->documentSpecifier() << ", use count: " << it->useCount(); |
| 334 | |
| 335 | auto* const widget = it->widget(); |
| 336 | Q_ASSERT(widget); |
| 337 | m_widgets.erase(it); |
| 338 | return widget; |
| 339 | } |
| 340 | |
| 341 | class IdealToolBar : public QToolBar |
| 342 | { |
no test coverage detected