[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-frameworks-devel
Subject:    Re: Future of KParts::SelectorInterface
From:       David Faure <faure () kde ! org>
Date:       2023-06-27 13:54:46
Message-ID: 1786380.VUm5iCBZcv () asterixp15
[Download RAW message or body]

On mercredi 14 juin 2023 12:38:24 CEST Stefano Crocco wrote:
> Hello to everyone,
> working on fixing the Akgregator plugin for Konqueror, I realized that
> WebEnginePart didn't correctly implement the KParts::SelectorInterface API
> (it behaved as if no element was found). Unfortunately, that API is
> synchronous, while QtWebEngine only allows to run javascript code (needed
> to access the page content) asynchronously.
> 
> I tried to make the javascript calls synchronous by using an event loop, but
> it didn't work. In the end, I decided to create a new interface, which
> provides an API closely following that of KParts::SelectorInterface but
> which is asynchronous and to have the plugin support both interfaces (see
> MR https://invent.kde.org/network/konqueror/-/merge_requests/189).
> 
> According to LXR (https://lxr.kde.org/ident?v=kf5-qt5&_i=SelectorInterface),
> currently the only parts implementing KParts::SelectorInterface are KHTML
> and KWebKitPart, which, if I'm not mistaken, are both being removed in KF6,
> and WebEnginePart which, as I said, doesn't really implement it. This means
> that in KF6 there'll be no part actually implementing this interface.
> 
> In my opinion, it would be a good idea to merge the asynchronous API I
> created in the KParts::SelectorInterface, keeping the original one in case
> either someone finds out how to implement it in WebEnginePart or another
> part to display HTML pages is created and it can implement the synchronous
> API.
> 
> What do you think?

I'd say, just get rid of the synchronous interface for KF6.

It's easy to implement async on top of sync (in case a future part can do it 
sync), and if you're porting the callers to async anyway, you're all set.

-- 
David Faure, faure@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic