Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QML:
- function saveConnection()
- {
- var _name = conname.text;
- var _gateway = gateway.text;
- var _conntype = connectionType.currentItem;
- if(_conntype.toString() === "X.509 Certificates")
- _conntype = ConnectionType.X509;
- var _cafile = caFile.text;
- var _certfile = certFile.text;
- var _keyfile = keyFile.text;
- var _port = port.text;
- if(_port === "")
- _port = -1;
- var _mtu = mtu.text;
- if(_mtu === "")
- _mtu = -1;
- var _prototype = protocol.currentItem;
- if(_prototype.toString() === "UDP")
- _prototype = ProtocolType.UDP;
- else if(_prototype.toString() === "TCP")
- _prototype = ProtocolType.TCP;
- var _lzo = complzo.checked;
- //ConnectionsModel.newConnection(_name, _gateway, _conntype,
- // _cafile, _certfile, _keyfile,
- // _port, _mtu, _prototype, _lzo);
- ConnectionsModel.newConnection("_name", "_gateway", 0,
- "_cafile", "_certfile", "_keyfile");
- }
- CPP:
- QString ConnectionsModel::newConnection(const QString &name, const QString &gateway, const ConnectionTypeWrapper::ConnectionType &conntype,
- const QString &cafile, const QString &certfile, const QString &keyfile, const qint32 &port,
- const qint32 &mtu, const ProtocolTypeWrapper::ProtocolType &prototype, const bool &lzo)
- {
- Connection *conn = new Connection(name, gateway, conntype,
- cafile, certfile, keyfile, port,
- mtu, prototype, lzo);
- qint32 index;
- if(m_conns.isEmpty())
- index = 0;
- else
- index = m_conns.length();
- conn->setIndex(index);
- addConnection(conn);
- return "";
- }
- ERROR GDB:
- [W] unknown:68 - file:///usr/share/OpenVPN/qml/pages/Settings.qml:68: Error: Unable to determine callable overload. Candidates are:
- newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString)
- newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int)
- newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int,int)
- newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int,int,ProtocolTypeWrapper::ProtocolType)
- newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int,int,ProtocolTypeWrapper::ProtocolType,bool)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement