summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2012-04-05 17:36:11 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2012-04-05 18:24:53 +0300
commit9c2cfb2feef1388e5a17ba3d23313f355203c133 (patch)
tree48d94c81bf70f4a360abc51ed25ffdd48948e133
parent135b9e0fbd5b821f755f977e7985d0d27a1ec916 (diff)
DBusError: Add documentation
-rw-r--r--TelepathyQt/dbus-error.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/TelepathyQt/dbus-error.cpp b/TelepathyQt/dbus-error.cpp
index 4c99bed6..c4768789 100644
--- a/TelepathyQt/dbus-error.cpp
+++ b/TelepathyQt/dbus-error.cpp
@@ -39,20 +39,47 @@ struct TP_QT_NO_EXPORT DBusError::Private
QString message;
};
+/**
+ * \class DBusError
+ * \ingroup servicesideimpl
+ * \headerfile TelepathyQt/dbus-error.h <TelepathyQt/DBusError>
+ *
+ * \brief Small container class, containing a D-Bus error
+ */
+
+/**
+ * Construct an empty DBusError
+ */
DBusError::DBusError()
: mPriv(0)
{
}
+/**
+ * Construct a DBusError with the given error \a name and \a message.
+ *
+ * \param name The D-Bus error name.
+ * \param message A human-readable description of the error.
+ */
DBusError::DBusError(const QString &name, const QString &message)
: mPriv(new Private(name, message))
{
}
+/**
+ * Class destructor.
+ */
DBusError::~DBusError()
{
}
+/**
+ * Compare this error with another one.
+ *
+ * \param other The other error to compare to.
+ * \return \c true if the two errors have the same name and message
+ * or \c false otherwise.
+ */
bool DBusError::operator==(const DBusError &other) const
{
if (!isValid() || !other.isValid()) {
@@ -66,6 +93,13 @@ bool DBusError::operator==(const DBusError &other) const
mPriv->message == other.mPriv->message;
}
+/**
+ * Compare this error with another one.
+ *
+ * \param other The other error to compare to.
+ * \return \c false if the two errors have the same name and message
+ * or \c true otherwise.
+ */
bool DBusError::operator!=(const DBusError &other) const
{
if (!isValid() || !other.isValid()) {
@@ -79,6 +113,11 @@ bool DBusError::operator!=(const DBusError &other) const
mPriv->message != other.mPriv->message;
}
+/**
+ * Return the D-Bus name of this error.
+ *
+ * \return The D-Bus name of this error.
+ */
QString DBusError::name() const
{
if (!isValid()) {
@@ -88,6 +127,11 @@ QString DBusError::name() const
return mPriv->name;
}
+/**
+ * Return the human-readable description of the error.
+ *
+ * \return The human-readable description of the error.
+ */
QString DBusError::message() const
{
if (!isValid()) {
@@ -97,6 +141,12 @@ QString DBusError::message() const
return mPriv->message;
}
+/**
+ * Set this DBusError to contain the given error \a name and \a message.
+ *
+ * \param name The D-Bus error name to set.
+ * \param message The description of the error to set.
+ */
void DBusError::set(const QString &name, const QString &message)
{
if (!isValid()) {
@@ -108,4 +158,13 @@ void DBusError::set(const QString &name, const QString &message)
mPriv->message = message;
}
+/**
+ * \fn bool DBusError::isValid() const
+ *
+ * Return whether this DBusError is set to contain an error or not.
+ *
+ * \return \c true if the error name and message have been set,
+ * or \c false otherwise.
+ */
+
} // Tp