Openvpn scripts fixes

some refactoring
This commit is contained in:
pokamest 2021-01-07 20:53:42 +03:00
parent c7dafe9c00
commit bfdbe27a8d
5 changed files with 74 additions and 51 deletions

View file

@ -1,5 +1,6 @@
#include <QCoreApplication>
#include <QFileInfo>
#include <QTcpSocket>
#include "communicator.h"
#include "debug.h"
@ -94,8 +95,11 @@ QString OpenVpnProtocol::configPath() const
void OpenVpnProtocol::writeCommand(const QString& command)
{
QTextStream stream(reinterpret_cast<QIODevice*>(m_managementServer.socket()));
stream << command << endl;
QIODevice *device = dynamic_cast<QIODevice*>(m_managementServer.socket().data());
if (device) {
QTextStream stream(device);
stream << command << endl;
}
}
QString OpenVpnProtocol::openVpnExecPath() const