[prev in list] [next in list] [prev in thread] [next in thread]
List: kfm-devel
Subject: Re: KFileItemActions - why does it remember the actions it created, and deletes them?
From: Frank Reininghaus <frank78ac () googlemail ! com>
Date: 2014-01-04 13:51:52
Message-ID: CAFoZWWgdxfuPnyTyDG9HGUFoFdHePCZceeLwienpxDNzvzHfmQ () mail ! gmail ! com
[Download RAW message or body]
Hi David,
2013/12/30 David Faure:
> On Friday 13 December 2013 11:28:01 Frank Reininghaus wrote:
[...]
>> Still, I'm wondering if KFileItemActions should really delete all
>> actions it created, even if they belong to a widget that has been set
>> with setParentWidget(QWidget*). It works fine if KFileItemActions is
>> destroyed *before* the widget, because parent QObjects listen to the
>> 'destroyed' signal, but if the destruction order is different for some
>> reason, then we might get a crash because we try to delete dangling
>> pointers, right?
>
> Right.
>
> I think the parent for the actions should be the KFileItemActions instance
> instead. That would make all use cases happy, and follow the principle of
> least surprise, right?
yes, that sounds reasonable! Should we then remove the
void setParentWidget(QWidget *widget)
member in frameworks, or better make it a no-op and deprecate it in
order to not break source compatibility?
Regards,
Frank
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic