2024-09-21 19:57:20 +00:00
|
|
|
/*
|
|
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
|
|
|
|
* Copyright (C) 2024 Symless Ltd.
|
|
|
|
|
*
|
|
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* found in the file LICENSE that should have accompanied this file.
|
|
|
|
|
*
|
|
|
|
|
* This package is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "QNetworkAccessManagerProxy.h"
|
|
|
|
|
|
|
|
|
|
#include <QNetworkAccessManager>
|
|
|
|
|
#include <QtNetwork/QNetworkReply>
|
|
|
|
|
|
|
|
|
|
namespace deskflow::gui::proxy {
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
void QNetworkAccessManagerProxy::init()
|
|
|
|
|
{
|
2024-09-21 19:57:20 +00:00
|
|
|
m_network = std::make_shared<QNetworkAccessManager>();
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
connect(m_network.get(), &QNetworkAccessManager::finished, this, [this](QNetworkReply *reply) {
|
2024-10-21 04:08:10 +00:00
|
|
|
Q_EMIT finished(reply);
|
2024-10-17 18:04:35 +00:00
|
|
|
});
|
2024-09-21 19:57:20 +00:00
|
|
|
}
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
void QNetworkAccessManagerProxy::get(const QNetworkRequest &request) const
|
|
|
|
|
{
|
2024-09-21 19:57:20 +00:00
|
|
|
m_network->get(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace deskflow::gui::proxy
|