@@ -322,12 +322,7 @@ bool QgsPropertyCollection::readXml( const QDomElement &collectionElem, const QD
322
322
//
323
323
324
324
QgsPropertyCollectionStack::QgsPropertyCollectionStack ()
325
- : mDirty( false )
326
- , mHasActiveProperties( false )
327
- , mhasDynamicProperties( false )
328
- {
329
-
330
- }
325
+ {}
331
326
332
327
QgsPropertyCollectionStack::~QgsPropertyCollectionStack ()
333
328
{
@@ -336,17 +331,12 @@ QgsPropertyCollectionStack::~QgsPropertyCollectionStack()
336
331
337
332
QgsPropertyCollectionStack::QgsPropertyCollectionStack ( const QgsPropertyCollectionStack &other )
338
333
: QgsAbstractPropertyCollection( other )
339
- , mDirty( false )
340
- , mHasActiveProperties( false )
341
- , mhasDynamicProperties( false )
342
334
{
343
335
clear ();
344
336
345
337
Q_FOREACH ( QgsPropertyCollection* collection, other.mStack )
346
338
{
347
339
mStack << new QgsPropertyCollection ( *collection );
348
- mHasActiveProperties |= collection->hasActiveProperties ();
349
- mhasDynamicProperties |= collection->hasDynamicProperties ();
350
340
}
351
341
}
352
342
@@ -358,8 +348,6 @@ QgsPropertyCollectionStack &QgsPropertyCollectionStack::operator=( const QgsProp
358
348
Q_FOREACH ( QgsPropertyCollection* collection, other.mStack )
359
349
{
360
350
mStack << new QgsPropertyCollection ( *collection );
361
- mHasActiveProperties |= collection->hasActiveProperties ();
362
- mhasDynamicProperties |= collection->hasDynamicProperties ();
363
351
}
364
352
365
353
return *this ;
@@ -374,20 +362,15 @@ void QgsPropertyCollectionStack::clear()
374
362
{
375
363
qDeleteAll ( mStack );
376
364
mStack .clear ();
377
- mHasActiveProperties = false ;
378
- mhasDynamicProperties = false ;
379
- mDirty = false ;
380
365
}
381
366
382
367
void QgsPropertyCollectionStack::appendCollection ( QgsPropertyCollection* collection )
383
368
{
384
369
mStack .append ( collection );
385
- mDirty = true ;
386
370
}
387
371
388
372
QgsPropertyCollection* QgsPropertyCollectionStack::at ( int index )
389
373
{
390
- mDirty = true ;
391
374
return mStack .value ( index );
392
375
}
393
376
@@ -398,7 +381,6 @@ const QgsPropertyCollection* QgsPropertyCollectionStack::at( int index ) const
398
381
399
382
QgsPropertyCollection* QgsPropertyCollectionStack::collection ( const QString &name )
400
383
{
401
- mDirty = true ;
402
384
Q_FOREACH ( QgsPropertyCollection* collection, mStack )
403
385
{
404
386
if ( collection->name () == name )
@@ -409,18 +391,22 @@ QgsPropertyCollection* QgsPropertyCollectionStack::collection( const QString &na
409
391
410
392
bool QgsPropertyCollectionStack::hasActiveProperties () const
411
393
{
412
- if ( mDirty )
413
- rescan ();
414
-
415
- return mHasActiveProperties ;
394
+ Q_FOREACH ( const QgsPropertyCollection* collection, mStack )
395
+ {
396
+ if ( collection->hasActiveProperties () )
397
+ return true ;
398
+ }
399
+ return false ;
416
400
}
417
401
418
402
bool QgsPropertyCollectionStack::hasDynamicProperties () const
419
403
{
420
- if ( mDirty )
421
- rescan ();
422
-
423
- return mhasDynamicProperties;
404
+ Q_FOREACH ( const QgsPropertyCollection* collection, mStack )
405
+ {
406
+ if ( collection->hasDynamicProperties () )
407
+ return true ;
408
+ }
409
+ return false ;
424
410
}
425
411
426
412
bool QgsPropertyCollectionStack::isActive ( int key ) const
@@ -524,20 +510,5 @@ bool QgsPropertyCollectionStack::readXml( const QDomElement& collectionElem, con
524
510
child->readXml ( childElem, doc, definitions );
525
511
mStack .append ( child );
526
512
}
527
- mDirty = true ;
528
513
return true ;
529
514
}
530
-
531
- void QgsPropertyCollectionStack::rescan () const
532
- {
533
- mHasActiveProperties = false ;
534
- mhasDynamicProperties = false ;
535
- Q_FOREACH ( const QgsPropertyCollection* collection, mStack )
536
- {
537
- mHasActiveProperties |= collection->hasActiveProperties ();
538
- mhasDynamicProperties |= collection->hasDynamicProperties ();
539
- if ( mHasActiveProperties && mhasDynamicProperties )
540
- break ;
541
- }
542
- mDirty = false ;
543
- }
0 commit comments