http = new QHttp; http->setHost(fromHost);http->get("/" + fileName, &file);http->closeConnection();connect(http, SIGNAL(done(bool)), this, SLOT(httpDone(bool)));void downloadFiles::httpDone(bool error){ if (error) { file.remove(); emit httpDownloadError(); } else { file.close(); emit httpDownloadOk(); }}Деструктор:downloadFiles::~downloadFiles(){ delete http; }
loadFiles = new downloadFiles(mainHost, "sysFiles", "filesinfo.txt"); connect(loadFiles, SIGNAL(httpDownloadOk()), this, SLOT(internetConnectOk()));connect(loadFiles, SIGNAL(httpDownloadError()), this, SLOT(connectError()));