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());
365 qCWarning(KCONFIG_CORE_LOG) << errString(pKey, value, aDefault) << formatError(3, list.count());
377 qCWarning(KCONFIG_CORE_LOG) << "KConfigGroup::readEntry was passed GUI type '" << aDefault.typeName()
456static inline bool readEntryGui(const QByteArray &data, const char *key, const QVariant &input, QVariant &output)
464static inline bool writeEntryGui(KConfigGroup *cg, const char *key, const QVariant &input, KConfigGroup::WriteConfigFlags flags)
478 : d(KConfigGroupPrivate::create(const_cast<KConfigBase *>(master), _group, master->isGroupImmutable(_group), true))
506 Q_ASSERT_X(!aGroup.isEmpty(), "KConfigGroup::groupImpl", "can not have an unnamed child group");
518 Q_ASSERT_X(!aGroup.isEmpty(), "KConfigGroup::groupImpl", "can not have an unnamed child group");
522 newGroup.d = new KConfigGroupPrivate(const_cast<KConfigGroup *>(this), isGroupImmutableImpl(aGroup), true, aGroup);
536 parentGroup.d = new KConfigGroupPrivate(d->mOwner, d->mOwner->isImmutable(), d->bConst, QString());
602 return (isImmutable() || !config()->d_func()->canWriteEntry(d->fullName(), key, config()->readDefaults()));
681 const QByteArray data = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchLocalized);
724QStringList KConfigGroup::readXdgListEntry(const QString &key, const QStringList &aDefault) const
831 config()->d_func()->putData(d->fullName(), key, value.isNull() ? QByteArray("") : value, flags);
834void KConfigGroup::writeEntry(const QString &key, const QByteArray &value, WriteConfigFlags pFlags)
854void KConfigGroup::writeEntry(const QString &key, const QStringList &list, WriteConfigFlags flags)
1000 qCWarning(KCONFIG_CORE_LOG) << "KConfigGroup::writeEntry was passed GUI type '" << value.typeName()
1014void KConfigGroup::writeEntry(const QString &key, const QVariant &value, WriteConfigFlags flags)
1019void KConfigGroup::writeEntry(const QString &key, const QVariantList &list, WriteConfigFlags flags)
1024void KConfigGroup::writeXdgListEntry(const QString &key, const QStringList &value, WriteConfigFlags pFlags)
1029void KConfigGroup::writeXdgListEntry(const char *key, const QStringList &list, WriteConfigFlags flags)
1040 val.replace(QLatin1Char('\\'), QLatin1String("\\\\")).replace(QLatin1Char(';'), QLatin1String("\\;"));
1047void KConfigGroup::writePathEntry(const QString &pKey, const QString &path, WriteConfigFlags pFlags)
1052void KConfigGroup::writePathEntry(const char *pKey, const QString &path, WriteConfigFlags pFlags)
1060void KConfigGroup::writePathEntry(const QString &pKey, const QStringList &value, WriteConfigFlags pFlags)
1065void KConfigGroup::writePathEntry(const char *pKey, const QStringList &value, WriteConfigFlags pFlags)
1076 config()->d_func()->putData(d->fullName(), pKey, KConfigGroupPrivate::serializeList(list), pFlags, true);
1229 const auto entry = config()->d_ptr->lookupInternalEntry(groupName, key, KEntryMap::SearchLocalized);
1231 // Only write the entry if it is not null, if it is a global enry there is no point in moving it
1247void 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
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
KConfigGroup group(const QString &group)
Returns an object for the named subgroup.
Definition kconfigbase.cpp:21
void reparent(KConfigBase *parent, WriteConfigFlags pFlags=Normal)
Changes the configuration object that this group belongs to.
Definition kconfiggroup.cpp:1212
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:1024
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:1114
bool hasKey(const QString &key) const
Checks whether the key has an entry in this group.
Definition kconfiggroup.cpp:1131
QString readPathEntry(const QString &pKey, const QString &aDefault) const
Reads a path.
Definition kconfiggroup.cpp:764
bool hasGroupImpl(const QString &groupName) const override
Definition kconfiggroup.cpp:1171
void writePathEntry(const QString &pKey, const QString &path, WriteConfigFlags pFlags=Normal)
Writes a file path to the configuration.
Definition kconfiggroup.cpp:1047
void revertToDefault(const QString &key, WriteConfigFlags pFlag=WriteConfigFlags())
Reverts an entry to the default settings.
Definition kconfiggroup.cpp:1100
bool isEntryImmutable(const QString &key) const
Checks if it is possible to change the given entry.
Definition kconfiggroup.cpp:605
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
Writes a value to the configuration object.
Definition kconfiggroup.cpp:1014
void deleteGroup(WriteConfigFlags pFlags=Normal)
Delete all entries in the entire group.
Definition kconfiggroup.cpp:544
void deleteGroupImpl(const QString &groupName, WriteConfigFlags flags) override
Definition kconfiggroup.cpp:1178
bool isGroupImmutableImpl(const QString &groupName) const override
Definition kconfiggroup.cpp:1186
KConfig * config()
Return the config object that this group belongs to.
Definition kconfiggroup.cpp:584
bool exists() const
Check whether the containing KConfig object actually contains a group with this name.
Definition kconfiggroup.cpp:559
void deleteEntry(const QString &pKey, WriteConfigFlags pFlags=Normal)
Deletes the entry specified by pKey in the current group.
Definition kconfiggroup.cpp:1087
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:1247
KConfigGroup parent() const
Returns the group that this group belongs to.
Definition kconfiggroup.cpp:527
QMap< QString, QString > entryMap() const
Returns a map (tree) of entries for all entries in this group.
Definition kconfiggroup.cpp:577
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:724
QString readEntryUntranslated(const QString &pKey, const QString &aDefault=QString()) const
Reads an untranslated string entry.
Definition kconfiggroup.cpp:610
KConfigGroup groupImpl(const QString &groupName) override
Definition kconfiggroup.cpp:503
QStringList keyList() const
Returns a list of keys this group contains.
Definition kconfiggroup.cpp:1150
void copyTo(KConfigBase *other, WriteConfigFlags pFlags=Normal) const
Copies the entries in this group to another configuration object.
Definition kconfiggroup.cpp:1197
QMap< QString, QString > entryMap(const QString &aGroup=QString()) const
Returns a map (tree) of entries in a particular group.
Definition kconfig.cpp:382
Q_SCRIPTABLE Q_NOREPLY void start()
QString name(GameStandardAction id)
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
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
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
int hour() const const
int minute() const const
int msec() const const
int second() 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-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.