replace homepage() with pluginInfo()

a KPluginInfo will have the homepage from the desktop file but also the other data as well such as author and description
This commit is contained in:
Marco Martin 2013-03-11 18:01:22 +01:00
parent ae120ba02d
commit b7a079f87d
4 changed files with 9 additions and 16 deletions

View File

@ -73,11 +73,6 @@ QSizeF ThemeProxy::mSize(const QFont &font) const
} }
KUrl ThemeProxy::homepage() const
{
return Plasma::Theme::defaultTheme()->homepage();
}
bool ThemeProxy::useGlobalSettings() const bool ThemeProxy::useGlobalSettings() const
{ {
return Plasma::Theme::defaultTheme()->useGlobalSettings(); return Plasma::Theme::defaultTheme()->useGlobalSettings();

View File

@ -40,7 +40,6 @@ class ThemeProxy : public QObject
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString themeName READ themeName NOTIFY themeChanged) Q_PROPERTY(QString themeName READ themeName NOTIFY themeChanged)
Q_PROPERTY(KUrl homepage READ homepage NOTIFY themeChanged)
Q_PROPERTY(bool useGlobalSettings READ useGlobalSettings NOTIFY themeChanged) Q_PROPERTY(bool useGlobalSettings READ useGlobalSettings NOTIFY themeChanged)
Q_PROPERTY(QString wallpaperPath READ wallpaperPath NOTIFY themeChanged) Q_PROPERTY(QString wallpaperPath READ wallpaperPath NOTIFY themeChanged)
@ -97,7 +96,6 @@ public:
*/ */
Q_INVOKABLE QSizeF mSize(const QFont &font = QApplication::font()) const; Q_INVOKABLE QSizeF mSize(const QFont &font = QApplication::font()) const;
KUrl homepage() const;
bool useGlobalSettings() const; bool useGlobalSettings() const;
QString wallpaperPath() const; QString wallpaperPath() const;
Q_INVOKABLE QString wallpaperPathForSize(int width=-1, int height=-1) const; Q_INVOKABLE QString wallpaperPathForSize(int width=-1, int height=-1) const;

View File

@ -85,8 +85,8 @@ public:
defaultWallpaperSuffix(DEFAULT_WALLPAPER_SUFFIX), defaultWallpaperSuffix(DEFAULT_WALLPAPER_SUFFIX),
defaultWallpaperWidth(DEFAULT_WALLPAPER_WIDTH), defaultWallpaperWidth(DEFAULT_WALLPAPER_WIDTH),
defaultWallpaperHeight(DEFAULT_WALLPAPER_HEIGHT), defaultWallpaperHeight(DEFAULT_WALLPAPER_HEIGHT),
cacheSize(0),
pixmapCache(0), pixmapCache(0),
cacheSize(0),
cachesToDiscard(NoCache), cachesToDiscard(NoCache),
locolor(false), locolor(false),
compositingActive(KWindowSystem::self()->compositingActive()), compositingActive(KWindowSystem::self()->compositingActive()),
@ -173,6 +173,7 @@ public:
Theme *q; Theme *q;
QString themeName; QString themeName;
KPluginInfo pluginInfo;
QList<QString> fallbackThemes; QList<QString> fallbackThemes;
KSharedConfigPtr colors; KSharedConfigPtr colors;
KColorScheme colorScheme; KColorScheme colorScheme;
@ -597,6 +598,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
if (realTheme) { if (realTheme) {
const QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/metadata.desktop"))); const QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % theme % QLatin1Literal("/metadata.desktop")));
KConfig metadata(metadataPath); KConfig metadata(metadataPath);
pluginInfo = KPluginInfo(metadataPath);
processWallpaperSettings(&metadata); processWallpaperSettings(&metadata);
@ -997,12 +999,9 @@ void Theme::setCacheLimit(int kbytes)
d->pixmapCache = 0; d->pixmapCache = 0;
} }
QUrl Theme::homepage() const KPluginInfo Theme::pluginInfo() const
{ {
const QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal("desktoptheme/") % d->themeName % QLatin1Literal("/metadata.desktop"))); return d->pluginInfo;
KConfig metadata(metadataPath);
KConfigGroup brandConfig(&metadata, "Branding");
return brandConfig.readEntry("homepage", QUrl("http://www.kde.org"));
} }
} }

View File

@ -304,10 +304,11 @@ class PLASMA_EXPORT Theme : public QObject
void releaseRectsCache(const QString &image); void releaseRectsCache(const QString &image);
/** /**
* @return the default homepage to use in conjunction with the branding svg content * @return plugin info for this theme, with informations such as
* @since 4.7 * name, description, author, website etc
* @since 5.0
*/ */
QUrl homepage() const; KPluginInfo pluginInfo() const;
Q_SIGNALS: Q_SIGNALS:
/** /**