[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdecore/config
From: Alex Merry <kde () randomguy3 ! me ! uk>
Date: 2008-12-15 23:11:40
Message-ID: 1229382700.018047.2360.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 897391 by alexmerry:
More docs fixes.
M +13 -1 kconfig.h
M +37 -26 kcoreconfigskeleton.h
M +58 -20 ksharedconfig.h
--- trunk/KDE/kdelibs/kdecore/config/kconfig.h #897390:897391
@@ -113,11 +113,15 @@
* to influence the values returned by this object. See OpenFlags for
* more details.
*
+ * @note You probably want to use KSharedConfig::openConfig instead.
+ *
* @param file the name of the file
* @param mode how global settings should affect the configuration
* options exposed by this KConfig object
* @param resourceType The standard directory to look for the configuration
- * file in
+ * file in (see KStandardDirs)
+ *
+ * @sa KSharedConfig::openConfig(const QString&, OpenFlags, const char*)
*/
explicit KConfig(const QString& file = QString(), OpenFlags mode = FullConfig,
const char* resourceType = "config");
@@ -132,6 +136,12 @@
* specified by resourceType. If no path is provided, a default
* configuration file will be used based on the component's name.
*
+ * @p mode determines whether the user or global settings will be allowed
+ * to influence the values returned by this object. See KConfig::OpenFlags for
+ * more details.
+ *
+ * @note You probably want to use KSharedConfig::openConfig instead.
+ *
* @param componentData the component that you wish to load a configuration
* file for
* @param file overrides the configuration file name if not empty
@@ -140,6 +150,8 @@
* See OpenFlags
* @param resourceType The standard directory to look for the configuration
* file in
+ *
+ * @sa KSharedConfig::openConfig(const KComponentData&, const QString&, \
OpenFlags, const char*)
*/
explicit KConfig(const KComponentData& componentData, const QString& file = \
QString(),
OpenFlags mode = FullConfig, const char* resourceType = \
"config");
--- trunk/KDE/kdelibs/kdecore/config/kcoreconfigskeleton.h #897390:897391
@@ -154,15 +154,15 @@
virtual void setProperty(const QVariant &p) = 0;
/**
- * Check whether the item is equal to v.
+ * Check whether the item is equal to p.
*
* Use this function to compare items that use custom types such as KUrl,
* because QVariant::operator== will not work for those.
*
- * @param v QVariant to compare to
- * @return true if the item is equal to v, false otherwise
+ * @param p QVariant to compare to
+ * @return true if the item is equal to p, false otherwise
*/
- virtual bool isEqual(const QVariant &v) const = 0;
+ virtual bool isEqual(const QVariant &p) const = 0;
/**
* Return item as property
@@ -406,10 +406,10 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
- /** @copydoc KConfigSkeletonItem::property() */
+ /** @copydoc KConfigSkeletonItem::property() const */
QVariant property() const;
private:
@@ -462,10 +462,10 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
- /** @copydoc KConfigSkeletonItem::property() */
+ /** @copydoc KConfigSkeletonItem::property() const */
QVariant property() const;
};
@@ -482,9 +482,10 @@
void readConfig(KConfig * config);
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
+ /** @copydoc KConfigSkeletonItem::property() const */
QVariant property() const;
};
@@ -505,10 +506,10 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
- /** @copydoc KConfigSkeletonItem::property() */
+ /** @copydoc KConfigSkeletonItem::property() const */
QVariant property() const;
};
@@ -529,7 +530,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -574,7 +575,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -664,7 +665,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -705,7 +706,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -747,7 +748,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -789,7 +790,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -813,7 +814,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -837,7 +838,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -862,7 +863,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -887,7 +888,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -932,7 +933,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -956,7 +957,7 @@
/** @copydoc KConfigSkeletonItem::setProperty(const QVariant&) */
void setProperty(const QVariant & p);
- /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) */
+ /** @copydoc KConfigSkeletonItem::isEqual(const QVariant &) const */
bool isEqual(const QVariant &p) const;
/** @copydoc KConfigSkeletonItem::property() */
@@ -969,21 +970,23 @@
* Constructor.
*
* @param configname name of config file. If no name is given, the default
- * config file as returned by KGlobal::config() is used.
+ * config file as returned by KGlobal::config() is used
+ * @param parent the parent object (see QObject documentation)
*/
explicit KCoreConfigSkeleton(const QString & configname = QString(), QObject* \
parent = 0);
/**
* Constructor.
*
- * @param config configuration object to use.
+ * @param config configuration object to use
+ * @param parent the parent object (see QObject documentation)
*/
explicit KCoreConfigSkeleton(KSharedConfig::Ptr config, QObject* parent = 0);
/**
* Destructor
*/
- virtual ~ KCoreConfigSkeleton();
+ virtual ~KCoreConfigSkeleton();
/**
* Set all registered items to their default values.
@@ -1164,6 +1167,10 @@
qint64 defaultValue = 0,
const QString & key = QString());
+ /**
+ * @deprecated
+ * Use addItemLongLong().
+ */
KDE_DEPRECATED ItemLongLong *addItemInt64( const QString& name, qint64 &reference,
qint64 defaultValue = 0,
const QString & key = QString());
@@ -1183,6 +1190,10 @@
quint64 defaultValue = 0,
const QString & key = QString());
+ /**
+ * @deprecated
+ * Use addItemULongLong().
+ */
KDE_DEPRECATED ItemULongLong *addItemUInt64(const QString & name, quint64 \
&reference, quint64 defaultValue = 0,
const QString & key = QString());
--- trunk/KDE/kdelibs/kdecore/config/ksharedconfig.h #897390:897391
@@ -27,11 +27,15 @@
/**
* \class KSharedConfig ksharedconfig.h <KSharedConfig>
- *
+ *
* KConfig variant using shared memory
*
* KSharedConfig provides a reference counted, shared memory variant
- * of KConfig.
+ * of KConfig. This allows you to use manipulate the same configuration
+ * files from different places in your code without worrying about
+ * accidentally overwriting changes.
+ *
+ * Note that, as with most of kdelibs, this is @b NOT threadsafe.
*/
class KDECORE_EXPORT KSharedConfig : public KConfig, public QSharedData \
//krazy:exclude=dpointer (only for refcounting) {
@@ -39,25 +43,59 @@
typedef KSharedPtr<KSharedConfig> Ptr;
public:
- /**
- * Constructs a KSharedConfig object.
- *
- * @param fileName A file to parse in addition to the
- * system-wide file(s). If it is not provided, only global
- * KDE configuration data will be read (depending on the value of
- * @p mode).
- * @param mode
- * @param resourceType the place to look in (config, data, etc) @see \
KStandardDirs.
- * @param backend
- */
- static KSharedConfig::Ptr openConfig(const QString& fileName = QString(),
- OpenFlags mode = FullConfig,
- const char *resourceType = "config");
+ /**
+ * Creates a KSharedConfig object to manipulate a configuration file
+ *
+ * If an absolute path is specified for @p fileName, that file will be used
+ * as the store for the configuration settings. If a non-absolute path
+ * is provided, the file will be looked for in the standard directory
+ * specified by resourceType. If no path is provided, a default
+ * configuration file will be used based on the name of the main
+ * application component.
+ *
+ * @p mode determines whether the user or global settings will be allowed
+ * to influence the values returned by this object. See KConfig::OpenFlags for
+ * more details.
+ *
+ * @param fileName the configuration file to open
+ * @param mode how global settings should affect the configuration
+ * options exposed by this KConfig object
+ * @param resourceType The standard directory to look for the configuration
+ * file in (see KStandardDirs)
+ *
+ * @sa KConfig::KConfig(const QString&, OpenFlags, const char*)
+ */
+ static KSharedConfig::Ptr openConfig(const QString& fileName = QString(),
+ OpenFlags mode = FullConfig,
+ const char *resourceType = "config");
- static KSharedConfig::Ptr openConfig(const KComponentData &componentData,
- const QString &fileName = QString(),
- OpenFlags mode = FullConfig,
- const char *resourceType = "config");
+ /**
+ * Constructs a KSharedConfig object.
+ *
+ * If an absolute path is specified for @p fileName, that file will be used
+ * as the store for the configuration settings. If a non-absolute path
+ * is provided, the file will be looked for in the standard directory
+ * specified by resourceType. If no path is provided, a default
+ * configuration file will be used based on the component's name.
+ *
+ * @p mode determines whether the user or global settings will be allowed
+ * to influence the values returned by this object. See KConfig::OpenFlags for
+ * more details.
+ *
+ * @param componentData the component that you wish to load a configuration
+ * file for
+ * @param fileName the configuration file to open
+ * @param mode how global settings should affect the configuration
+ * options exposed by this KConfig object
+ * @param resourceType The standard directory to look for the configuration
+ * file in (see KStandardDirs)
+ *
+ * @sa KConfig::KConfig(const KComponentData&, const QString&, OpenFlags, const \
char*) + */
+ static KSharedConfig::Ptr openConfig(const KComponentData &componentData,
+ const QString &fileName = QString(),
+ OpenFlags mode = FullConfig,
+ const char *resourceType = "config");
virtual ~KSharedConfig();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic