~ubuntu-sdk-team/ubuntu-ui-toolkit/armedFlakes

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Zsombor Egri, Christian Dywan
  • Date: 2016-02-02 18:54:21 UTC
  • mfrom: (1826.1.8 staging)
  • Revision ID: tarmac-20160202185421-jcaz8nu6w9wcpot1
Link singletons used as context properties in root context of the QML Engine to the engine instance. Fixes: https://bugs.launchpad.net/bugs/1539558.

Approved by ubuntu-sdk-build-bot, Zoltan Balogh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
{
206
206
    QString parentTheme;
207
207
    if (!themePath.isValid()) {
208
 
        qWarning() << qPrintable(UbuntuI18n::instance().tr("Theme not found: \"%1\"").arg(themePath.name));
 
208
        qWarning() << qPrintable(QStringLiteral("Theme not found: \"%1\"").arg(themePath.name));
209
209
    } else {
210
210
        QFile file(themePath.path.resolved(PARENT_THEME_FILE).toLocalFile());
211
211
        if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
373
373
    // set the default font
374
374
    QFont defaultFont = QGuiApplication::font();
375
375
    defaultFont.setFamily("Ubuntu");
376
 
    defaultFont.setPixelSize(UCFontUtils::instance().sizeToPixels("medium"));
 
376
    defaultFont.setPixelSize(UCFontUtils::instance()->sizeToPixels("medium"));
377
377
    defaultFont.setWeight(QFont::Light);
378
378
    QGuiApplication::setFont(defaultFont);
379
379
    setObjectName("default");
550
550
        return;
551
551
    }
552
552
    if (config && !QuickUtils::inherits(config, "Palette")) {
553
 
        qmlInfo(config) << UbuntuI18n::instance().tr("Not a Palette component.");
 
553
        qmlInfo(config) << QStringLiteral("Not a Palette component.");
554
554
        return;
555
555
    }
556
556
 
714
714
            }
715
715
        } else {
716
716
            qmlInfo(parent) <<
717
 
               UbuntuI18n::instance().tr(QString("Warning: Style %1 not found in theme %2").arg(styleName).arg(name()));
 
717
               QStringLiteral("Warning: Style %1 not found in theme %2").arg(styleName).arg(name());
718
718
        }
719
719
    }
720
720
 
735
735
    // theme may not have palette defined
736
736
    QUrl paletteUrl = styleUrl("Palette.qml", previousVersion ? previousVersion : LATEST_UITK_VERSION);
737
737
    if (paletteUrl.isValid()) {
738
 
        m_palette = QuickUtils::instance().createQmlObject(paletteUrl, engine);
 
738
        m_palette = QuickUtils::instance()->createQmlObject(paletteUrl, engine);
739
739
        if (m_palette) {
740
740
            m_palette->setParent(this);
741
741
        }