diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt index 6d25988..96c7b65 100644 --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -1,63 +1,64 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII) include(ECMAddTests) find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET) find_package(Qt5Concurrent ${REQUIRED_QT_VERSION} CONFIG QUIET) if(NOT Qt5Test_FOUND) message(STATUS "Qt5Test not found, autotests will not be built.") return() endif() if(NOT Qt5Concurrent_FOUND) message(STATUS "Qt5Concurrent not found, autotests will not be built.") return() endif() -set(kentrymaptest_SRCS kentrymaptest.cpp) +# compile KEntryMap into the test since it's not exported +set(kentrymaptest_SRCS kentrymaptest.cpp ../src/core/kconfigdata.cpp) ecm_add_test(${kentrymaptest_SRCS} TEST_NAME kentrymaptest LINK_LIBRARIES KF5::ConfigCore Qt5::Test ) # compile KConfigUtils into the test since it's not exported set(test_kconfigutils_SRCS test_kconfigutils ../src/kconf_update/kconfigutils.cpp) ecm_add_test(${test_kconfigutils_SRCS} TEST_NAME test_kconfigutils LINK_LIBRARIES KF5::ConfigCore Qt5::Test ) target_include_directories(test_kconfigutils PRIVATE ../src/kconf_update) qt5_add_resources(sharedconfigresources sharedconfigresources.qrc) ecm_add_test(ksharedconfigtest ${sharedconfigresources} TEST_NAME kconfigcore-ksharedconfigtest LINK_LIBRARIES KF5::ConfigCore Qt5::Test Qt5::Concurrent) # test for fallback to :/kconfig/xxxx config resource qt5_add_resources(fallbackconfigresources fallbackconfigresources.qrc) ecm_add_test(fallbackconfigresourcestest ${fallbackconfigresources} TEST_NAME kconfigcore-fallbackconfigresourcestest LINK_LIBRARIES KF5::ConfigCore Qt5::Test Qt5::Concurrent) ecm_add_tests( kconfignokdehometest.cpp kconfigtest.cpp kdesktopfiletest.cpp test_kconf_update.cpp ksharedconfig_in_global_object NAME_PREFIX kconfigcore- LINK_LIBRARIES KF5::ConfigCore Qt5::Test Qt5::Concurrent ) target_include_directories(test_kconf_update PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src/kconf_update) ecm_add_tests( kconfigguitest.cpp kconfigloadertest.cpp kconfigskeletontest.cpp kstandardshortcuttest.cpp NAME_PREFIX kconfiggui- LINK_LIBRARIES KF5::ConfigGui Qt5::Test ) add_subdirectory(kconfig_compiler) diff --git a/cmake/rules_PyKF5.py b/cmake/rules_PyKF5.py index 7d3f041..72bee90 100644 --- a/cmake/rules_PyKF5.py +++ b/cmake/rules_PyKF5.py @@ -1,305 +1,310 @@ # # Copyright 2016 by Shaheed Haque (srhaque@theiet.org) # Copyright 2016 Stephen Kelly # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os, sys import rules_engine sys.path.append(os.path.dirname(os.path.dirname(rules_engine.__file__))) import Qt5Ruleset from copy import deepcopy from clang.cindex import AccessSpecifier, CursorKind def set_skeleton_item_base(container, sip, matcher): if not sip["base_specifiers"] or sip["base_specifiers"][-1].endswith(">"): sip["base_specifiers"] = ["KConfigSkeletonItem"] def set_skeleton_item_base_gui(container, sip, matcher): sip["base_specifiers"] = ["KConfigSkeletonItem"] def mark_and_discard_QSharedData(container, sip, matcher): rules_engine.container_mark_abstract(container, sip, matcher) rules_engine.discard_QSharedData_base(container, sip, matcher) def discard_base(container, sip, matcher): sip["base_specifiers"] = [] def local_container_rules(): return [ [".*", "KConfigBackend", ".*", ".*", ".*", mark_and_discard_QSharedData], [".*", "KConfigBase", ".*", ".*", ".*", rules_engine.container_mark_abstract], [".*KCoreConfigSkeleton.*", ".*ItemString", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemUrl", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemProperty", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemBool", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemInt", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemLongLong", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemUInt", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemULongLong", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemDouble", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemRect", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemPoint", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemSize", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemDateTime", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemStringList", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemUrlList", ".*", ".*", ".*", set_skeleton_item_base], [".*KCoreConfigSkeleton.*", ".*ItemIntList", ".*", ".*", ".*", set_skeleton_item_base], ["KConfigSkeleton", "ItemColor", ".*", ".*", ".*", set_skeleton_item_base_gui], ["KConfigSkeleton", "ItemFont", ".*", ".*", ".*", set_skeleton_item_base_gui], [".*", "KSharedConfig", ".*", ".*", ".*", rules_engine.discard_QSharedData_base], [".*", "KConfigCompilerSignallingItem", ".*", ".*", ".*", rules_engine.container_discard], [".*", "KEntryMap", ".*", ".*", ".*", discard_base], ] def local_function_rules(): return [ ["KConfigBase", "group", ".*", ".*", ".*const char.*", rules_engine.function_discard], ["KConfigBase", "group", ".*", ".*", ".*QByteArray.*", rules_engine.function_discard], ["KConfigBase", "group", ".*", "const KConfigGroup", ".*", rules_engine.function_discard], ["KConfigBase", "groupImpl", ".*", "const KConfigGroup", ".*", rules_engine.function_discard], ["KConfig", "groupImpl", ".*", "const KConfigGroup", ".*", rules_engine.function_discard], ["KSharedConfig", "openConfig", ".*", ".*", ".*", rules_engine.function_discard], ["KConfigGroup", "KConfigGroup", ".*", ".*", ".*KConfigBase.*", rules_engine.function_discard], ["KConfigGroup", "config", ".*", "const KConfig.*", ".*", rules_engine.function_discard], ["KDesktopFile", ".*", ".*", "const KConfigGroup", ".*", rules_engine.function_discard], ["KConfigGroup", ".*", ".*", "KConfigGroup", ".*", rules_engine.function_discard], ["KCoreConfigSkeleton", "config", ".*", "const KConfig.*", ".*", rules_engine.function_discard], ["KCoreConfigSkeleton", "sharedConfig", ".*", ".*", ".*", rules_engine.function_discard], ["KEntryMap", "getEntryOption", ".*", ".*", ".*", rules_engine.function_discard], ["KEntryMap", "setEntryOption", ".*", ".*", ".*", rules_engine.function_discard], ["KEntryMap", "findEntry", ".*", ".*", ".*", rules_engine.function_discard], ["KEntryMap", "findExactEntry", ".*", ".*", ".*", rules_engine.function_discard], + + ["KConfigBackend", "registerMappings", ".*", ".*", ".*", rules_engine.function_discard], + ["KConfigBackend", "parseConfig", ".*", ".*", ".*", rules_engine.function_discard], + ["KConfigBackend", "writeConfig", ".*", ".*", ".*", rules_engine.function_discard], + ] def local_typedef_rules(): return [ ["KConfigSkeletonItem", "DictIterator", rules_engine.typedef_discard], [".*", "KEntryMapIterator", rules_engine.typedef_discard], [".*", "KEntryMapConstIterator", rules_engine.typedef_discard], ] def _kcoreconfigskeleton_item_xxx(function, sip, entry): sip["code"] = """ %MethodCode sipCpp = new sipKCoreConfigSkeleton_Item{} (*a0, *a1, a2, a3); %End """.replace("{}", entry["ctx"]) sip["parameters"][2] = sip["parameters"][2].replace("&", "") def _kcoreconfigskeleton_item_enum(function, sip, entry): sip["code"] = """ %MethodCode sipCpp = new sipKCoreConfigSkeleton_ItemEnum (*a0, *a1, a2, *a3, a4); %End """.replace("{}", entry["ctx"]) sip["parameters"][2] = sip["parameters"][2].replace("&", "") def _kcoreconfigskeleton_add_item_xxx(function, sip, entry): sip["code"] = """ %MethodCode sipRes = new PyItem{} (sipCpp->currentGroup(), a3->isNull() ? *a0 : *a3, a1, a2); sipCpp->addItem(sipRes, *a0); %End """.format(entry["ctx"]) def _kcoreconfigskeleton_item_add_py_subclass(filename, sip, entry): result = """ %ModuleHeaderCode #include """ for ctx in ({"Type": "Bool", "cpptype": "bool", "defaultValue": 1}, {"Type": "Int", "cpptype": "qint32", "defaultValue": 1}, {"Type": "UInt", "cpptype": "quint32", "defaultValue": 1}, {"Type": "LongLong", "cpptype": "qint64", "defaultValue": 1}, {"Type": "ULongLong", "cpptype": "quint64", "defaultValue": 1}, {"Type": "Double", "cpptype": "double", "defaultValue": 1}, ): result += """ class PyItem{Type} : public KCoreConfigSkeleton::Item{Type} {{ public: PyItem{Type} (const QString &group, const QString &key, {cpptype}& val, {cpptype} defaultValue = {defaultValue}) : KCoreConfigSkeleton::Item{Type} (group, key, this->value, defaultValue), value(val) {{ }} private: {cpptype} value; }}; """.format(**ctx) result += """ class PyItemEnum : public KCoreConfigSkeleton::ItemEnum { public: PyItemEnum (const QString& group, const QString& key, int& val, const QList& choices, int defaultValue = 0) : KCoreConfigSkeleton::ItemEnum(group, key, this->value, choices, defaultValue), value(val) { }; private: int value; }; %End\n """ sip["code"] = result class RuleSet(Qt5Ruleset.RuleSet): def __init__(self): Qt5Ruleset.RuleSet.__init__(self) self._fn_db = rules_engine.FunctionRuleDb(lambda: local_function_rules() + Qt5Ruleset.function_rules()) self._container_db = rules_engine.ContainerRuleDb(lambda: local_container_rules() + Qt5Ruleset.container_rules()) self._typedef_db = rules_engine.TypedefRuleDb(lambda: local_typedef_rules() + Qt5Ruleset.typedef_rules()) self._methodcode = rules_engine.MethodCodeDb({ "KCoreConfigSkeleton::ItemBool": { "ItemBool": { "code": _kcoreconfigskeleton_item_xxx, "ctx": "Bool", }, }, "KCoreConfigSkeleton::ItemInt": { "ItemInt": { "code": _kcoreconfigskeleton_item_xxx, "ctx": "Int", }, }, "KCoreConfigSkeleton::ItemLongLong": { "ItemLongLong": { "code": _kcoreconfigskeleton_item_xxx, "ctx": "LongLong", }, }, "KCoreConfigSkeleton::ItemEnum": { "ItemEnum": { "code": _kcoreconfigskeleton_item_enum, "ctx": "Enum", }, }, "KCoreConfigSkeleton::ItemUInt": { "ItemUInt": { "code": _kcoreconfigskeleton_item_xxx, "ctx": "UInt", }, }, "KCoreConfigSkeleton::ItemULongLong": { "ItemULongLong": { "code": _kcoreconfigskeleton_item_xxx, "ctx": "ULongLong", }, }, "KCoreConfigSkeleton::ItemDouble": { "ItemDouble": { "code": _kcoreconfigskeleton_item_xxx, "ctx": "Double", }, }, "KCoreConfigSkeleton": { "addItemBool": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "Bool", }, "addItemInt": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "Int", }, "addItemUInt": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "UInt", }, "addItemLongLong": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "LongLong", }, "addItemInt64": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "LongLong", }, "addItemULongLong": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "ULongLong", }, "addItemUInt64": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "ULongLong", }, "addItemDouble": { "code": _kcoreconfigskeleton_add_item_xxx, "ctx": "Double", }, }, }) self._modulecode = rules_engine.ModuleCodeDb({ "kcoreconfigskeleton.h": { "code": _kcoreconfigskeleton_item_add_py_subclass, }, }) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 83e4f76..72a46b9 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,91 +1,90 @@ find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) set(libkconfigcore_SRCS kconfig.cpp kconfigbase.cpp kconfigdata.cpp kconfiggroup.cpp kconfigbackend.cpp kconfigini.cpp kdesktopfile.cpp ksharedconfig.cpp kcoreconfigskeleton.cpp kauthorized.cpp kemailsettings.cpp ) add_library(KF5ConfigCore ${libkconfigcore_SRCS}) generate_export_header(KF5ConfigCore BASE_NAME KConfigCore) add_library(KF5::ConfigCore ALIAS KF5ConfigCore) target_compile_definitions(KF5ConfigCore PRIVATE KCONF_UPDATE_INSTALL_LOCATION="${KDE_INSTALL_FULL_LIBEXECDIR_KF5}/$" ) target_include_directories(KF5ConfigCore INTERFACE "$") target_link_libraries(KF5ConfigCore PUBLIC Qt5::Core) if(WIN32) target_link_libraries(KF5ConfigCore PRIVATE ${KDEWIN_LIBRARIES}) endif() set_target_properties(KF5ConfigCore PROPERTIES VERSION ${KCONFIG_VERSION_STRING} SOVERSION ${KCONFIG_SOVERSION} EXPORT_NAME ConfigCore ) ecm_generate_headers(KConfigCore_HEADERS HEADER_NAMES KAuthorized KConfig KConfigBackend KConfigBase KConfigGroup KDesktopFile KSharedConfig KCoreConfigSkeleton KEMailSettings ConversionCheck REQUIRED_HEADERS KConfigCore_HEADERS ) find_package(PythonModuleGeneration) if (PythonModuleGeneration_FOUND) ecm_generate_python_binding( TARGET KF5::ConfigCore PYTHONNAMESPACE PyKF5 MODULENAME KConfigCore RULES_FILE "${CMAKE_SOURCE_DIR}/cmake/rules_PyKF5.py" INSTALL_DIR_SUFFIX ${KDE_INSTALL_PYTHONBINDINGSDIR} SIP_DEPENDS QtCore/QtCoremod.sip HEADERS kauthorized.h kconfig.h kconfigbackend.h kconfigbase.h - kconfigdata.h kconfiggroup.h kdesktopfile.h ksharedconfig.h kcoreconfigskeleton.h kemailsettings.h conversioncheck.h ) endif() install(TARGETS KF5ConfigCore EXPORT KF5ConfigTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kconfigcore_export.h ${KConfigCore_HEADERS} DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KConfigCore COMPONENT Devel ) include(ECMGeneratePriFile) ecm_generate_pri_file(BASE_NAME KConfigCore LIB_NAME KF5ConfigCore DEPS "core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KConfigCore) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) diff --git a/src/core/kconfigdata.h b/src/core/kconfigdata.h index 5839dfd..a243016 100644 --- a/src/core/kconfigdata.h +++ b/src/core/kconfigdata.h @@ -1,246 +1,246 @@ /* This file is part of the KDE libraries Copyright (c) 2006, 2007 Thomas Braxton Copyright (c) 1999-2000 Preston Brown Copyright (C) 1996-2000 Matthias Kalle Dalheimer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KCONFIGDATA_H #define KCONFIGDATA_H #include #include #include #include #include /** * map/dict/list config node entry. * @internal */ struct KEntry { /** Constructor. @internal */ KEntry() : mValue(), bDirty(false), bGlobal(false), bImmutable(false), bDeleted(false), bExpand(false), bReverted(false), bLocalizedCountry(false) {} /** @internal */ QByteArray mValue; /** * Must the entry be written back to disk? */ bool bDirty : 1; /** * Entry should be written to the global config file */ bool bGlobal: 1; /** * Entry can not be modified. */ bool bImmutable: 1; /** * Entry has been deleted. */ bool bDeleted: 1; /** * Whether to apply dollar expansion or not. */ bool bExpand: 1; /** * Entry has been reverted to its default value (from a more global file). */ bool bReverted: 1; /** * Entry is for a localized key. If @c false the value references just language e.g. "de", * if @c true the value references language and country, e.g. "de_DE". **/ bool bLocalizedCountry: 1; }; // These operators are used to check whether an entry which is about // to be written equals the previous value. As such, this intentionally // omits the dirty flag from the comparison. inline bool operator ==(const KEntry &k1, const KEntry &k2) { return k1.bGlobal == k2.bGlobal && k1.bImmutable == k2.bImmutable && k1.bDeleted == k2.bDeleted && k1.bExpand == k2.bExpand && k1.mValue == k2.mValue; } inline bool operator !=(const KEntry &k1, const KEntry &k2) { return !(k1 == k2); } /** * key structure holding both the actual key and the group * to which it belongs. * @internal */ struct KEntryKey { /** Constructor. @internal */ KEntryKey(const QByteArray &_group = QByteArray(), const QByteArray &_key = QByteArray(), bool isLocalized = false, bool isDefault = false) : mGroup(_group), mKey(_key), bLocal(isLocalized), bDefault(isDefault), bRaw(false) { ; } /** * The "group" to which this EntryKey belongs */ QByteArray mGroup; /** * The _actual_ key of the entry in question */ QByteArray mKey; /** * Entry is localised or not */ bool bLocal : 1; /** * Entry indicates if this is a default value. */ bool bDefault: 1; /** @internal * Key is a raw unprocessed key. * @warning this should only be set during merging, never for normal use. */ bool bRaw: 1; }; /** * Compares two KEntryKeys (needed for QMap). The order is localized, localized-default, * non-localized, non-localized-default * @internal */ inline bool operator <(const KEntryKey &k1, const KEntryKey &k2) { int result = qstrcmp(k1.mGroup, k2.mGroup); if (result != 0) { return result < 0; } result = qstrcmp(k1.mKey, k2.mKey); if (result != 0) { return result < 0; } if (k1.bLocal != k2.bLocal) { return k1.bLocal; } return (!k1.bDefault && k2.bDefault); } QDebug operator<<(QDebug dbg, const KEntryKey &key); QDebug operator<<(QDebug dbg, const KEntry &entry); /** * \relates KEntry * type specifying a map of entries (key,value pairs). * The keys are actually a key in a particular config file group together * with the group name. * @internal */ -class KCONFIGCORE_EXPORT KEntryMap : public QMap +class KEntryMap : public QMap { public: enum SearchFlag { SearchDefaults = 1, SearchLocalized = 2 }; Q_DECLARE_FLAGS(SearchFlags, SearchFlag) enum EntryOption { EntryDirty = 1, EntryGlobal = 2, EntryImmutable = 4, EntryDeleted = 8, EntryExpansion = 16, EntryRawKey = 32, EntryLocalizedCountry = 64, EntryDefault = (SearchDefaults << 16), EntryLocalized = (SearchLocalized << 16) }; Q_DECLARE_FLAGS(EntryOptions, EntryOption) Iterator findExactEntry(const QByteArray &group, const QByteArray &key = QByteArray(), SearchFlags flags = SearchFlags()); Iterator findEntry(const QByteArray &group, const QByteArray &key = QByteArray(), SearchFlags flags = SearchFlags()); ConstIterator findEntry(const QByteArray &group, const QByteArray &key = QByteArray(), SearchFlags flags = SearchFlags()) const; /** * Returns true if the entry gets dirtied or false in other case */ bool setEntry(const QByteArray &group, const QByteArray &key, const QByteArray &value, EntryOptions options); void setEntry(const QByteArray &group, const QByteArray &key, const QString &value, EntryOptions options) { setEntry(group, key, value.toUtf8(), options); } QString getEntry(const QByteArray &group, const QByteArray &key, const QString &defaultValue = QString(), SearchFlags flags = SearchFlags(), bool *expand = nullptr) const; bool hasEntry(const QByteArray &group, const QByteArray &key = QByteArray(), SearchFlags flags = SearchFlags()) const; bool getEntryOption(const ConstIterator &it, EntryOption option) const; bool getEntryOption(const QByteArray &group, const QByteArray &key, SearchFlags flags, EntryOption option) const { return getEntryOption(findEntry(group, key, flags), option); } void setEntryOption(Iterator it, EntryOption option, bool bf); void setEntryOption(const QByteArray &group, const QByteArray &key, SearchFlags flags, EntryOption option, bool bf) { setEntryOption(findEntry(group, key, flags), option, bf); } bool revertEntry(const QByteArray &group, const QByteArray &key, SearchFlags flags = SearchFlags()); }; Q_DECLARE_OPERATORS_FOR_FLAGS(KEntryMap::SearchFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(KEntryMap::EntryOptions) /** * \relates KEntry * type for iterating over keys in a KEntryMap in sorted order. * @internal */ typedef QMap::Iterator KEntryMapIterator; /** * \relates KEntry * type for iterating over keys in a KEntryMap in sorted order. * It is const, thus you cannot change the entries in the iterator, * only examine them. * @internal */ typedef QMap::ConstIterator KEntryMapConstIterator; #endif