KConfig
kconfiggroup.cpp
45 qCWarning(KCONFIG_CORE_LOG) << "Created a KConfigGroup on an inaccessible config location" << mOwner->name() << name;
57 qCWarning(KCONFIG_CORE_LOG) << "Created a KConfigGroup on an inaccessible config location" << mOwner->name() << name;
118 static QExplicitlySharedDataPointer<KConfigGroupPrivate> create(KConfigBase *master, const QString &name, bool isImmutable, bool isConst)
122 data = new KConfigGroupPrivate(static_cast<KConfigGroup *>(master), isImmutable, isConst, name);
141 value = QByteArray(*it).replace('\\', QByteArrayLiteral("\\\\")).replace(',', QByteArrayLiteral("\\,"));
149 value += QByteArray(*it).replace('\\', QByteArrayLiteral("\\\\")).replace(',', QByteArrayLiteral("\\,"));
221 .arg(QString::fromLatin1(pKey), QString::fromLatin1(aDefault.typeName()), QString::fromLatin1(value));
229QVariant KConfigGroup::convertToQVariant(const char *pKey, const QByteArray &value, const QVariant &aDefault)
272 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(2, list.count());
281 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(2, list.count());
290 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(4, list.count());
304 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(4, list.count());
318 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(2, list.count());
332 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(2, list.count());
345 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(6, list.count());
370 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(3, list.count());
382 qCWarning(KCONFIG_CORE_LOG) << "KConfigGroup::readEntry was passed GUI type '" << aDefault.typeName()
461static inline bool readEntryGui(const QByteArray &data, const char *key, const QVariant &input, QVariant &output)
469static inline bool writeEntryGui(KConfigGroup *cg, const char *key, const QVariant &input, KConfigGroup::WriteConfigFlags flags)
483 : d(KConfigGroupPrivate::create(const_cast<KConfigBase *>(master), _group, master->isGroupImmutable(_group), true))
511 Q_ASSERT_X(!aGroup.isEmpty(), "KConfigGroup::groupImpl", "can not have an unnamed child group");
523 Q_ASSERT_X(!aGroup.isEmpty(), "KConfigGroup::groupImpl", "can not have an unnamed child group");
527 newGroup.d = new KConfigGroupPrivate(const_cast<KConfigGroup *>(this), isGroupImmutableImpl(aGroup), true, aGroup);
541 parentGroup.d = new KConfigGroupPrivate(d->mOwner, d->mOwner->isImmutable(), d->bConst, QString());
607 return (isImmutable() || !config()->d_func()->canWriteEntry(d->fullName(), key, config()->readDefaults()));
686 const QByteArray data = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchLocalized);
729QStringList KConfigGroup::readXdgListEntry(const QString &key, const QStringList &aDefault) const
836 config()->d_func()->putData(d->fullName(), key, value.isNull() ? QByteArray("") : value, flags);
839void KConfigGroup::writeEntry(const QString &key, const QByteArray &value, WriteConfigFlags pFlags)
859void KConfigGroup::writeEntry(const QString &key, const QStringList &list, WriteConfigFlags flags)
1008 qCWarning(KCONFIG_CORE_LOG) << "KConfigGroup::writeEntry was passed GUI type '" << value.typeName()
1022void KConfigGroup::writeEntry(const QString &key, const QVariant &value, WriteConfigFlags flags)
1027void KConfigGroup::writeEntry(const QString &key, const QVariantList &list, WriteConfigFlags flags)
1032void KConfigGroup::writeXdgListEntry(const QString &key, const QStringList &value, WriteConfigFlags pFlags)
1037void KConfigGroup::writeXdgListEntry(const char *key, const QStringList &list, WriteConfigFlags flags)
1048 val.replace(QLatin1Char('\\'), QLatin1String("\\\\")).replace(QLatin1Char(';'), QLatin1String("\\;"));
1055void KConfigGroup::writePathEntry(const QString &pKey, const QString &path, WriteConfigFlags pFlags)
1060void KConfigGroup::writePathEntry(const char *pKey, const QString &path, WriteConfigFlags pFlags)
1068void KConfigGroup::writePathEntry(const QString &pKey, const QStringList &value, WriteConfigFlags pFlags)
1073void KConfigGroup::writePathEntry(const char *pKey, const QStringList &value, WriteConfigFlags pFlags)
1084 config()->d_func()->putData(d->fullName(), pKey, KConfigGroupPrivate::serializeList(list), pFlags, true);
1237 const auto entry = config()->d_ptr->lookupInternalEntry(groupName, key, KEntryMap::SearchLocalized);
1239 // Only write the entry if it is not null, if it is a global enry there is no point in moving it
1255void KConfigGroup::moveValuesTo(const QList<const char *> &keys, KConfigGroup &other, WriteConfigFlags pFlags)
void deleteGroup(const QString &group, WriteConfigFlags flags=Normal)
Delete group.
Definition kconfigbase.cpp:31
QFlags< WriteConfigFlag > WriteConfigFlags
Stores a combination of WriteConfigFlag values.
Definition kconfigbase.h:67
bool isGroupImmutable(const QString &group) const
Can changes be made to the entries in group?
Definition kconfigbase.cpp:36
bool hasGroup(const QString &group) const
Returns true if the specified group is known about.
Definition kconfigbase.cpp:16
void reparent(KConfigBase *parent, WriteConfigFlags pFlags=Normal)
Changes the configuration object that this group belongs to.
Definition kconfiggroup.cpp:1220
T readEntry(const QString &key, const T &aDefault) const
Reads the value of an entry specified by pKey in the current group.
Definition kconfiggroup.h:223
void writeXdgListEntry(const QString &pKey, const QStringList &value, WriteConfigFlags pFlags=Normal)
Writes a list of strings to the config object, following XDG desktop entry spec separator semantics.
Definition kconfiggroup.cpp:1032
bool hasDefault(const QString &key) const
Whether a default is specified for an entry in either the system wide configuration file or the globa...
Definition kconfiggroup.cpp:1122
bool hasKey(const QString &key) const
Checks whether the key has an entry in this group.
Definition kconfiggroup.cpp:1139
QString readPathEntry(const QString &pKey, const QString &aDefault) const
Reads a path.
Definition kconfiggroup.cpp:769
bool hasGroupImpl(const QString &groupName) const override
Definition kconfiggroup.cpp:1179
void writePathEntry(const QString &pKey, const QString &path, WriteConfigFlags pFlags=Normal)
Writes a file path to the configuration.
Definition kconfiggroup.cpp:1055
void revertToDefault(const QString &key, WriteConfigFlags pFlag=WriteConfigFlags())
Reverts an entry to the default settings.
Definition kconfiggroup.cpp:1108
bool isEntryImmutable(const QString &key) const
Checks if it is possible to change the given entry.
Definition kconfiggroup.cpp:610
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
Writes a value to the configuration object.
Definition kconfiggroup.cpp:1022
void deleteGroup(WriteConfigFlags pFlags=Normal)
Delete all entries in the entire group.
Definition kconfiggroup.cpp:549
void deleteGroupImpl(const QString &groupName, WriteConfigFlags flags) override
Definition kconfiggroup.cpp:1186
bool isGroupImmutableImpl(const QString &groupName) const override
Definition kconfiggroup.cpp:1194
KConfig * config()
Return the config object that this group belongs to.
Definition kconfiggroup.cpp:589
bool exists() const
Check whether the containing KConfig object actually contains a group with this name.
Definition kconfiggroup.cpp:564
void deleteEntry(const QString &pKey, WriteConfigFlags pFlags=Normal)
Deletes the entry specified by pKey in the current group.
Definition kconfiggroup.cpp:1095
void moveValuesTo(const QList< const char * > &keys, KConfigGroup &other, WriteConfigFlags pFlags=Normal)
Moves the key-value pairs from one config group to the other.
Definition kconfiggroup.cpp:1255
KConfigGroup parent() const
Returns the group that this group belongs to.
Definition kconfiggroup.cpp:532
QMap< QString, QString > entryMap() const
Returns a map (tree) of entries for all entries in this group.
Definition kconfiggroup.cpp:582
QStringList readXdgListEntry(const QString &pKey, const QStringList &aDefault=QStringList()) const
Reads a list of strings from the config object with semicolons separating them (i....
Definition kconfiggroup.cpp:729
QString readEntryUntranslated(const QString &pKey, const QString &aDefault=QString()) const
Reads an untranslated string entry.
Definition kconfiggroup.cpp:615
KConfigGroup groupImpl(const QString &groupName) override
Definition kconfiggroup.cpp:508
QStringList keyList() const
Returns a list of keys this group contains.
Definition kconfiggroup.cpp:1158
void copyTo(KConfigBase *other, WriteConfigFlags pFlags=Normal) const
Copies the entries in this group to another configuration object.
Definition kconfiggroup.cpp:1205
QMap< QString, QString > entryMap(const QString &aGroup=QString()) const
Returns a map (tree) of entries in a particular group.
Definition kconfig.cpp:384
Q_SCRIPTABLE QString start(QString train="")
QAction * end(const QObject *recvr, const char *slot, QObject *parent)
QString path(const QString &relativePath)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QAction * next(const QObject *recvr, const char *slot, QObject *parent)
const char * constData() const const
bool isEmpty() const const
bool isNull() const const
qsizetype lastIndexOf(QByteArrayView bv) const const
QByteArray mid(qsizetype pos, qsizetype len) const const
QByteArray & replace(QByteArrayView before, QByteArrayView after)
void reserve(qsizetype size)
int day() const const
int month() const const
int year() const const
QDate date() const const
QTime time() const const
QTimeZone timeRepresentation() const const
QTimeZone timeZone() const const
QString homePath()
bool isRelativePath(const QString &path)
QString toNativeSeparators(const QString &pathName)
QString decodeName(const QByteArray &localFileName)
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
const_iterator cbegin() const const
const_iterator cend() const const
qsizetype count() const const
bool isEmpty() const const
qsizetype length() const const
void reserve(qsizetype size)
Type
int x() const const
int y() const const
qreal x() const const
qreal y() const const
int height() const const
int left() const const
int top() const const
int width() const const
qreal height() const const
qreal left() const const
qreal top() const const
qreal width() const const
int height() const const
int width() const const
qreal height() const const
qreal width() const const
QString arg(Args &&... args) const const
void clear()
QString fromLatin1(QByteArrayView str)
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
bool isNull() const const
qsizetype length() const const
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
void reserve(qsizetype size)
qsizetype size() const const
void squeeze()
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QByteArray toUtf8() const const
CaseInsensitive
LocalTime
int hour() const const
int minute() const const
int msec() const const
int second() const const
QByteArray id() const const
Qt::TimeSpec timeSpec() const const
QUrl fromLocalFile(const QString &localFile)
QString toLocalFile() const const
QString toString(FormattingOptions options) const const
QUuid fromString(QAnyStringView string)
bool canConvert() const const
bool convert(QMetaType targetType)
QMetaType metaType() const const
QByteArray toByteArray() const const
QDate toDate() const const
QDateTime toDateTime() const const
QList< QVariant > toList() const const
QPoint toPoint() const const
QPointF toPointF() const const
QRect toRect() const const
QRectF toRectF() const const
QSize toSize() const const
QSizeF toSizeF() const const
QString toString() const const
QUrl toUrl() const const
const char * typeName() const const
int userType() const const
void push_back(T &&t)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 18 2025 12:10:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 18 2025 12:10:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.