| 1 | /* |
| 2 | * This file is part of libOnlineAccounts |
| 3 | * |
| 4 | * Copyright (C) 2015 Canonical Ltd. |
| 5 | * |
| 6 | * Contact: Alberto Mardegan <[email protected]> |
| 7 | * |
| 8 | * This program is free software: you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU Lesser General Public License version 3, as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranties of |
| 14 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
| 15 | * PURPOSE. See the GNU Lesser General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Lesser General Public License |
| 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #include "error_p.h"cxx . . $ `<file>/online-accounts/lib/qt/LomiriOnlineAccounts/error_p.h`/ |
| 22 | |
| 23 | #include <QDBusError> |
| 24 | #include <LomiriOnlineAccountsDaemon/dbus_constants.h>cxx . . $ `<file>/online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h`/ |
| 25 | |
| 26 | namespace OnlineAccountscxx . . $ OnlineAccounts/ { |
| 27 | |
| 28 | Errorcxx . . $ OnlineAccounts/Error# errorFromDBuscxx . . $ OnlineAccounts/errorFromDBus(62a4ea1bea413afc).(const QDBusErrorcxx . . $ QDBusError# &dbusError) |
| 29 | { |
| 30 | Errorcxx . . $ OnlineAccounts/Error#::Codecxx . . $ OnlineAccounts/Error#Code# code = Errorcxx . . $ OnlineAccounts/Error#::PermissionDeniedcxx . . $ OnlineAccounts/Error#PermissionDenied.; |
| 31 | QStringcxx . . $ QString# name = dbusError.namecxx . . $ QDBusError#name(6ef7b6c27b00b43d).(); |
| 32 | if (name ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). ONLINE_ACCOUNTS_ERROR_NO_ACCOUNTcxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:50:9`!) { |
| 33 | code = Errorcxx . . $ OnlineAccounts/Error#::NoAccountcxx . . $ OnlineAccounts/Error#NoAccount.; |
| 34 | } else if (name ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). ONLINE_ACCOUNTS_ERROR_USER_CANCELEDcxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:52:9`!) { |
| 35 | code = Errorcxx . . $ OnlineAccounts/Error#::UserCanceledcxx . . $ OnlineAccounts/Error#UserCanceled.; |
| 36 | } else if (name ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). ONLINE_ACCOUNTS_ERROR_INTERACTION_REQUIREDcxx . . $ `online-accounts-daemon/lib/LomiriOnlineAccountsDaemon/dbus_constants.h:56:9`!) { |
| 37 | code = Errorcxx . . $ OnlineAccounts/Error#::InteractionRequiredcxx . . $ OnlineAccounts/Error#InteractionRequired.; |
| 38 | } |
| 39 | return Errorcxx . . $ OnlineAccounts/Error#Error(87f22122582033ec).(code, dbusError.messagecxx . . $ QDBusError#message(6ef7b6c27b00b43d).()); |
| 40 | } |
| 41 | |
| 42 | } // namespace |