Re: Question about async methods (related to tdf#158965 "Find Record: Similarities dialog won't appear")

2024-01-05 Thread Julien Nabet

Thank you Miklos for your feedback!

I've submitted this patch: https://gerrit.libreoffice.org/c/core/+/161664



Re: Question about async methods (related to tdf#158965 "Find Record: Similarities dialog won't appear")

2024-01-04 Thread Miklos Vajna
Hi Julien,

On Wed, Jan 03, 2024 at 02:01:51PM +0100, Julien Nabet  
wrote:
> I noticed several methods about async:
> 
> 1) from include/vcl/abstdlg.hxx:
> 
> StartExecuteAsync

I think this is the usual codepath for modal dialogs. Some uno command
decides to open a dialog, we call StartExecuteAsync() with a callback to
handle the dialog result and that handler will be executed at some stage
in the future, instead of right now.

> 2) from include/svtools/genericasyncunodialog.hxx
> 
> executedAsyncDialog which seems used only for PDF dialog
> 
> createAsyncDialog  used for PDF dialog but above all in startExecuteModal
> 
> startExecuteModal
> 
> runAsync
> 
> (perhaps I forgot some).
> 
> Is there some plan to unify them (or at least reduce the number of them) or
> each one has its useful role?

This looks like a special case for the situation when an import or
export action wants to show a dialog, as part of a synchronous filter()
API call. In this case you can't move the "rest of the code" to an async
callback, so that needs special handling. Luckily these dialogs are
rather rare.

I fear there is not much you can unify here. Perhaps it's useful to
document which one is the usual case and which one is some special
minority?

Regards,

Miklos


Question about async methods (related to tdf#158965 "Find Record: Similarities dialog won't appear")

2024-01-03 Thread Julien Nabet

Hello,

I noticed several methods about async:

1) from include/vcl/abstdlg.hxx:

StartExecuteAsync

2) from include/svtools/genericasyncunodialog.hxx

executedAsyncDialog which seems used only for PDF dialog

createAsyncDialog  used for PDF dialog but above all in startExecuteModal

startExecuteModal

runAsync

(perhaps I forgot some).

Is there some plan to unify them (or at least reduce the number of them) 
or each one has its useful role?


I mean noticing tdf#158965 (Find Record: Similarities dialog won't 
appear), I wanted to compare the way the other methods used async to 
understand what caused the assertion in tdf and noticed all these methods.


Julien