Code review comment for lp:~abreu-alexandre/webbrowser-app/fix1237548

Revision history for this message
Olivier Tilloy (osomon) wrote :

> If you look at the UriHandler code, as soon as the element is instanciated,
> the
> DBUS object is created and available. The predicate used to know if we are to
> create
> one or not is if in webapp mode but the flag is propagated only *after* the
> Browser
> element has been created (so not synchronously w/ the component's creation).

Yes, but the default value of the webapp property is false, so the UriHandler shouldn’t be instantiated when the Browser component is created.

> Hence the specific flag (false by default), which has been moved to
> webbrowser-app.qml
> since it does not make sense for it to be in browser.qml imo (and would
> require an
> extra unecessary alias just for the sake of reaching the property) which
> triggers
> the creation of the singleton UriHandler when set to true.

I think that a specific flag is not absolutely needed, still I think your proposal makes the code easier to read, so let’s go for it!

Note that the check "if ( ! webapp)" in the onOpened handler is not needed any longer, please remove it.

review: Needs Fixing

« Back to merge proposal