FEATURE: formalize how the homepage for branding purposes is gotten at via the theme.

(this has been a TODO in the code since 4.2!)

svn path=/trunk/KDE/kdelibs/; revision=1209505
This commit is contained in:
Aaron J. Seigo 2010-12-27 00:46:17 +00:00
parent b221146758
commit f41ce1601b
2 changed files with 14 additions and 0 deletions

View File

@ -1037,6 +1037,14 @@ void Theme::setCacheLimit(int kbytes)
}
}
KUrl Theme::homepage() const
{
const QString metadataPath(KStandardDirs::locate("data", QLatin1Literal("desktoptheme/") % d->themeName % QLatin1Literal("/metadata.desktop")));
KConfig metadata(metadataPath);
KConfigGroup brandConfig(&metadata, "Branding");
return brandConfig.readEntry("homepage", KUrl("http://www.kde.org"));
}
}
#include <theme.moc>

View File

@ -372,6 +372,12 @@ class PLASMA_EXPORT Theme : public QObject
*/
void releaseRectsCache(const QString &image);
/**
* @return the default homepage to use in conjunction with the branding svg content
* @since 4.7
*/
KUrl homepage() const;
Q_SIGNALS:
/**
* Emitted when the user changes the theme. SVGs should be reloaded at