KDECore
kconfig.cpp
Go to the documentation of this file.
63 sGlobalFileName = componentData.dirs()->saveLocation("config", QString(), false) + QLatin1String("kdeglobals");
84 // KSharedPtr<KConfigBackend> backend = KConfigBackend::create(componentData, etc_kderc, QLatin1String("INI"));
89 // KSharedPtr<KConfigBackend> backend = KConfigBackend::create(componentData, kde4rc, QLatin1String("INI"));
121 for (KEntryMap::ConstIterator entryMapIt( entryMap.constBegin() ); entryMapIt != entryMap.constEnd(); ++entryMapIt) {
266 for (KEntryMap::ConstIterator entryMapIt( d->entryMap.constBegin() ); entryMapIt != d->entryMap.constEnd(); ++entryMapIt) {
283 for (KEntryMap::ConstIterator entryMapIt( entryMap.constBegin() ); entryMapIt != entryMap.constEnd(); ++entryMapIt) {
307 for (KEntryMap::const_iterator entryMapIt = entryMap.begin(); entryMapIt != entryMap.end(); ++entryMapIt) {
435 if (!tmp->writeConfig(utf8Locale, d->entryMap, KConfigBackend::WriteGlobal, d->componentData)) {
446 if (!d->mBackend->writeConfig(utf8Locale, d->entryMap, KConfigBackend::WriteOptions(), d->componentData)) {
481 KToolInvocation::kdeinitExecWait(QString::fromLatin1("kconf_update"), QStringList() << QString::fromLatin1("--check") << updateFile);
586 foreach (const QString& dir2, dirs->findAllResources("config", QLatin1String("system.kdeglobals")))
602 KConfigBackend::ParseOptions parseOpts = KConfigBackend::ParseGlobal|KConfigBackend::ParseExpansions;
806 // Note: We don't ask the user if we should not ask this question again because we can't save the answer.
832 bool KConfigPrivate::canWriteEntry(const QByteArray& group, const char* key, bool isDefault) const
int execute(const QString &program, const QStringList &arguments)
void checkUpdate(const QString &id, const QString &updateFile)
Ensures that the configuration file contains a certain update.
Definition: kconfig.cpp:475
QString saveLocation(const char *type, const QString &suffix=QString(), bool create=true) const
Finds a location to save files into for the given type in the user's home directory.
Definition: kstandarddirs.cpp:1478
QString i18n(const char *text)
Returns a localized version of a string.
Definition: klocalizedstring.h:630
QSet< QByteArray > allSubGroups(const QByteArray &parentGroup) const
Definition: kconfig.cpp:303
Definition: kconfigdata.h:165
virtual bool isLocked() const =0
Definition: kconfigdata.h:162
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
void copyGroup(const QByteArray &source, const QByteArray &destination, KConfigGroup *otherGroup, KConfigBase::WriteConfigFlags flags) const
Definition: kconfig.cpp:109
void changeFileName(const QString &fileName, const char *resourceType)
Definition: kconfig.cpp:509
bool contains(const Key &key) const
QString name() const
Returns the filename used to store the configuration.
Definition: kconfig.cpp:503
KConfigPrivate(const KComponentData &componentData_, KConfig::OpenFlags flags, const char *resource)
Definition: kconfig.cpp:56
QString from8Bit(const char *str)
Construct QString from a c string, guessing whether it is UTF8- or Local8Bit-encoded.
Definition: kstringhandler.cpp:289
static QString realFilePath(const QString &filename)
Expands all symbolic links and resolves references to '/.
Definition: kstandarddirs.cpp:973
Definition: kconfigdata.h:152
Definition: kconfigdata.h:164
static bool isGroupOrSubGroupMatch(const QByteArray &potentialGroup, const QByteArray &group)
Definition: kconfig.cpp:294
Definition: kmacroexpander_unix.cpp:34
Save the entry to the global KDE config file instead of the application specific config file...
Definition: kconfigbase.h:50
const_iterator constBegin() const
bool isNull() const
virtual KConfigBase::AccessMode accessMode() const =0
bool contains(const QString &str, Qt::CaseSensitivity cs) const
bool isEmpty() const
static QString expandString(const QString &value)
Definition: kconfig.cpp:155
const KComponentData & componentData() const
Returns the component data this configuration is for.
Definition: kconfig.cpp:255
void push_front(const T &value)
bool startsWith(const QByteArray &ba) const
static bool checkAccess(const QString &pathname, int mode)
Check, if a file may be accessed in a given mode.
Definition: kstandarddirs.cpp:2114
KConfigGroup group(const QByteArray &group)
Returns an object for the named subgroup.
Definition: kconfigbase.cpp:44
const KAboutData * aboutData() const
Returns the about data of this component.
Definition: kcomponentdata.cpp:215
int length() const
QString & remove(int position, int n)
void revertEntry(const QByteArray &group, const char *key)
Definition: kconfig.cpp:858
QString homePath()
Definition: kconfigbackend.h:103
Definition: kconfigdata.h:166
virtual void virtual_hook(int id, void *data)
Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.
Definition: kconfig.cpp:884
virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags=Normal)
Definition: kconfig.cpp:778
void clear()
QMap< QString, QString > entryMap(const QString &aGroup=QString()) const
Returns a map (tree) of entries in a particular group.
Definition: kconfig.cpp:356
virtual ParseInfo parseConfig(const QByteArray &locale, KEntryMap &pWriteBackMap, ParseOptions options=ParseOptions())=0
Read persistent storage.
KConfig * copyTo(const QString &file, KConfig *config=0) const
Copies all entries from this config object to a new config object that will save itself to file...
Definition: kconfig.cpp:486
Definition: kconfigdata.h:169
bool canWriteEntry(const QByteArray &group, const char *key, bool isDefault=false) const
Definition: kconfig.cpp:832
Definition: kconfigbackend.h:94
QString fromUtf8(const char *str, int size)
key structure holding both the actual key and the group to which it belongs.
Definition: kconfigdata.h:89
virtual bool hasGroupImpl(const QByteArray &group) const
Definition: kconfig.cpp:822
bool isEmpty() const
bool isEmpty() const
const_iterator constEnd() const
const char * constData() const
QByteArray & replace(int pos, int len, const char *after)
Definition: kconfig_p.h:42
virtual bool writeConfig(const QByteArray &locale, KEntryMap &entryMap, WriteOptions options, const KComponentData &data)=0
Write the dirty entries to permanent storage.
iterator end()
QString getEntry(const QByteArray &group, const QByteArray &key, const QString &defaultValue=QString(), SearchFlags flags=SearchFlags(), bool *expand=0) const
Definition: kconfigdata.cpp:209
QByteArray mid(int pos, int len) const
Definition: kconfigbase.h:38
iterator begin()
bool setEntry(const QByteArray &group, const QByteArray &key, const QByteArray &value, EntryOptions options)
Returns true if the entry gets dirtied or false in other case.
the configuration was opened read/write
Definition: kconfigbackend.h:111
Definition: kconfigbase.h:133
QString & replace(int position, int n, QChar after)
KConfig * config()
Return the config object that this group belongs to.
Definition: kconfiggroup.cpp:610
QStringList groupList(const QByteArray &group) const
Definition: kconfig.cpp:278
QString lookupData(const QByteArray &group, const char *key, KEntryMap::SearchFlags flags, bool *expand) const
Definition: kconfig.cpp:876
Definition: kconfigbase.h:133
bool isAbsolutePath(const QString &path)
QByteArray toLatin1() const
Iterator findEntry(const QByteArray &group, const QByteArray &key=QByteArray(), SearchFlags flags=SearchFlags())
QString mid(int position, int n) const
virtual bool isGroupImmutableImpl(const QByteArray &aGroup) const
Definition: kconfig.cpp:733
Definition: kconfigbackend.h:110
QStringList keyListImpl(const QByteArray &theGroup) const
Definition: kconfig.cpp:328
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
This function is much like locate.
Definition: kstandarddirs.cpp:2091
void reparseConfiguration()
Updates the state of this object to match the persistent storage.
Definition: kconfig.cpp:557
bool isRestrictedResource(const char *type, const QString &relPath=QString()) const
Checks whether a resource is restricted as part of the KIOSK framework.
Definition: kstandarddirs.cpp:254
static int kdeinitExecWait(const QString &name, const QStringList &args=QStringList(), QString *error=0, int *pid=0, const QByteArray &startup_id=QByteArray())
Starts a program via kdeinit and wait for it to finish.
Definition: ktoolinvocation.cpp:240
static QString findExe(const QString &appname, const QString &pathstr=QString(), SearchOptions options=NoSearchOptions)
Finds the executable in the system path.
Definition: kstandarddirs.cpp:1328
const KComponentData & mainComponent()
Returns the global component data.
Definition: kglobal.cpp:145
int length() const
KConfig(const QString &file=QString(), OpenFlags mode=FullConfig, const char *resourceType="config")
Creates a KConfig object to manipulate a configuration file for the current application.
Definition: kconfig.cpp:211
QString left(int n) const
bool getEntryOption(const ConstIterator &it, EntryOption option) const
QList< T > toList() const
QString fromLatin1(const char *str, int size)
KEntryMap::EntryOptions convertToOptions(KConfig::WriteConfigFlags flags)
Definition: kconfig.cpp:765
void prepend(const T &value)
Definition: kconfigdata.h:157
iterator insert(const Key &key, const T &value)
QStringList findAllResources(const char *type, const QString &filter=QString(), SearchOptions options=NoSearchOptions) const
Tries to find all resources with the specified type.
Definition: kstandarddirs.cpp:900
typedef ConstIterator
Definition: kconfigdata.h:163
int compare(const QString &other) const
static KSharedPtr< KConfigBackend > create(const KComponentData &componentData, const QString &fileName=QString(), const QString &system=QString())
Creates a new KConfig backend.
Definition: kconfigbackend.cpp:64
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:248
bool hasNonDeletedEntries(const QByteArray &group) const
Definition: kconfig.cpp:316
void putData(const QByteArray &group, const char *key, const QByteArray &value, KConfigBase::WriteConfigFlags flags, bool expand=false)
Definition: kconfig.cpp:840
Definition: kconfigdata.h:156
static QString defaultLanguage()
Returns the name of the internal language.
Definition: klocale.cpp:615
QString decodeName(const QByteArray &localFileName)
bool isConfigWritable(bool warnUser)
Whether the configuration can be written to.
Definition: kconfig.cpp:796
bool revertEntry(const QByteArray &group, const QByteArray &key, SearchFlags flags=SearchFlags())
Definition: kconfigdata.cpp:289
KStandardDirs * dirs() const
Returns the application standard dirs object.
Definition: kcomponentdata.cpp:193
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.