Exemplo n.º 1
0
DataLayer::DataLayer(QObject *parent) :
    QObject(parent)
{
    _currentDay = NULL;
    _isPending = false;
    _authRequired = false;

    connect(&_webClient,SIGNAL(dataUpdated(Day*)),this,SLOT(setDataModel(Day*)));
    connect(&_webClient,SIGNAL(authRequiered()),this,SLOT(authenticationRequired()));
    connect(&_webClient,SIGNAL(loginFailed()),this,SLOT(authenticationRequired()));

    loadDataFromFile();
}
int QNetworkAccessManager::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:
            proxyAuthenticationRequired((*reinterpret_cast< const QNetworkProxy(*)>(_a[1])),(*reinterpret_cast< QAuthenticator*(*)>(_a[2])));
            break;
        case 1:
            authenticationRequired((*reinterpret_cast< QNetworkReply*(*)>(_a[1])),(*reinterpret_cast< QAuthenticator*(*)>(_a[2])));
            break;
        case 2:
            finished((*reinterpret_cast< QNetworkReply*(*)>(_a[1])));
            break;
        case 3:
            sslErrors((*reinterpret_cast< QNetworkReply*(*)>(_a[1])),(*reinterpret_cast< const QList<QSslError>(*)>(_a[2])));
            break;
        case 4:
            d_func()->_q_replyFinished();
            break;
        case 5:
            d_func()->_q_replySslErrors((*reinterpret_cast< QList<QSslError>(*)>(_a[1])));
            break;
        default:
            ;
        }
        _id -= 6;
    }
    return _id;
}
void QNetworkAccessHttpBackend::httpAuthenticationRequired(const QHttpNetworkRequest &,
                                                           QAuthenticator *auth)
{
    authenticationRequired(auth);
}