| 1 | /* |
| 2 | * This file is part of libAuthentication |
| 3 | * |
| 4 | * Copyright (C) 2017-2020 Alberto Mardegan <[email protected]> |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Lesser General Public License |
| 8 | * version 2.1 as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 18 | * 02110-1301 USA |
| 19 | */ |
| 20 | |
| 21 | #include "qml-loopback-server.h"cxx . . $ `<file>/online-accounts-plugins/lib/module/qml-loopback-server.h`/ |
| 22 | |
| 23 | #include <QDebug> |
| 24 | |
| 25 | using namespace OnlineAccountsPlugin; |
| 26 | |
| 27 | namespace OnlineAccountsPlugincxx . . $ OnlineAccountsPlugin/ { |
| 28 | |
| 29 | class QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#: public QObjectcxx . . $ QObject# |
| 30 | { |
| 31 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 32 | Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(QmlLoopbackServer) |
| 33 | |
| 34 | public: |
| 35 | QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#QmlLoopbackServerPrivate(b1a0970d3ce330b3).(QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer# *q); |
| 36 | ~cxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#`~QmlLoopbackServerPrivate`(ced63f7c635d850d).QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#(); |
| 37 | |
| 38 | void queueUpdatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#queueUpdate(49f6e7a06ebc5aa8).(); |
| 39 | |
| 40 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 41 | void updatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#update(49f6e7a06ebc5aa8).(); |
| 42 | |
| 43 | private: |
| 44 | bool m_updateQueuedcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_updateQueued.; |
| 45 | int m_portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_port.; |
| 46 | bool m_listeningcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_listening.; |
| 47 | QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer# *q_ptrcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#q_ptr.; |
| 48 | }; |
| 49 | |
| 50 | } // namespace |
| 51 | |
| 52 | QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#::QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#QmlLoopbackServerPrivate(b1a0970d3ce330b3).(QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer# *q): |
| 53 | m_portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_port.(0), |
| 54 | m_listeningcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_listening.(true), |
| 55 | q_ptrcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#q_ptr.(q) |
| 56 | { |
| 57 | } |
| 58 | |
| 59 | QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#::~cxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#`~QmlLoopbackServerPrivate`(ced63f7c635d850d).QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#() |
| 60 | { |
| 61 | } |
| 62 | |
| 63 | void QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#::queueUpdatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#queueUpdate(49f6e7a06ebc5aa8).() |
| 64 | { |
| 65 | if (!m_updateQueuedcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_updateQueued.) { |
| 66 | QMetaObjectcxx . . $ QMetaObject#::invokeMethodcxx . . $ QMetaObject#invokeMethod(e68f8f4d8ced89c3).(this, "update", Qtcxx . . $ Qt/::QueuedConnectioncxx . . $ Qt/QueuedConnection.); |
| 67 | m_updateQueuedcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_updateQueued. = true; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | void QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#::updatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#update(49f6e7a06ebc5aa8).() |
| 72 | { |
| 73 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(QmlLoopbackServer); |
| 74 | |
| 75 | m_updateQueuedcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_updateQueued. = false; |
| 76 | |
| 77 | bool nothingToDo = m_listeningcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_listening. == q->isListeningcxx . . $ OnlineAccountsPlugin/LoopbackServer#isListening(50ce9a9e25b4a850).(); |
| 78 | if (nothingToDo) return; |
| 79 | |
| 80 | if (m_listeningcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_listening.) { |
| 81 | if (q->listencxx . . $ OnlineAccountsPlugin/LoopbackServer#listen(3c978dac0e5ee2ad).(uint16_tcxx . . $ uint16_t#(m_portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_port.))) { |
| 82 | uint16_tcxx . . $ uint16_t# realPort = q->portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#port(455f465bc33b4cdf).(); |
| 83 | if (realPort != m_portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_port.) { |
| 84 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q->portChangedcxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#portChanged(49f6e7a06ebc5aa8).(); |
| 85 | } |
| 86 | } else { |
| 87 | qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Listening failed"; |
| 88 | } |
| 89 | } else { |
| 90 | q->closecxx . . $ OnlineAccountsPlugin/LoopbackServer#close(49f6e7a06ebc5aa8).(); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#::QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#QmlLoopbackServer(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent): |
| 95 | LoopbackServercxx . . $ OnlineAccountsPlugin/LoopbackServer#(parent), |
| 96 | d_ptrcxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#d_ptr.(new QmlLoopbackServerPrivatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#QmlLoopbackServerPrivate(b1a0970d3ce330b3).(this)) |
| 97 | { |
| 98 | } |
| 99 | |
| 100 | QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#::~cxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#`~QmlLoopbackServer`(ced63f7c635d850d).QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#() |
| 101 | { |
| 102 | } |
| 103 | |
| 104 | void QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#::setPortcxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#setPort(d4f767463ce0a6b3).(int port) |
| 105 | { |
| 106 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QmlLoopbackServer); |
| 107 | if (isListeningcxx . . $ OnlineAccountsPlugin/LoopbackServer#isListening(50ce9a9e25b4a850).()) { |
| 108 | qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Cannot change port while already listening"; |
| 109 | return; |
| 110 | } |
| 111 | |
| 112 | if (port == d->m_portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_port.) return; |
| 113 | d->m_portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_port. = port; |
| 114 | d->queueUpdatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#queueUpdate(49f6e7a06ebc5aa8).(); |
| 115 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! portChangedcxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#portChanged(49f6e7a06ebc5aa8).(); |
| 116 | } |
| 117 | |
| 118 | int QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#::portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#port(455f465bc33b4cdf).() const |
| 119 | { |
| 120 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const QmlLoopbackServer); |
| 121 | return isListeningcxx . . $ OnlineAccountsPlugin/LoopbackServer#isListening(50ce9a9e25b4a850).() ? LoopbackServercxx . . $ OnlineAccountsPlugin/LoopbackServer#::portcxx . . $ OnlineAccountsPlugin/LoopbackServer#port(72085aa11f4b6e09).() : d->m_portcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_port.; |
| 122 | } |
| 123 | |
| 124 | void QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#::setListeningcxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#setListening(b45ddcbc8423892c).(bool listening) |
| 125 | { |
| 126 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QmlLoopbackServer); |
| 127 | |
| 128 | if (listening == d->m_listeningcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_listening.) return; |
| 129 | d->m_listeningcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_listening. = listening; |
| 130 | |
| 131 | /* The change notification will be emitted when doing the update */ |
| 132 | d->queueUpdatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#queueUpdate(49f6e7a06ebc5aa8).(); |
| 133 | } |
| 134 | |
| 135 | void QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#::classBegincxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#classBegin(49f6e7a06ebc5aa8).() |
| 136 | { |
| 137 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QmlLoopbackServer); |
| 138 | d->m_updateQueuedcxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#m_updateQueued. = true; |
| 139 | } |
| 140 | |
| 141 | void QmlLoopbackServercxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#::componentCompletecxx . . $ OnlineAccountsPlugin/QmlLoopbackServer#componentComplete(49f6e7a06ebc5aa8).() |
| 142 | { |
| 143 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(QmlLoopbackServer); |
| 144 | d->updatecxx . . $ OnlineAccountsPlugin/QmlLoopbackServerPrivate#update(49f6e7a06ebc5aa8).(); |
| 145 | } |
| 146 | |
| 147 | #include "qml-loopback-server.moc"cxx . . $ `<file>/build/online-accounts-plugins/lib/module/LomiriOnlineAccountsPluginQML_autogen/include/qml-loopback-server.moc`/ |