Version 0.002 code cleanup and event attending

This commit is contained in:
LubuWest 2017-01-29 17:26:09 +01:00
commit d8186978e7
42 changed files with 925 additions and 968 deletions

View file

@ -21,7 +21,6 @@ signals:
void error(QString data, int code);
public slots:
//void setDirectory(QString Directory);
void makeDir(QString name);
void rmDir();
void rmFile(QString name);

View file

@ -88,17 +88,12 @@ void XHR::clearParams()
void XHR::download()
{
QUrl requrl(m_url);
//qDebug()<< "replyerror"<<reply->error();
// qDebug() << "start download of " << requrl;
request.setUrl(requrl);
reply = manager.get(request);
// qDebug() << "reply " << reply->header(QNetworkRequest::LocationHeader)<<reply->header(QNetworkRequest::LastModifiedHeader);
// qDebug() << "request " << request.url();
// reply->ignoreSslErrors();
connect(reply, &QNetworkReply::readyRead,this, &XHR::onReadyRead);
//connect(reply,SIGNAL(downloadProgress(qint64,qint64)), this,SLOT(updateDownloadProgress(qint64,qint64)));
connect(reply, &QNetworkReply::finished,this, &XHR::onRequestFinished);
//connect(reply, SIGNAL(finished()),this, SLOT(onRequestFinished()));
connect(reply, &QNetworkReply::sslErrors, this, &XHR::onSSLError);
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onReplyError(QNetworkReply::NetworkError)));
}
@ -200,7 +195,6 @@ void XHR::onRequestFinished()
file.write(buffer);
buffer.clear();
file.close();
//qDebug() << m_url << "File downloaded "<<file.fileName();
emit this->downloaded(m_downloadtype);
//reply->deleteLater();
}