src/thread/SSHConnect.cpp

Go to the documentation of this file.
00001 
00007 #include "SSHConnect.h"
00008 
00017 SSHConnect::SSHConnect(QString l,QString p ,QString h, Myssh*s)
00018         : _login(l),
00019         _password(p),
00020         _host(h),
00021         _ssh(s)
00022 {}
00023 
00024 
00029 void SSHConnect::run()
00030 {
00031     char * login= (char *) malloc(_login.length());
00032     char * pwd = (char *) malloc(_password.length());
00033     char * host = (char *) malloc(_host.length());
00034 
00035     strcpy(login, _login.toStdString().c_str());
00036     strcpy(pwd, _password.toStdString().c_str());
00037     strcpy(host, _host.toStdString().c_str());
00038 
00039     _ssh->connect_ssh(login,pwd,host);
00040 
00041     if (_ssh->isConnected())
00042         emit connected();
00043     else
00044         emit connectionFailed(_ssh->getErrMsg());
00045 
00046     exec();
00047 }
00048 

Generated on Mon Mar 16 18:46:05 2009 for QCJM by  doxygen 1.5.4