applicationName ignored in pure QML apps importing Ubuntu.Web

Bug #1387754 reported by Olivier Tilloy
22
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Undecided
Olivier Tilloy
webbrowser-app
Fix Released
High
Olivier Tilloy
webbrowser-app (Ubuntu)
Fix Released
Undecided
Olivier Tilloy
webbrowser-app (Ubuntu RTM)
Fix Released
Undecided
Olivier Tilloy

Bug Description

The dataPath for webviews is set in the plugin’s initializeEngine() method, like so:

    QDir dataLocation(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
    engine->rootContext()->setContextProperty("dataLocation", dataLocation.absolutePath());

This works well if the application has a C++ wrapper that sets the application name before loading any QML, but it doesn’t work so well for pure QML applications that import Ubuntu.Web: at the point in time when they import the module, the app name most likely hasn’t been set yet, and as a result the generic name set by qmlscene is used, resulting in a dataPath that looks like "~/.local/share/Qt Project/QtQmlViewer".

We don’t want to force applications to ship a thin C++ wrapper just to work around this issue, so we will need to figure out a way to delay the setting of dataLocation until the webview is actually instantiated.

Related branches

Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.23+15.04.20141104.1-0ubuntu1

---------------
webbrowser-app (0.23+15.04.20141104.1-0ubuntu1) vivid; urgency=low

  [ Ubuntu daily release ]
  * New rebuild forced

  [ Riccardo Padovani ]
  * Added new upstream components to fit with design requests: multiple
    selection in History, standard swipe-to-delete. (LP: #1351167)

  [ Olivier Tilloy ]
  * Do not use a custom scheme to trigger the error page, this won’t
    work any longer as soon as oxide learns how to delegate unhandled
    schemes (see https://launchpad.net/bugs/1384460). (LP: #1384460)
  * Ensure that the 'dataLocation' context property is updated when the
    application name changes. (LP: #1387754)
  * Really honour the --fullscreen command-line switch. (LP: #1379766)
 -- Ubuntu daily release <email address hidden> Tue, 04 Nov 2014 15:22:49 +0000

Changed in webbrowser-app (Ubuntu):
status: New → Fix Released
Olivier Tilloy (osomon)
Changed in webbrowser-app:
status: In Progress → Fix Released
Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu RTM):
status: New → Confirmed
Changed in canonical-devices-system-image:
milestone: none → ww05-2015
status: New → Fix Released
Olivier Tilloy (osomon)
Changed in canonical-devices-system-image:
assignee: nobody → Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu RTM):
assignee: nobody → Olivier Tilloy (osomon)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.