diff options
author | Thiago Macieira <thiago.macieira@trolltech.com> | 2006-03-28 18:56:08 +0000 |
---|---|---|
committer | John Palmieri <johnp@remedyz.boston.redhat.com> | 2006-06-28 08:15:13 -0400 |
commit | ed506643a1016ac8510634f0ac358433338f81b2 (patch) | |
tree | 6b7c50cd4367e121bd8f488910fa3eecff555d22 /qt/qdbuserror.h | |
parent | c4fa768951cfce4d5bb8d02beb69024bc1868d5a (diff) |
* qt/*: * dbus/qdbus.h: Sync with KDE Subversion revision 523647. Hopefully, this will be the last of the source-incompatible changes. Documentation has been improved; support for QList<basic-types> has been added; QDBusObject is gone; QDBus(Abstract)Interface is now a QObject with auto-generated meta-object; QDBusIntrospection is marked private, since QMetaObject can be used now; lots of bugfixes.
Diffstat (limited to 'qt/qdbuserror.h')
-rw-r--r-- | qt/qdbuserror.h | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/qt/qdbuserror.h b/qt/qdbuserror.h index da3d026..71c636d 100644 --- a/qt/qdbuserror.h +++ b/qt/qdbuserror.h @@ -34,20 +34,58 @@ class QDBusMessage; class QDBUS_EXPORT QDBusError { public: + enum KnownErrors { + NoError = 0, + Other = 1, + Failed, + NoMemory, + ServiceUnknown, + NoReply, + BadAddress, + NotSupported, + LimitsExceeded, + AccessDenied, + NoServer, + Timeout, + NoNetwork, + AddressInUse, + Disconnected, + InvalidArgs, + UnknownMethod, + TimedOut, + InvalidSignature, + UnknownInterface, + InternalError, + +#ifndef Q_QDOC + // don't use this one! + qKnownErrorsMax = InternalError +#endif + }; + QDBusError(const DBusError *error = 0); QDBusError(const QDBusMessage& msg); - inline QDBusError(const QString &name, const QString &message) - : nm(name), msg(message) - { } + QDBusError(KnownErrors error, const QString &message); inline QString name() const { return nm; } inline QString message() const { return msg; } inline bool isValid() const { return !nm.isNull() && !msg.isNull(); } + inline bool operator==(KnownErrors error) const + { return code == error; } + private: + KnownErrors code; QString nm, msg; }; +inline bool operator==(QDBusError::KnownErrors p1, const QDBusError &p2) +{ return p2 == p1; } +inline bool operator!=(QDBusError::KnownErrors p1, const QDBusError &p2) +{ return !(p2 == p1); } +inline bool operator!=(const QDBusError &p1, QDBusError::KnownErrors p2) +{ return !(p1 == p2); } + #ifndef QT_NO_DEBUG QDebug operator<<(QDebug, const QDBusError &); #endif |