Export Plasma::Theme as theme, remove proxy class

The last bits have moved out of ThemeProxy, units is used for iconSizes,
which means we can finally directly use Plasma::Theme, and don't need a
ThemeProxy class anymore.
This commit is contained in:
Sebastian Kügler 2014-01-22 01:33:26 +01:00
parent 0c3e49866a
commit e81db11f05
3 changed files with 2 additions and 23 deletions

View File

@ -15,7 +15,6 @@ endif()
set(corebindings_SRCS
corebindingsplugin.cpp
theme.cpp
datamodel.cpp
datasource.cpp
dialogshadows.cpp

View File

@ -56,7 +56,7 @@ void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
QQmlContext *context = engine->rootContext();
ThemeProxy *theme = new ThemeProxy(engine);
Plasma::Theme *theme = new Plasma::Theme(engine);
context->setContextProperty("theme", theme);
if (!engine->rootContext()->contextObject()) {
@ -78,7 +78,7 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
qmlRegisterType<Plasma::FrameSvgItem>(uri, 2, 0, "FrameSvgItem");
//qmlRegisterType<ThemeProxy>(uri, 2, 0, "Theme");
qmlRegisterType<ThemeProxy>();
qmlRegisterType<Plasma::Theme>();
qmlRegisterType<Plasma::DataSource>(uri, 2, 0, "DataSource");
qmlRegisterType<Plasma::DataModel>(uri, 2, 0, "DataModel");

View File

@ -66,26 +66,6 @@ QQmlPropertyMap *ThemeProxy::iconSizes() const
return m_iconSizes;
}
int ThemeProxy::dpi(QQuickItem* item)
{
int _dpi = 1337;
qDebug() << " ----- dpi() ---- ";
if (item) {
QScreen* screen = item->window()->screen();
if (screen) {
qDebug() << "screen geo: " << screen->availableGeometry();
_dpi = screen->physicalDotsPerInch();
qDebug() << " refreshRate : " << screen->refreshRate();
qDebug() << " devicePixelRatio: " << screen->devicePixelRatio();
qDebug() << " depth : " << screen->depth();
qDebug() << " dpi X: " << screen->physicalDotsPerInchX();
qDebug() << " dpi Y: " << screen->physicalDotsPerInchY();
qDebug() << " ->> dpi: " << _dpi;
}
}
return _dpi;
}
#include "moc_theme.cpp"