Summary: | kcm_lookandfeel can't write LookAndFeelPackage if there are systemwide kdeglobals with same key | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Hrvoje Senjan <hrvoje.senjan> |
Component: | Global Theme packages | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | eugene.vanderwatt, matthew, notmart, simonandric5 |
Priority: | NOR | ||
Version: | master | ||
Target Milestone: | 1.0 | ||
Platform: | Other | ||
OS: | Linux | ||
See Also: |
https://bugs.kde.org/show_bug.cgi?id=340691 https://bugs.kde.org/show_bug.cgi?id=342570 |
||
Latest Commit: | Version Fixed In: | 5.2.1 | |
Sentry Crash Report: | |||
Attachments: |
attempt patch
Potential workaround for kcm_lookandfeel |
Description
Hrvoje Senjan
2015-01-30 19:19:33 UTC
somehow this resolves the problem, but why, i do not know =( diff --git a/kcms/lookandfeel/kcm.cpp b/kcms/lookandfeel/kcm.cpp index 6b4bf68..c8398d7 100644 --- a/kcms/lookandfeel/kcm.cpp +++ b/kcms/lookandfeel/kcm.cpp @@ -238,7 +238,9 @@ void KCMLookandFeel::save() return; } - m_configGroup.writeEntry("LookAndFeelPackage", m_selectedPlugin); + m_config2 = KSharedConfig::openConfig("kdeglobals"); + KConfigGroup group(m_config2, "KDE"); + group.writeEntry("LookAndFeelPackage", m_selectedPlugin); if (!package.filePath("defaults").isEmpty()) { KSharedConfigPtr conf = KSharedConfig::openConfig(package.filePath("defaults")); diff --git a/kcms/lookandfeel/kcm.h b/kcms/lookandfeel/kcm.h index c082cd3..e2d0c7b 100644 --- a/kcms/lookandfeel/kcm.h +++ b/kcms/lookandfeel/kcm.h @@ -119,6 +119,7 @@ private: QStringList m_cursorSearchPaths; KConfig m_config; + KSharedConfigPtr m_config2; KConfigGroup m_configGroup; bool m_applyColors : 1; *** Bug 343644 has been marked as a duplicate of this bug. *** Created attachment 90906 [details]
attempt patch
can you try with the attached patch?
(In reply to Marco Martin from comment #3) > can you try with the attached patch? unfortunately, it doesn't fix the issue =( managed to reproduce kindof fear it may be a kconfig issue. besides of saving the other style instead of breeze, that key gets written in kdeglobals two times being duplicated @Matthew do you have some ideas about this problem? digging more into this, it seems the underlying KentryMap inside KConfig in this case gets two keys LookAndFeelPackage one with the value in the global file one in the value of the local one (oxygen and breeze in this case) this seems wrong since i guess KentryMap like a good map should be supposed to have unique keys... this patch in kconfig appears to fix it, but i realize is pobably very very wrong but could help identify the real problem diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index 856b7b7..486cfcb 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -319,7 +319,7 @@ void KConfigIniBackend::writeEntries(const QByteArray &locale, QIODevice &file, } // the only thing we care about groups is, is it immutable? - if (key.mKey.isNull()) { + if (key.mKey.isNull() || key.bDefault) { groupIsImmutable = it->bImmutable; continue; // skip } yep, can confirm it writes the correct entry (once ;-) with the above patch Created attachment 90986 [details]
Potential workaround for kcm_lookandfeel
This does indeed appear to be a KConfig issue. For know, I'll track the KConfig part in #340691 (marked as a blocker for this). I think this bug can be fixed without requiring changes to KConfig.
For now, this patch may fix this bug while KConfig is being worked on. I think this patch would be good to have, ignoring the underlying bug.
hm, i wonder if bug 342570 could be resolved in the same way (on the lines 89 & 91 in [breeze.git]/misc/kde4breeze/src/main.cpp will test your patch for the kcm asap indeed it fixes the problem here after rebuilding krdb & lookandfeel subdir w/ the patch =) Ok, would go with this patch for now so. Fixed with commit: http://commits.kde.org/plasma-desktop/523497fde1828acfb70a242959b6ee7af1b0dde4 . |