~zsombi/ubuntu-ui-toolkit/03-styleditem-styleset

« back to all changes in this revision

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

  • Committer: Zsombor Egri
  • Date: 2015-03-12 20:52:56 UTC
  • mfrom: (1434.1.17 02-styleset)
  • Revision ID: zsombor.egri@canonical.com-20150312205256-j40z8x4ahlju4rtn
prereq sync, StyleSet renamed to theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
 
19
19
#include "ucdeprecatedtheme.h"
20
 
#include "ucstyleset.h"
 
20
#include "uctheme.h"
21
21
#include "listener.h"
22
22
#include <QtQml/QQmlComponent>
23
23
#include <QtQml/QQmlContext>
25
25
 
26
26
/*!
27
27
    \qmltype Theme
28
 
    \instantiates UCStyleSet
 
28
    \instantiates UCTheme
29
29
    \inqmlmodule Ubuntu.Components 1.1
30
30
    \ingroup theming
31
31
    \brief The Theme class provides facilities to interact with the current theme.
64
64
UCDeprecatedTheme::UCDeprecatedTheme(QObject *parent)
65
65
    : QObject(parent)
66
66
{
67
 
    connect(&UCStyleSet::defaultSet(), &UCStyleSet::nameChanged,
 
67
    connect(&UCTheme::defaultTheme(), &UCTheme::nameChanged,
68
68
            this, &UCDeprecatedTheme::nameChanged);
69
 
    connect(&UCStyleSet::defaultSet(), &UCStyleSet::paletteChanged,
 
69
    connect(&UCTheme::defaultTheme(), &UCTheme::paletteChanged,
70
70
            this, &UCDeprecatedTheme::paletteChanged);
71
71
}
72
72
 
77
77
*/
78
78
QString UCDeprecatedTheme::name() const
79
79
{
80
 
    return UCStyleSet::defaultSet().name();
 
80
    return UCTheme::defaultTheme().name();
81
81
}
82
82
void UCDeprecatedTheme::setName(const QString& name)
83
83
{
84
 
    UCStyleSet::defaultSet().setName(name);
 
84
    UCTheme::defaultTheme().setName(name);
85
85
}
86
86
void UCDeprecatedTheme::resetName()
87
87
{
88
 
    UCStyleSet::defaultSet().resetName();
 
88
    UCTheme::defaultTheme().resetName();
89
89
}
90
90
 
91
91
/*!
95
95
*/
96
96
QObject* UCDeprecatedTheme::palette()
97
97
{
98
 
    return UCStyleSet::defaultSet().palette();
 
98
    return UCTheme::defaultTheme().palette();
99
99
}
100
100
 
101
101
/*!
105
105
*/
106
106
QQmlComponent* UCDeprecatedTheme::createStyleComponent(const QString& styleName, QObject* parent)
107
107
{
108
 
    return UCStyleSet::defaultSet().createStyleComponent(styleName, parent);
 
108
    return UCTheme::defaultTheme().createStyleComponent(styleName, parent);
109
109
}
110
110
 
111
111
void UCDeprecatedTheme::registerToContext(QQmlContext* context)
112
112
{
113
 
    UCStyleSet::defaultSet().m_engine = context->engine();
114
 
    UCStyleSet::defaultSet().updateEnginePaths();
 
113
    UCTheme::defaultTheme().m_engine = context->engine();
 
114
    UCTheme::defaultTheme().updateEnginePaths();
115
115
    // register deprecated Theme property
116
116
    context->setContextProperty("Theme", this);
117
117