[PATCH] KFileDialog overwrite confirmation

alessandro diaferia alediaferia at gmail.com
Sun Jul 13 11:12:51 BST 2008


2008/7/12 Rafael Fernández López <ereslibre at kde.org>:

> Hi,
>
> Some comments: (and why you can't compile it):
>
> - You added a method declaration to KAbstractFileWidget which hasn't got an
> implementation. On KFileDialog, w is declared on KFileDialogPrivate as a
> "KAbstractFileWidget* w;"; so you get a call to a non existant method body.
>
> - In case you add a body, we are screwed. Since this method is not virtual,
> and the pointer said before is a KAbstractFileWidget, I don't know if it
> will
> compile. However, if it does, always the KAbstractFileWidget implementation
> will be called.
>
> Notes:
>
> All new methods are lacking a "@since 4.2".
>
> Solutions:
>
> As I pointed you before on the C++ binary compatibility issues there are
> ways
> to "workaround" this. You can use signals and slots for making this "fake
> virtual", and add a very BIG warning to fix this for KDE 5.
>
> You can add a signal on the abstract class that will be emitted on the
> setConfirmOverwrite method from KAbstractFileWidget. Then on the other
> implementations, you can connect that signal to their own slots, so they
> provide a private implementation for such a reaction. You don't need to
> "rewrite" setConfirmOverwrite on the inherited classes, just connecting to
> the
> signal that KAbstractFileWidget exports. It is important from my POV to
> mark
> this signal as @internal.
>
>
> Regards,
> Rafael Fernández López.
>

Hi Rafael,
this is the first time for me with this workaround.
Btw KAbstractFileWidget does not inherit QObject so i can't make it emitting
signals. Can i make another class in the same files which emits the signal
when called from KAbstractFileWidget? Or there is something prettier to do
this?

Thanks for your help.

-- 
Alessandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080713/aec407f1/attachment.htm>


More information about the kde-core-devel mailing list