]> cloud.milkyroute.net Git - dolphin.git/commit
generalviewsettingspage: Use qobject_cast instead of static_cast
authorAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 13 Nov 2024 09:41:45 +0000 (11:41 +0200)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 13 Nov 2024 09:42:25 +0000 (09:42 +0000)
commit4f0bb805d2c3dfdfc87c5000a6a3675da1d8b6c2
tree5460e93852d8103982eb51f1de754627186165b5
parent11403da5b36b5b8314e69b86cc88bcf6d7733bba
generalviewsettingspage: Use qobject_cast instead of static_cast

In generalViewSettingsPage, ActiveWindow is not necessarily a
mainWindow, which can cause dolphin to crash. For example when user
opens folder properties and then dolphin settings, this part thinks
the folder settings is mainWindow.

Instead of static_cast, use qobject_cast, since it will return nullptr
if the DolphinMainWindow is not found.

BUG:492741
src/settings/viewmodes/generalviewsettingspage.cpp