~neon/grantlee/trunk

« back to all changes in this revision

Viewing changes to templates/lib/filterexpression.cpp

  • Committer: Stephen Kelly
  • Date: 2014-09-22 11:05:05 UTC
  • Revision ID: git-v1:d7635489161c4defb4638e5f344880f65af58291
Remove typedefs for QSharedPointers from APIs.

The typedefs hide the semantic of memory management that is being
used, which is undesirable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "parser.h"
27
27
#include "util.h"
28
28
 
29
 
typedef QPair<Grantlee::Filter::Ptr, Grantlee::Variable> ArgFilter;
 
29
typedef QPair<QSharedPointer<Grantlee::Filter>, Grantlee::Variable> ArgFilter;
30
30
 
31
31
namespace Grantlee
32
32
{
123
123
 
124
124
      if ( subString.startsWith( QLatin1Char( FILTER_SEPARATOR ) ) ) {
125
125
        subString = subString.right( ssSize - 1 );
126
 
        Filter::Ptr f = parser->getFilter( subString );
 
126
        QSharedPointer<Filter> f = parser->getFilter( subString );
127
127
 
128
128
        Q_ASSERT( f );
129
129
 
130
130
        d->m_filterNames << subString;
131
 
        d->m_filters << qMakePair<Filter::Ptr, Variable>( f, Variable() );
 
131
        d->m_filters << qMakePair<QSharedPointer<Filter>, Variable>( f, Variable() );
132
132
 
133
133
      } else if ( subString.startsWith( QLatin1Char( FILTER_ARGUMENT_SEPARATOR ) ) ) {
134
134
        if (d->m_filters.isEmpty() || d->m_filters.last().second.isValid()) {
209
209
  QVector<ArgFilter>::const_iterator it = d->m_filters.constBegin();
210
210
  const QVector<ArgFilter>::const_iterator end = d->m_filters.constEnd();
211
211
  for ( ; it != end; ++it ) {
212
 
    Filter::Ptr filter = it->first;
 
212
    QSharedPointer<Filter> filter = it->first;
213
213
    filter->setStream( stream );
214
214
    const Variable argVar = it->second;
215
215
    QVariant arg = argVar.resolve( c );