D20532: Proof of Concept: Add double click actions to empty space in the folder view

Anthony Fieroni noreply at phabricator.kde.org
Thu Aug 8 06:56:48 BST 2019


anthonyfieroni added inline comments.

INLINE COMMENTS

> fbg13 wrote in kitemlistcontroller.cpp:818
>   DolphinMainWindow *mainWindow = dynamic_cast<DolphinMainWindow *>(QApplication::activeWindow());
>   DolphinMainWindow *mainWindow = qobject_cast<DolphinMainWindow *>(QApplication::activeWindow());
> 
> The above don't work. But these do:
> 
>   DolphinMainWindow *mainWindow = static_cast<DolphinMainWindow *>(QApplication::activeWindow());
>   KXmlGuiWindow *mainWindow = qobject_cast<KXmlGuiWindow *>(QApplication::activeWindow());
> 
> Which should I use?

static_cast we know what the type of main window is, there is no need of dynamic dispatch.

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D20532

To: fbg13, #dolphin, elvisangelaccio, #vdg, ngraham
Cc: anthonyfieroni, kneckermcknacksack, ngraham, kfm-devel, aprcela, vmarinescu, fprice, fbampaloukas, alexde, feverfew, meven, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190808/4440659f/attachment.htm>


More information about the kfm-devel mailing list