┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewcontainer.cpp
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <[email protected]>2026-01-09 16:16:48 +0100
committerMéven Car <[email protected]>2026-01-10 15:14:26 +0000
commit5fff1e414a060c0619a97ad8d3f5665e3f5a4878 (patch)
tree5ed5b7560ba22bf690f72c399d31490493b87ea3 /src/dolphinviewcontainer.cpp
parent3cea7599a110479071919e92d6c91959020c33df (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/dolphinviewcontainer.cpp')
-rw-r--r--src/dolphinviewcontainer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index f6fd01de2..fb83be453 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -284,10 +284,10 @@ DolphinView *DolphinViewContainer::view()
void DolphinViewContainer::connectUrlNavigator(DolphinUrlNavigator *urlNavigator)
{
- Q_CHECK_PTR(urlNavigator);
+ Q_ASSERT(urlNavigator);
Q_ASSERT(!m_urlNavigatorConnected);
Q_ASSERT(m_urlNavigator.get() != urlNavigator);
- Q_CHECK_PTR(m_view);
+ Q_ASSERT(m_view);
urlNavigator->setLocationUrl(m_view->url());
urlNavigator->setShowHiddenFolders(m_view->hiddenFilesShown());
@@ -413,8 +413,8 @@ void DolphinViewContainer::setSelectionModeEnabled(bool enabled, KActionCollecti
if (!wasEnabled) {
return; // nothing to do here
}
- Q_CHECK_PTR(m_selectionModeTopBar); // there is no point in disabling selectionMode when it wasn't even enabled once.
- Q_CHECK_PTR(m_selectionModeBottomBar);
+ Q_ASSERT(m_selectionModeTopBar); // there is no point in disabling selectionMode when it wasn't even enabled once.
+ Q_ASSERT(m_selectionModeBottomBar);
m_selectionModeTopBar->setVisible(false, WithAnimation);
m_selectionModeBottomBar->setVisible(false, WithAnimation);
Q_EMIT selectionModeChanged(false);