QortalOS Brooklyn for Raspberry Pi 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

46 lines
1.0 KiB

/*
SPDX-FileCopyrightText: 2019 Benjamin Port <[email protected]>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <QDebug>
#include <QObject>
#include <KBuildSycocaProgressDialog>
#include <KIconTheme>
#include <KSharedDataCache>
#include "iconssettings.h"
IconsSettings::IconsSettings(QObject *parent)
: IconsSettingsBase(parent)
, m_themeDirty(false)
{
connect(this, &IconsSettings::configChanged, this, &IconsSettings::updateIconTheme);
connect(this, &IconsSettings::ThemeChanged, this, &IconsSettings::updateThemeDirty);
}
IconsSettings::~IconsSettings()
{
}
void IconsSettings::updateThemeDirty()
{
m_themeDirty = theme() != KIconTheme::current();
}
void IconsSettings::updateIconTheme()
{
if (m_themeDirty) {
KIconTheme::reconfigure();
KSharedDataCache::deleteCache(QStringLiteral("icon-cache"));
for (int i = 0; i < KIconLoader::LastGroup; i++) {
KIconLoader::emitChange(KIconLoader::Group(i));
}
KBuildSycocaProgressDialog::rebuildKSycoca(nullptr);
}
}