~bzoltan/ubuntu-ui-toolkit/add_default_tools

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/plugin/uctheme.cpp

  • Committer: Tarmac
  • Author(s): Alberto Mardegan
  • Date: 2013-09-24 07:29:21 UTC
  • mfrom: (743.1.4 lp1221707)
  • Revision ID: tarmac-20130924072921-dfd0k68ml6p4lj51
Support re-attaching to a different QQuickView
  
Make the plugin correctly handle the case when the QQuickView is destroyed and
a new one is created: this is done by avoiding using static variables, and
instead binding the data to the QQmlEngine, QQmlContext or QWindow as
appropriate.
. Fixes: https://bugs.launchpad.net/bugs/1221707.

Approved by PS Jenkins bot, Zsombor Egri.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
    // register Theme
206
206
    context->setContextProperty("Theme", this);
207
207
 
208
 
    static ContextPropertyChangeListener themeChangeListener(context, "Theme");
 
208
    ContextPropertyChangeListener *themeChangeListener =
 
209
        new ContextPropertyChangeListener(context, "Theme");
209
210
    QObject::connect(this, SIGNAL(nameChanged()),
210
 
                     &themeChangeListener, SLOT(updateContextProperty()));
 
211
                     themeChangeListener, SLOT(updateContextProperty()));
211
212
}
212
213
 
213
214
void UCTheme::loadPalette()