Example #1
0
void Download::com(){
    if(abortted){
        qDebug()<<"cancelled - DOWNLOAD::COM";
        if(file){
            file->close();
            file->remove();
            delete file;
            file = 0;
        }
        reply->deleteLater();
        reply = 0;
        emit progress(0);
        kOn = READY;
        emit satatechan(kOn);
        qDebug()<<"iki";
        return;
    }
    file->flush();
    file->close();
    if(reply->error()){
        qDebug()<<"ERROR - COM ; "<<reply->error();
        file->remove();
        emit error();
        emit cda();
    }
    reply->deleteLater();
    reply = 0;
    delete file;
    file = 0;
    kOn = READY;
    emit satatechan(kOn);
    emit downComp();
}
Example #2
0
int Download::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: progress((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: satatechan((*reinterpret_cast< State(*)>(_a[1]))); break;
        case 2: cda(); break;
        case 3: downComp(); break;
        case 4: com(); break;
        case 5: ready(); break;
        case 6: data((*reinterpret_cast< qint64(*)>(_a[1])),(*reinterpret_cast< qint64(*)>(_a[2]))); break;
        case 7: { int _r = cancelDownload();
            if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; }  break;
        default: ;
        }
        _id -= 8;
    }
    return _id;
}