if a name is passed in the ctor, never change
BUG:335005
This commit is contained in:
parent
db8da9ff8d
commit
409d340fba
@ -63,6 +63,7 @@ ThemePrivate::ThemePrivate(QObject *parent)
|
||||
isDefault(true),
|
||||
useGlobal(true),
|
||||
hasWallpapers(false),
|
||||
fixedName(false),
|
||||
backgroundContrastEnabled(true)
|
||||
{
|
||||
ThemeConfig config;
|
||||
@ -456,6 +457,9 @@ void ThemePrivate::settingsFileChanged(const QString &file)
|
||||
|
||||
void ThemePrivate::settingsChanged()
|
||||
{
|
||||
if (fixedName) {
|
||||
return;
|
||||
}
|
||||
//qDebug() << "Settings Changed!";
|
||||
KConfigGroup cg = config();
|
||||
setThemeName(cg.readEntry("name", ThemePrivate::defaultTheme), false);
|
||||
@ -575,7 +579,8 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
|
||||
// the system colors.
|
||||
bool realTheme = theme != systemColorsTheme;
|
||||
if (realTheme) {
|
||||
QString themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Char('/'));
|
||||
QString themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % "/metadata.desktop");
|
||||
|
||||
if (themePath.isEmpty() && themeName.isEmpty()) {
|
||||
themePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/default"), QStandardPaths::LocateDirectory);
|
||||
|
||||
|
@ -148,6 +148,7 @@ public:
|
||||
bool useGlobal : 1;
|
||||
bool hasWallpapers : 1;
|
||||
bool cacheTheme : 1;
|
||||
bool fixedName : 1;
|
||||
|
||||
qreal backgroundContrast;
|
||||
qreal backgroundIntensity;
|
||||
|
@ -81,6 +81,7 @@ Theme::Theme(const QString &themeName, QObject *parent)
|
||||
d->cacheTheme = false;
|
||||
d->setThemeName(themeName, false);
|
||||
d->cacheTheme = useCache;
|
||||
d->fixedName = true;
|
||||
if (QCoreApplication::instance()) {
|
||||
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),
|
||||
d, SLOT(onAppExitCleanup()));
|
||||
|
Loading…
Reference in New Issue
Block a user