aboutsummaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2014-06-28Fix data race on static int.David Faure
2014-06-23SVN_SILENT made messages (.desktop file)l10n daemon script
2014-06-22Make KSharedConfig thread-safeDavid Faure
... by having a different list of shareable objects per thread. REVIEW: 118739
2014-06-21Fix reading of entries for language/country combinationsMartin Gräßlin
This fixes a regression introduced in 988f09bb051dca0437ecec431ee44ed5b4a560d8. The mentioned commit ensures that if the locale is e.g. "de_DE" the entry "de" will be used. But this breaks if there is a translation for another country. E.g. for "de_CH" it would also pick the "de" entry. This change now operates on both just the language code and the locale. If an entry with the language code is present it will be picked. If another entry with the exact locale is found it will be overwritten. Modifiers are not supported as this is currently missing in QLocale. REVIEW: 118692
2014-06-19Optimize KConfigIniBackend::parseConfig by reducing allocations.Milian Wolff
Yet another awesome application of the Qt implicit sharing trick. Since config files often contain only few different keys and even value strings, we can share them. This reduces memory consumption and also speeds up parsing, as we do not have to allocate the duplicated strings, but can simply reuse the previous values. The most extreme case for this of my knowledge, is KatePart: katesyntaxhighlightingrc has more than 20k lines which triggered nearly 30k allocations on startup. With this patch applied, this value goes down dramatically. I added a simple static counter for the cache hit/miss ratio, which resulted in 5442 cache misses compared to 43624 cache hits across all KConfig files parsed by kwrite. REVIEW: 118587 This is a forward-port of b8aaeff128233cfaecf67899168887572589dde8.
2014-06-18Optimize KConfigGroup::exists and similar operations.Milian Wolff
Before, these kind of read-only operations did a lot of allocations: 1) allocate a list of all sub groups 2) for the above, also allocate a sub-group match key 3) iterate over sub groups, allocate a list of all keys in there and then finally check whether that list is non-empty All of the above is now done without a single allocation, by simply iterating over the list of entries. Note: The whole list was iterated even before in allSubGroups. Now we still do that, but check for non-empty keys in the group or sub group directly. Much more efficient. Note2: While at it, allSubGroups is also optimized to not require the allocation of the subgroup match key. REVIEW: 118586 forward-port of commit eaffd50adfd7fcbeafadb0248904176808b4499d
2014-06-18Remove duplicate comparison against group.Milian Wolff
forward-port of commit 416559cdb86f9cacf4ea4ed7530cbbbdb427302f
2014-06-12Fix locale-aware reading in KDesktopFileMartin Gräßlin
The underlying KConfig used QLocale::name() for getting the locale aware part. But this returns "de_DE" while the desktop files store "de". In addition it constructs a QLocale object instead of using the system locale. This has the advantage that the usage of QLocale::setDafault() gets honored by KConfig. REVIEW: 118564
2014-06-12Simple CleanupsThomas Braxton
- use Q_NULLPTR instead of 0 or NULL - simplify some foreach loops - use QStringLiteral in a few places - added a few consts REVIEW: 118666
2014-05-26Update usage of QVariant::type() for Qt5.Thomas Braxton
According to http://qt-project.org/doc/qt-5/qvariant.html#type the return value of QVariant::type() should be interpreted as a QMetaType::Type. This also silences the compile-time warnings about 38 not being a member of QVariant::Type. REVIEW: 118332
2014-05-26REVIEW: 118039Thomas Braxton
Simplify KConfigGroup::readEntry/writeEntry. KConfigGroup::readCheck/writeCheck caused some compilers to complain since they were private functions that were being reimplemented outside the class definition. Updated KCONFIGGROUP_DECLARE_ENUM_QOBJECT/ deprecated global functions created in KDE4 times.
2014-05-12Fix lupdate warningsAlbert Astals Cid
/home/scripty/prod/git-unstable/frameworks_kconfig/src/core/bufferfragment_p.h:37: Ignoring definition of undeclared qualified class /home/scripty/prod/git-unstable/frameworks_kconfig/src/core/bufferfragment_p.h:37: Ignoring definition of undeclared qualified class
2014-05-05Revert "Store app config file in ~/.config/<domain>/<app>rc"David Faure
This reverts commit 625e124898afad04ab5c3939b1b129b6014046cd. Let's take the time to think about a better solution, possibly.
2014-05-04Store app config file in ~/.config/<domain>/<app>rcDavid Faure
Only KSharedConfig::openConfig() and KConfig default constructor are affected. KConfig("kdeglobals"), for instance, points to ~/.config so that it can be shared. REVIEW: 117989
2014-05-03Fix lupdate warningAlbert Astals Cid
kconfigini.cpp:554: Class 'KConfigIniBackend' lacks Q_OBJECT macro
2014-05-03SVN_SILENT made messages (.desktop file)l10n daemon script
2014-05-02fix include path in .pri filesDavid Faure
2014-05-02SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-29SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-29SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-28SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-28SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-28SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-28SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-27SVN_SILENT made messages (.desktop file)l10n daemon script
2014-04-27install libexec executables in the kf5 libexec directoryAleix Pol
2014-04-26Adapt to changes in KDEInstallDirsAleix Pol
kde5/services is kservices5 kde5/servicetypes is kservicestypes5
2014-04-26Use KF5_INCLUDE_INSTALL_DIR and KF5_INSTALL_TARGETS_DEFAULT_ARGSAlex Merry
This is instead of INCLUDE_INSTALL_DIR and INSTALL_TARGETS_DEFAULT_ARGS, which will lose the "KF5" suffix from the include path.
2014-04-11Rewrite kiosk documentationAlex Merry
A lot of kiosk stuff is actually in other frameworks, from the point of view of applications, but KConfig provides the core functionality. Make the docs here describe KConfig's role, rather than KIO's or KXMLGui's. REVIEW: 117486
2014-04-02The "trailing semicolon" requirement was relaxed yesterday.David Faure
http://standards.freedesktop.org/desktop-entry-spec/1.1/ar01s03.html
2014-04-01fixed mingw buildPatrick von Reth
2014-03-28guard gcc-specific things with Q_CC_GNU to avoid problems elsewhereDavid Faure
2014-03-28Fix repeated typo in 'override'David Faure
2014-03-28Stop re-loading values inside KCoreConfigSkeleton::save().Matthew Dawson
The extra load of values in KCoreConfigSkeleton is not documented anywhere that it happens, and in normal circumstances re-loading new values isn't expecterd during a save operation. Update various mentions of readConfig/writeConfig to read/save. Update documentation to match the new names of functions. Rename writeConfig() to save() and usrWriteConfig() to usrSave() Rename functions to match the new naming conventions. Also create old deprecated instances of both functions to ensure that old code continues to operate correctly. Also make save() non-virtual, for the same reasons read() is now non-virtual. Rename usrReadConfig to usrRead, to be consistent with the new name for readConfig. Rename usrReadConfig to usrRead, and mark the former as deprecated. To maintain compatibility, usrRead still calls usrReadConfig in its default implementation. usrReadConfig remains empty. REVIEW: 117010
2014-03-25Use the full path for kconf_update when running itAlex Merry
It is not on $PATH, so we cannot just expect QProcess to find it. REVIEW: 117023
2014-03-25Remove kde3 compatibility code for "DocPath" in desktop filesAlex Merry
LXR suggests nothing still sets that (everything is X-DocPath now). REVIEW: 117003
2014-03-24Update docs for KDesktopFile::isAuthorizedDesktopFile()Alex Merry
The fact that it changed in KDE 4.3 is not so relevant any more. REVIEW: 116962
2014-03-24Better comment for why KDesktopFile::readPath uses readEntryAlex Merry
REVIEW: 116962
2014-03-24Remove old kdelibs4 codeAlex Merry
All this ifdef'd-out code just makes it hard to see what's going on. REVIEW: 116962
2014-03-23Rename readConfig() to load(), to make it clear it's loading from disk.David Faure
As discussed with Matthew Dawson in review 116461.
2014-03-23Revert addition of DelayedParsing, not needed after all.David Faure
2014-03-23Make readConfig() non-virtual anymore, it's not useful.David Faure
Apps can reimplement usrReadConfig() or the readConfig() in every item instead.
2014-03-23Remove unnecessary debug outputDavid Faure
2014-03-23Add KCoreConfigSkeleton::read() which doesn't call reparseConfiguration.David Faure
Call it from generated singletons, since the constructor creates a KConfig from a filename, which already loads from disk. This removes the need for using DelayedParsing. REVIEW: 116845
2014-03-23KStandardDirs -> QStandardPaths in apidoxAlex Merry
2014-03-13KCoreConfigSkeleton: delay parsing until the call to readConfig()David Faure
2014-03-01make comment less confusingDavid Faure
2014-03-01we use Qt5 now, so re-enable -DQT_NO_CAST_FROM_BYTEARRAYDavid Faure
2014-02-27Fix interference from kdeplatformtheme into unittestsDavid Faure
kdeplatformtheme would load kdeglobals and the app config file, in order to load settings, before the unittests get a chance to call QStandardPaths::setTestModeEnabled(true). As a result, the test would keep getting references to "wrong" shared config objects, pointing to the real user's locations rather than the test directories. This fixes e.g. kconfigdialog_unittest from kconfigwidgets for me (it only passes on build.kde.org because it doesn't install frameworkintegration for testing this framework) REVIEW: 115963
2014-02-27Add sharedConfig() accessor, to avoid manipulating a raw KConfig * as ↵David Faure
returned by config(). This is useful when using kconfigxt and some other code to read from the same config file (e.g. KColorScheme::contrastF(config)) - no need to call KSharedConfig::openConfig twice, just grab the KSharedConfig from the generated class. REVIEW: 115960