From c2432800b1d387c5512e605ba92060d4827b7606 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Feb 2006 16:25:12 +0000 Subject: Merge the changes to the bindings from the KDE Subversion server. This is a major change: library is source- and binary-incompatible to what it used to be. All testcases are green, functionality is preserved. It is not feature-complete. Development will continue in the branch in the Subversion server for a while. --- qt/qdbuserror.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'qt/qdbuserror.cpp') diff --git a/qt/qdbuserror.cpp b/qt/qdbuserror.cpp index 0f7dc92c..64b68b37 100644 --- a/qt/qdbuserror.cpp +++ b/qt/qdbuserror.cpp @@ -1,6 +1,8 @@ /* qdbuserror.h QDBusError object * * Copyright (C) 2005 Harald Fernengel + * Copyright (C) 2006 Trolltech AS. All rights reserved. + * Author: Thiago Macieira * * Licensed under the Academic Free License version 2.1 * @@ -15,16 +17,17 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * along with this program; if not, write to the Free Software Foundation + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "qdbuserror.h" -#include +#include #include +#include "qdbusmessage.h" QDBusError::QDBusError(const DBusError *error) { @@ -35,6 +38,16 @@ QDBusError::QDBusError(const DBusError *error) msg = QString::fromUtf8(error->message); } +QDBusError::QDBusError(const QDBusMessage &qdmsg) +{ + if (qdmsg.type() != QDBusMessage::ErrorMessage) + return; + + nm = qdmsg.name(); + if (qdmsg.count()) + msg = qdmsg[0].toString(); +} + #ifndef QT_NO_DEBUG QDebug operator<<(QDebug dbg, const QDBusError &msg) { -- cgit