as theme already reads the plasmarc file, use it to cache the tooltipdelay as well

This commit is contained in:
Aaron Seigo 2011-12-06 22:42:23 +01:00
parent d109b43101
commit 0abdaf646d
2 changed files with 16 additions and 1 deletions

View File

@ -183,6 +183,7 @@ public:
QHash<styles, QString> cachedStyleSheets;
QHash<QString, QString> discoveries;
QTimer *saveTimer;
int toolTipDelay;
#ifdef Q_WS_X11
EffectWatcher *effectWatcher;
@ -508,7 +509,11 @@ void ThemePrivate::settingsFileChanged(const QString &file)
void Theme::settingsChanged()
{
d->setThemeName(d->config().readEntry("name", ThemePrivate::defaultTheme), false);
KConfigGroup cg = d->config();
d->setThemeName(cg.readEntry("name", ThemePrivate::defaultTheme), false);
cg = KConfigGroup(cg.config(), "PlasmaToolTips");
d->toolTipDelay = cg.readEntry("Delay", qreal(0.7));
kDebug() << "delay for tooltips is ...." << d->toolTipDelay << "**************";
}
void Theme::setThemeName(const QString &themeName)
@ -1082,6 +1087,11 @@ KUrl Theme::homepage() const
return brandConfig.readEntry("homepage", KUrl("http://www.kde.org"));
}
int Theme::toolTipDelay() const
{
return d->toolTipDelay;
}
}
#include <theme.moc>

View File

@ -379,6 +379,11 @@ class PLASMA_EXPORT Theme : public QObject
*/
KUrl homepage() const;
/**
* @return the default tool tip delay; -1 means "no tooltips"
*/
int toolTipDelay() const;
Q_SIGNALS:
/**
* Emitted when the user changes the theme. SVGs should be reloaded at