D17697: Fix the list of file types in Kig "Open File" dialog

Yuri Chornoivan noreply at phabricator.kde.org
Mon Dec 24 13:15:36 GMT 2018


yurchor added inline comments.

INLINE COMMENTS

> tcanabrava wrote in kig.cpp:221
> I find this to ve a repeated pattern in your code:
> 1 - QPointer<Something> = new QType()
> 2 - Does nothing that's required for a QPointer
> 3 - Explicitly delete the pointer.
> 
> You should use QPointer if you are unsure that the pointer will be pointing to something as you can check .isNull() , 
> if you need to delete the thing later, try to use QScopedPointer if you really *need* it to be on the heap
> if you don't need it to be on the heap, just add it to stack.
> This QFileDialog can be on the stack, I belive.

Alms for the poor... I'm not a professional system programmer (it's obvious from the code, I think).

This is the recommended approach to deal with such cases:

https://blogs.kde.org/node/3919

I just followed the pattern as you have observed.

I have tried to make it like this:

https://phabricator.kde.org/D17738

but it does not compile.

I tried to google "creating QObjects on the stack"  but it does not give some fast results. Can you recommend something to read about this?

REPOSITORY
  R331 Kig

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

To: yurchor, #kde_edu, pino, tcanabrava
Cc: tcanabrava, aacid, cfeck, pino, apol, kde-edu, narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20181224/0632ca6b/attachment.html>


More information about the kde-edu mailing list