ios fixes

This commit is contained in:
pokamest 2021-09-15 08:03:28 -07:00
parent 12b079df65
commit 9ae2e3fba2
28 changed files with 149639 additions and 39 deletions

18
ipc/ipc_interface.rep Normal file
View file

@ -0,0 +1,18 @@
#include <QtCore>
#include <QString>
class IpcInterface
{
SLOT( int createPrivilegedProcess() ); // return local pid
//SIGNAL(sendMessage(const QByteArray &message));
// Route functions
SLOT( int routeAddList(const QString &gw, const QStringList &ips) );
SLOT( bool clearSavedRoutes() );
SLOT( bool routeDeleteList(const QString &gw, const QStringList &ip) );
SLOT( void flushDns() );
SLOT( bool checkAndInstallDriver() );
SLOT( QStringList getTapList() );
};

View file

@ -1,21 +1,6 @@
#include <QtCore>
#include <QString>
class IpcInterface
{
SLOT( int createPrivilegedProcess() ); // return local pid
//SIGNAL(sendMessage(const QByteArray &message));
// Route functions
SLOT( int routeAddList(const QString &gw, const QStringList &ips) );
SLOT( bool clearSavedRoutes() );
SLOT( bool routeDeleteList(const QString &gw, const QStringList &ip) );
SLOT( void flushDns() );
SLOT( bool checkAndInstallDriver() );
SLOT( QStringList getTapList() );
};
class IpcProcessInterface
{
SLOT( start(const QString &program, const QStringList &args) );

View file

@ -48,15 +48,15 @@ int IpcServer::createPrivilegedProcess()
qDebug() << "QRemoteObjectHost::destroyed";
});
connect(pd.ipcProcess.data(), &IpcServerProcess::finished, this, [this, pid=m_localpid](int exitCode, QProcess::ExitStatus exitStatus){
qDebug() << "IpcServerProcess finished" << exitCode << exitStatus;
// if (m_processes.contains(pid)) {
// m_processes[pid].ipcProcess.reset();
// m_processes[pid].serverNode.reset();
// m_processes[pid].localServer.reset();
// m_processes.remove(pid);
// }
});
// connect(pd.ipcProcess.data(), &IpcServerProcess::finished, this, [this, pid=m_localpid](int exitCode, QProcess::ExitStatus exitStatus){
// qDebug() << "IpcServerProcess finished" << exitCode << exitStatus;
//// if (m_processes.contains(pid)) {
//// m_processes[pid].ipcProcess.reset();
//// m_processes[pid].serverNode.reset();
//// m_processes[pid].localServer.reset();
//// m_processes.remove(pid);
//// }
// });
m_processes.insert(m_localpid, pd);

View file

@ -8,7 +8,7 @@
#include "ipc.h"
#include "ipcserverprocess.h"
#include "rep_ipcinterface_source.h"
#include "rep_ipc_interface_source.h"
class IpcServer : public IpcInterfaceSource
{

View file

@ -1,6 +1,8 @@
#include "ipcserverprocess.h"
#include <QProcess>
#ifndef Q_OS_IOS
IpcServerProcess::IpcServerProcess(QObject *parent) :
IpcProcessInterfaceSource(parent),
m_process(QSharedPointer<QProcess>(new QProcess()))
@ -103,3 +105,5 @@ QByteArray IpcServerProcess::readAllStandardOutput()
{
return m_process->readAllStandardOutput();
}
#endif

View file

@ -2,8 +2,9 @@
#define IPCSERVERPROCESS_H
#include <QObject>
#include "rep_ipcinterface_source.h"
#ifndef Q_OS_IOS
#include "rep_ipc_process_interface_source.h"
class IpcServerProcess : public IpcProcessInterfaceSource
{
@ -33,4 +34,14 @@ private:
QSharedPointer<QProcess> m_process;
};
#else
class IpcServerProcess : public QObject
{
Q_OBJECT
public:
explicit IpcServerProcess(QObject *parent = nullptr);
};
#endif
#endif // IPCSERVERPROCESS_H