diff options
| author | Friedrich W. H. Kossebau <[email protected]> | 2026-01-09 16:16:48 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-01-10 15:14:26 +0000 |
| commit | 5fff1e414a060c0619a97ad8d3f5665e3f5a4878 (patch) | |
| tree | 5ed5b7560ba22bf690f72c399d31490493b87ea3 /src/selectionmode/bottombarcontentscontainer.cpp | |
| parent | 3cea7599a110479071919e92d6c91959020c33df (diff) | |
Use Q_ASSERT instead of Q_CHECK_PTR for plain checks of pointer value
Q_CHECK_PTR (other than the name suggests) is intended only to check the
success of memory allocations.
Using it for any pointers instead can be misleading due to the
"Out of memory" log printed in case of hits.
Diffstat (limited to 'src/selectionmode/bottombarcontentscontainer.cpp')
| -rw-r--r-- | src/selectionmode/bottombarcontentscontainer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/selectionmode/bottombarcontentscontainer.cpp b/src/selectionmode/bottombarcontentscontainer.cpp index bb858b871..3f7e681dd 100644 --- a/src/selectionmode/bottombarcontentscontainer.cpp +++ b/src/selectionmode/bottombarcontentscontainer.cpp @@ -42,7 +42,7 @@ void BottomBarContentsContainer::resetContents(BottomBar::Contents contents) updateExplanatoryLabelVisibility(); }); - Q_CHECK_PTR(m_actionCollection); + Q_ASSERT(m_actionCollection); m_contents = contents; switch (contents) { case BottomBar::CopyContents: @@ -499,7 +499,7 @@ std::vector<QAction *> BottomBarContentsContainer::contextActionsFor(const KFile // We are going to add the actions from the right-click context menu for the selected items. auto *dolphinMainWindow = qobject_cast<DolphinMainWindow *>(window()); - Q_CHECK_PTR(dolphinMainWindow); + Q_ASSERT(dolphinMainWindow); if (!m_fileItemActions) { m_fileItemActions = new KFileItemActions(this); m_fileItemActions->setParentWidget(dolphinMainWindow); |
