Advertisement
Guest User

Untitled

a guest
Dec 30th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. QML:
  2. function saveConnection()
  3. {
  4. var _name = conname.text;
  5. var _gateway = gateway.text;
  6. var _conntype = connectionType.currentItem;
  7. if(_conntype.toString() === "X.509 Certificates")
  8. _conntype = ConnectionType.X509;
  9. var _cafile = caFile.text;
  10. var _certfile = certFile.text;
  11. var _keyfile = keyFile.text;
  12.  
  13. var _port = port.text;
  14. if(_port === "")
  15. _port = -1;
  16.  
  17. var _mtu = mtu.text;
  18. if(_mtu === "")
  19. _mtu = -1;
  20.  
  21. var _prototype = protocol.currentItem;
  22. if(_prototype.toString() === "UDP")
  23. _prototype = ProtocolType.UDP;
  24. else if(_prototype.toString() === "TCP")
  25. _prototype = ProtocolType.TCP;
  26.  
  27. var _lzo = complzo.checked;
  28.  
  29. //ConnectionsModel.newConnection(_name, _gateway, _conntype,
  30. // _cafile, _certfile, _keyfile,
  31. // _port, _mtu, _prototype, _lzo);
  32. ConnectionsModel.newConnection("_name", "_gateway", 0,
  33. "_cafile", "_certfile", "_keyfile");
  34. }
  35.  
  36. CPP:
  37. QString ConnectionsModel::newConnection(const QString &name, const QString &gateway, const ConnectionTypeWrapper::ConnectionType &conntype,
  38. const QString &cafile, const QString &certfile, const QString &keyfile, const qint32 &port,
  39. const qint32 &mtu, const ProtocolTypeWrapper::ProtocolType &prototype, const bool &lzo)
  40. {
  41. Connection *conn = new Connection(name, gateway, conntype,
  42. cafile, certfile, keyfile, port,
  43. mtu, prototype, lzo);
  44.  
  45. qint32 index;
  46. if(m_conns.isEmpty())
  47. index = 0;
  48. else
  49. index = m_conns.length();
  50. conn->setIndex(index);
  51. addConnection(conn);
  52.  
  53. return "";
  54. }
  55.  
  56. ERROR GDB:
  57. [W] unknown:68 - file:///usr/share/OpenVPN/qml/pages/Settings.qml:68: Error: Unable to determine callable overload. Candidates are:
  58. newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString)
  59. newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int)
  60. newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int,int)
  61. newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int,int,ProtocolTypeWrapper::ProtocolType)
  62. newConnection(QString,QString,ConnectionTypeWrapper::ConnectionType,QString,QString,QString,int,int,ProtocolTypeWrapper::ProtocolType,bool)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement