Esempio n. 1
0
void ParserAbstract::networkReplyFinished(QNetworkReply *networkReply)
{
    FahrplanNS::curReqStates internalRequestState = currentRequestState;

    disconnect(lastRequest, SIGNAL(downloadProgress(qint64,qint64)), 0, 0);
    requestTimeout->stop();

    lastRequest = NULL;

    //We overwrite the currentRequestState to noneRequest here, because this allows us to set a new one
    //if needed inside the parser
    currentRequestState = FahrplanNS::noneRequest;

    if (internalRequestState == FahrplanNS::stationsByNameRequest) {
        parseStationsByName(networkReply);
    } else if (internalRequestState == FahrplanNS::stationsByCoordinatesRequest) {
        parseStationsByCoordinates(networkReply);
    } else if (internalRequestState == FahrplanNS::searchJourneyRequest) {
        parseSearchJourney(networkReply);
    } else if (internalRequestState == FahrplanNS::searchJourneyLaterRequest) {
        parseSearchLaterJourney(networkReply);
    } else if (internalRequestState == FahrplanNS::searchJourneyEarlierRequest) {
        parseSearchEarlierJourney(networkReply);
    } else if (internalRequestState == FahrplanNS::journeyDetailsRequest) {
        parseJourneyDetails(networkReply);
    } else if (internalRequestState == FahrplanNS::getTimeTableForStationRequest) {
        parseTimeTable(networkReply);
    } else {
        qDebug()<<"Current request unhandled!";
    }
}
void ParserXmlVasttrafikSe::parseStationsByCoordinates(QNetworkReply *networkReply)
{
    qDebug() << "ParserXmlVasttrafikSe::parseStationsByCoordinates(networkReply.url()=" << networkReply->url().toString() << ")";
    parseStationsByName(networkReply);
}