summaryrefslogtreecommitdiffstats
path: root/qt/qdbuserror.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt/qdbuserror.cpp')
-rw-r--r--qt/qdbuserror.cpp19
1 files changed, 16 insertions, 3 deletions
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 <harry@kdevelop.org>
+ * Copyright (C) 2006 Trolltech AS. All rights reserved.
+ * Author: Thiago Macieira <thiago.macieira@trolltech.com>
*
* 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 <QtCore/qdebug.h>
+#include <qdebug.h>
#include <dbus/dbus.h>
+#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)
{