┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanelcontent.cpp
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2025-09-19 13:31:03 +0200
committerJean-Baptiste Mardelle <[email protected]>2025-11-20 10:13:25 +0100
commit580c31cccee1646db85bbf3a033911858bf79d7a (patch)
tree36d12f28f7e47ecb3634b3a3fab026e3d0a239c1 /src/panels/information/informationpanelcontent.cpp
parent15aa35dd3b01ee4320b9f565e044da5f8fdfb227 (diff)
informationpanel: prevent a crash when creating video preview panel and a media file is selected
To reproduce the crash: - Open Dolphin, disable information panel and close Dolphin - Re-open Dolphin - Select a video file - Enable information panel - Crash Problem is that some elements of the MediaWidget panel are created when the widget is shown, in `showEvent` (`m_seekSlider` and `m_topLayout`), and these elements are called before being created. This MR fixes 2 different crashes: - Crash creating panel when a video file is selected (call to `m_seekSlider` before its creation) - Crash creating panel when a video file is selected and autoplay enabled (call to `m_topLayout` before its creation)
Diffstat (limited to 'src/panels/information/informationpanelcontent.cpp')
-rw-r--r--src/panels/information/informationpanelcontent.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index afca9a76c..285ce3ae9 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -501,10 +501,8 @@ void InformationPanelContent::adjustWidgetSizes(int width)
// try to increase the preview as large as possible
m_preview->setSizeHint(QSize(maxWidth, maxWidth));
- if (m_mediaWidget->isVisible()) {
- // assure that the size of the video player is the same as the preview size
- m_mediaWidget->setVideoSize(QSize(maxWidth, maxWidth));
- }
+ // assure that the size of the video player is the same as the preview size
+ m_mediaWidget->setVideoSize(QSize(maxWidth, maxWidth));
}
#include "moc_informationpanelcontent.cpp"