entries.insert( entry, 0 );
myEntries.insert( num, entry );
myIsReferences.insert( num, sowner->entry() != entry );
- processOwner( sowner );
- num++;
+ if (processOwner( sowner )) {
+ num++;
+ }
+ else {
+ entries.remove( entry );
+ myEntries.remove( num );
+ myIsReferences.remove( num );
+ }
}
}
}
}
/*!
- Do nothing. To be redefined by successors
+ Perform additional processing of the selected item (to be redefined by successors if necessary).
+ Returns \c true by default.
+ Note: if this method returns \c false, the item will be removed from the items list and
+ not taken into account when showing popup menu.
+
+ \param owner a data owner being processed
+ \return \c true if the owner should be collected and \c false otherwise
*/
-void LightApp_Selection::processOwner( const LightApp_DataOwner* )
+bool LightApp_Selection::processOwner( const LightApp_DataOwner* /*owner*/ )
{
+ return true;
}
/*!
virtual ~LightApp_Selection();
virtual void init( const QString&, LightApp_SelectionMgr* );
- virtual void processOwner( const LightApp_DataOwner* );
+ virtual bool processOwner( const LightApp_DataOwner* );
virtual int count() const;
virtual QVariant parameter( const int, const QString& ) const;