Copyright 2010 Comarch S.A.
*******************************************************************************/
Copyright 2010 Comarch S.A.
*******************************************************************************/
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(dictListReceived(QNetworkReply*)));
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(dictListReceived(QNetworkReply*)));
-
-
- progressDialog = 0;
- connect(&http, SIGNAL(finished()), this, SLOT(processFinished()));
+ connect(&http, SIGNAL(finished()),
+ this, SLOT(processFinished()));
connect(&http, SIGNAL(error(QString)),
this, SLOT(downloadingError(QString)));
connect(&http, SIGNAL(error(QString)),
this, SLOT(downloadingError(QString)));
+ connect(&http, SIGNAL(progress(qint64,qint64)),
+ this, SLOT(updateDownloadProgress(qint64,qint64)));
connect(progressDialog, SIGNAL(cancelDownloading()),
this, SLOT(breakDownloading()));
connect(progressDialog, SIGNAL(cancelDownloading()),
this, SLOT(breakDownloading()));
void XdxfDictDownloader::downloadingError(QString error) {
breakDownloading();
Q_EMIT notify(Notify::Error, error);
}
void XdxfDictDownloader::downloadingError(QString error) {
breakDownloading();
Q_EMIT notify(Notify::Error, error);
}
void XdxfDictDownloader::breakDownloading() {
//if user cancel downloading we kill all running processes, hide progress dialog and set flag that user cancel downloading.
aborted = true;
void XdxfDictDownloader::breakDownloading() {
//if user cancel downloading we kill all running processes, hide progress dialog and set flag that user cancel downloading.
aborted = true;
void XdxfDictDownloader::downloadComplete() {
if(aborted) return;
// Downloaded tar file name is different than extracted folder so we need
void XdxfDictDownloader::downloadComplete() {
if(aborted) return;
// Downloaded tar file name is different than extracted folder so we need
if(reply->error() != QNetworkReply::NoError) {
Q_EMIT notify(Notify::Error, reply->errorString());
return;
if(reply->error() != QNetworkReply::NoError) {
Q_EMIT notify(Notify::Error, reply->errorString());
return;
TAR *t;
char * tarfname = new char[file.replace(QRegExp(".bz2%"), "").size()+1];
strcpy(tarfname, file.replace(QRegExp(".bz2%"), "").toStdString().c_str());
TAR *t;
char * tarfname = new char[file.replace(QRegExp(".bz2%"), "").size()+1];
strcpy(tarfname, file.replace(QRegExp(".bz2%"), "").toStdString().c_str());