From 374d23093219bc49b66259564af7e4c9d5e3c5e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Mon, 13 Jan 2014 02:11:37 +0100 Subject: [PATCH] wallpaperForSize moves to Plasma::Theme --- src/declarativeimports/core/theme.cpp | 5 ----- src/declarativeimports/core/theme.h | 8 -------- src/plasma/theme.cpp | 5 +++++ src/plasma/theme.h | 5 +++++ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/declarativeimports/core/theme.cpp b/src/declarativeimports/core/theme.cpp index 284154db0..5ac53f35e 100644 --- a/src/declarativeimports/core/theme.cpp +++ b/src/declarativeimports/core/theme.cpp @@ -48,11 +48,6 @@ ThemeProxy::~ThemeProxy() { } -QString ThemeProxy::wallpaperPathForSize(int width, int height) const -{ - return Plasma::Theme::wallpaperPath(QSize(width, height)); -} - void ThemeProxy::iconLoaderSettingsChanged() { m_iconSizes->insert("desktop", QVariant(KIconLoader::global()->currentSize(KIconLoader::Desktop))); diff --git a/src/declarativeimports/core/theme.h b/src/declarativeimports/core/theme.h index 8c5841bc2..4c83d4b84 100644 --- a/src/declarativeimports/core/theme.h +++ b/src/declarativeimports/core/theme.h @@ -51,16 +51,10 @@ class ThemeProxy : public Plasma::Theme */ Q_PROPERTY(QQmlPropertyMap *iconSizes READ iconSizes NOTIFY iconSizesChanged) - // layout hints - Q_PROPERTY(int smallSpacing READ smallSpacing CONSTANT) - Q_PROPERTY(int largeSpacing READ largeSpacing CONSTANT) - public: ThemeProxy(QQmlEngine *parent = 0); ~ThemeProxy(); - Q_INVOKABLE QString wallpaperPathForSize(int width=-1, int height=-1) const; - QQmlPropertyMap *iconSizes() const; private Q_SLOTS: @@ -71,8 +65,6 @@ Q_SIGNALS: void iconSizesChanged(); private: - int m_smallSpacing; - int m_largeSpacing; QQmlPropertyMap *m_iconSizes; QQmlEngine *m_engine; }; diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp index 799d122ac..2a40e6d9d 100644 --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -256,6 +256,11 @@ QString Theme::wallpaperPath(const QSize &size) const return fullPath; } +QString Theme::wallpaperPathForSize(int width, int height) const +{ + return Plasma::Theme::wallpaperPath(QSize(width, height)); +} + bool Theme::currentThemeHasImage(const QString &name) const { if (name.contains("../")) { diff --git a/src/plasma/theme.h b/src/plasma/theme.h index b718232c8..07af1c937 100644 --- a/src/plasma/theme.h +++ b/src/plasma/theme.h @@ -90,6 +90,9 @@ class PLASMA_EXPORT Theme : public QObject Q_PROPERTY(int enormousIconSize READ enormousIconSize CONSTANT) Q_PROPERTY(int defaultIconSize READ defaultIconSize NOTIFY defaultIconSizeChanged) + // layout hints + Q_PROPERTY(int smallSpacing READ smallSpacing CONSTANT) + Q_PROPERTY(int largeSpacing READ largeSpacing CONSTANT) public: enum ColorRole { @@ -153,6 +156,8 @@ class PLASMA_EXPORT Theme : public QObject */ QString wallpaperPath(const QSize &size = QSize()) const; + Q_INVOKABLE QString wallpaperPathForSize(int width=-1, int height=-1) const; + /** * Checks if this theme has an image named in a certain way *