Merge changes Ibb130779,I68521f90,Ica6ba027
* changes: Reparse settings when they change Use a shared config in tooltip Save SVGs only when a theme is unloaded, not on each theme proxy
This commit is contained in:
commit
2afeb22f42
@ -49,7 +49,7 @@ ToolTip::ToolTip(QQuickItem *parent)
|
||||
m_showTimer->setSingleShot(true);
|
||||
connect(m_showTimer, &QTimer::timeout, this, &ToolTip::showToolTip);
|
||||
|
||||
settingsChanged();
|
||||
loadSettings();
|
||||
|
||||
const QString configFile = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + "plasmarc";
|
||||
KDirWatch::self()->addFile(configFile);
|
||||
@ -71,10 +71,13 @@ ToolTip::~ToolTip()
|
||||
|
||||
void ToolTip::settingsChanged()
|
||||
{
|
||||
KConfig config("plasmarc");
|
||||
KConfigGroup cg(&config, "PlasmaToolTips");
|
||||
KSharedConfig::openConfig("plasmarc")->reparseConfiguration();
|
||||
}
|
||||
|
||||
m_interval = cg.readEntry("Delay", 700);
|
||||
void ToolTip::loadSettings()
|
||||
{
|
||||
KConfigGroup cfg = KConfigGroup(KSharedConfig::openConfig("plasmarc"), "PlasmaToolTips");
|
||||
m_interval = cfg.readEntry("Delay", 700);
|
||||
m_tooltipsEnabledGlobally = (m_interval > 0);
|
||||
}
|
||||
|
||||
|
@ -180,6 +180,7 @@ private Q_SLOTS:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
void loadSettings();
|
||||
bool m_tooltipsEnabledGlobally;
|
||||
bool m_containsMouse;
|
||||
Plasma::Types::Location m_location;
|
||||
|
@ -115,6 +115,7 @@ ThemePrivate::ThemePrivate(QObject *parent)
|
||||
|
||||
ThemePrivate::~ThemePrivate()
|
||||
{
|
||||
saveSvgElementsCache();
|
||||
if (FrameSvgPrivate::s_sharedFrames.contains(this)) {
|
||||
foreach (FrameData *data, FrameSvgPrivate::s_sharedFrames[this].values()) {
|
||||
delete data;
|
||||
|
@ -91,8 +91,6 @@ Theme::Theme(const QString &themeName, QObject *parent)
|
||||
|
||||
Theme::~Theme()
|
||||
{
|
||||
d->saveSvgElementsCache();
|
||||
|
||||
if (d == ThemePrivate::globalTheme) {
|
||||
if (!ThemePrivate::globalThemeRefCount.deref()) {
|
||||
disconnect(ThemePrivate::globalTheme, 0, this, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user