feat: create networkconfigurationamanager

This commit is contained in:
Richard Ramos 2020-07-14 20:09:56 -04:00 committed by Michał
parent f2ce61142b
commit 2d556fbc42
4 changed files with 20 additions and 1 deletions

View File

@ -4,7 +4,7 @@ include(GNUInstallDirs)
# Macro for merging common code between static and shared
macro(add_target name type)
find_package(Qt5 COMPONENTS Core Qml Gui Quick QuickControls2 Widgets)
find_package(Qt5 COMPONENTS Core Qml Gui Quick QuickControls2 Widgets Network)
add_library(${name} ${type}
include/DOtherSide/DOtherSideTypes.h

View File

@ -99,6 +99,10 @@ DOS_API void DOS_CALL dos_qapplication_exec(void);
/// \note This method was created because status-go has a non-QT event loop
DOS_API void DOS_CALL dos_signal(DosQObject *vptr, const char *signal, const char *slot);
DOS_API DosQNetworkConfigurationManager *DOS_CALL dos_qncm_create();
DOS_API void DOS_CALL dos_qncm_delete(DosQNetworkConfigurationManager *vptr);
/// \brief Sets the application icon
DOS_API void DOS_CALL dos_qapplication_icon(const char *filename);

View File

@ -74,6 +74,9 @@ typedef void DosQHashIntQByteArray;
/// A pointer to a QUrl
typedef void DosQUrl;
/// A pointer to a QNetworkConfigurationManager
typedef void DosQNetworkConfigurationManager;
/// A pointer to a QMetaObject
typedef void DosQMetaObject;

View File

@ -26,6 +26,7 @@
#include <QtCore/QModelIndex>
#include <QtCore/QHash>
#include <QtCore/QResource>
#include <QtNetwork/QNetworkConfigurationManager>
#include <QtGui/QGuiApplication>
#include <QtGui/QIcon>
#include <QtQml/QQmlContext>
@ -1068,3 +1069,14 @@ void dos_qcoreapplication_process_events_timed(DosQEventLoopProcessEventFlag fla
{
qApp->processEvents(static_cast<QEventLoop::ProcessEventsFlag>(flags), ms);
}
::DosQNetworkConfigurationManager *dos_qncm_create()
{
return new QNetworkConfigurationManager();
}
void dos_qncm_delete(::DosQNetworkConfigurationManager *vptr)
{
auto ncm = static_cast<QNetworkConfigurationManager *>(vptr);
delete ncm;
}