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) {
175 newpath = QFile::encodeName(KGlobal::dirs()->resourceDirs("exe").join(QChar::fromLatin1(KPATH_SEPARATOR)));
296 for (KEntryMap::ConstIterator entryMapIt( d->entryMap.constBegin() ); entryMapIt != d->entryMap.constEnd(); ++entryMapIt) {
313 for (KEntryMap::ConstIterator entryMapIt( entryMap.constBegin() ); entryMapIt != entryMap.constEnd(); ++entryMapIt) {
331 for (KEntryMap::const_iterator entryMapIt = entryMap.begin(); entryMapIt != entryMap.end(); ++entryMapIt) {
461 if (!tmp->writeConfig(utf8Locale, d->entryMap, KConfigBackend::WriteGlobal, d->componentData)) {
472 if (!d->mBackend->writeConfig(utf8Locale, d->entryMap, KConfigBackend::WriteOptions(), d->componentData)) {
507 KToolInvocation::kdeinitExecWait(QString::fromLatin1("kconf_update"), QStringList() << QString::fromLatin1("--check") << updateFile);
612 foreach (const QString& dir2, dirs->findAllResources("config", QLatin1String("system.kdeglobals")))
628 KConfigBackend::ParseOptions parseOpts = KConfigBackend::ParseGlobal|KConfigBackend::ParseExpansions;
832 // Note: We don't ask the user if we should not ask this question again because we can't save the answer.
858 bool KConfigPrivate::canWriteEntry(const QByteArray& group, const char* key, bool isDefault) const
void checkUpdate(const QString &id, const QString &updateFile)
Ensures that the configuration file contains a certain update.
Definition: kconfig.cpp:501
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:325
Definition: kconfigdata.h:165
virtual bool isLocked() const =0
Definition: kconfigdata.h:162
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:535
QString name() const
Returns the filename used to store the configuration.
Definition: kconfig.cpp:529
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
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
virtual KConfigBase::AccessMode accessMode() const =0
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:285
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
void revertEntry(const QByteArray &group, const char *key)
Definition: kconfig.cpp:884
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:910
virtual void deleteGroupImpl(const QByteArray &group, WriteConfigFlags flags=Normal)
Definition: kconfig.cpp:804
QMap< QString, QString > entryMap(const QString &aGroup=QString()) const
Returns a map (tree) of entries in a particular group.
Definition: kconfig.cpp:382
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:512
Definition: kconfigdata.h:169
bool canWriteEntry(const QByteArray &group, const char *key, bool isDefault=false) const
Definition: kconfig.cpp:858
Definition: kconfigbackend.h:94
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:848
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.
QString getEntry(const QByteArray &group, const QByteArray &key, const QString &defaultValue=QString(), SearchFlags flags=SearchFlags(), bool *expand=0) const
Definition: kconfigdata.cpp:209
Definition: kconfigbase.h:38
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
KConfig * config()
Return the config object that this group belongs to.
Definition: kconfiggroup.cpp:610
QStringList groupList(const QByteArray &group) const
Definition: kconfig.cpp:308
QString lookupData(const QByteArray &group, const char *key, KEntryMap::SearchFlags flags, bool *expand) const
Definition: kconfig.cpp:902
Definition: kconfigbase.h:133
Iterator findEntry(const QByteArray &group, const QByteArray &key=QByteArray(), SearchFlags flags=SearchFlags())
virtual bool isGroupImmutableImpl(const QByteArray &aGroup) const
Definition: kconfig.cpp:759
Definition: kconfigbackend.h:110
QStringList keyListImpl(const QByteArray &theGroup) const
Definition: kconfig.cpp:354
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:583
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:144
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:241
bool getEntryOption(const ConstIterator &it, EntryOption option) const
KEntryMap::EntryOptions convertToOptions(KConfig::WriteConfigFlags flags)
Definition: kconfig.cpp:791
Definition: kconfigdata.h:157
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
Definition: kconfigdata.h:163
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:340
void putData(const QByteArray &group, const char *key, const QByteArray &value, KConfigBase::WriteConfigFlags flags, bool expand=false)
Definition: kconfig.cpp:866
Definition: kconfigdata.h:156
static QString defaultLanguage()
Returns the name of the internal language.
Definition: klocale.cpp:615
bool isConfigWritable(bool warnUser)
Whether the configuration can be written to.
Definition: kconfig.cpp:822
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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.