Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the QtXmlPatterns module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4747#include <QtNetwork/QNetworkRequest>
    4848
    49 #include "qacceltreebuilder_p.h"
    5049#include "qatomicstring_p.h"
    5150#include "qautoptr_p.h"
     
    5857using namespace QPatternist;
    5958
    60 static inline uint qHash(const QUrl &uri)
    61 {
    62         return qHash(uri.toString());
    63 }
    64 
    6559AccelTreeResourceLoader::AccelTreeResourceLoader(const NamePool::Ptr &np,
    66                                                  const NetworkAccessDelegator::Ptr &manager) : m_namePool(np)
    67                                                                                              , m_networkAccessDelegator(manager)
     60                                                 const NetworkAccessDelegator::Ptr &manager,
     61                                                 AccelTreeBuilder<true>::Features features)
     62    : m_namePool(np)
     63    , m_networkAccessDelegator(manager)
     64    , m_features(features)
    6865{
    6966    Q_ASSERT(m_namePool);
     
    7572{
    7673    Q_ASSERT(uri.isValid());
    77     AccelTreeBuilder<true> builder(uri, uri, m_namePool, context.data());
     74    AccelTreeBuilder<true> builder(uri, uri, m_namePool, context.data());
    7875
    7976    const AutoPtr<QNetworkReply> reply(load(uri, m_networkAccessDelegator, context));
     
    8986}
    9087
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
    91104QNetworkReply *AccelTreeResourceLoader::load(const QUrl &uri,
    92105                                             const NetworkAccessDelegator::Ptr &networkDelegator,
    93                                              const ReportContext::Ptr &context)
     106                                             const ReportContext::Ptr &context)
    94107{
    95108    return load(uri,
    96109                networkDelegator->managerFor(uri),
    97                 context);
     110                context);
    98111}
    99112
    100113QNetworkReply *AccelTreeResourceLoader::load(const QUrl &uri,
    101114                                             QNetworkAccessManager *const networkManager,
    102                                              const ReportContext::Ptr &context)
     115                                             const ReportContext::Ptr &context, ErrorHandling errorHandling)
     116
    103117{
    104118    Q_ASSERT(networkManager);
     
    112126    networkLoop.connect(reply, SIGNAL(finished()), SLOT(finished()));
    113127
    114     if(networkLoop.exec())
     128    if(networkLoop.exec())
    115129    {
    116130        const QString errorMessage(escape(reply->errorString()));
     
    121135        const QSourceLocation location(uri);
    122136
    123         if(context)
     137        if(context)
    124138            context->error(errorMessage, ReportContext::FODC0002, location);
    125139
     
    131145
    132146bool AccelTreeResourceLoader::streamToReceiver(QIODevice *const dev,
    133                                                QAbstractXmlReceiver *const receiver,
     147                                                *const receiver,
    134148                                               const NamePool::Ptr &np,
    135149                                               const ReportContext::Ptr &context,
     
    155169                /* Send the name. */
    156170                receiver->startElement(np->allocateQName(reader.namespaceUri().toString(), reader.name().toString(),
    157                                                          reader.prefix().toString()));
     171                                                         reader.prefix().toString()));
    158172
    159173                /* Send namespace declarations. */
     
    259273        if(retrieveDocument(uri, context))
    260274            return m_loadedDocuments.value(uri)->root(QXmlNodeModelIndex()); /* Pass in dummy object. We know AccelTree doesn't use it. */
     275
     276
     277
     278
     279
     280
     281
     282
     283
     284
     285
     286
     287
     288
     289
     290
    261291        else
    262292            return Item();
Note: See TracChangeset for help on using the changeset viewer.