Skip to content

Commit

Permalink
Cosmetic.
Browse files Browse the repository at this point in the history
Signed-off-by: cneben <[email protected]>
  • Loading branch information
cneben committed May 17, 2023
1 parent 85059e2 commit e068be3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions QuickContainers/include/qcmContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,20 @@ class Container : public AbstractContainer
//! Shortcut to Container<T>::size().
inline auto size( ) const noexcept -> decltype(std::declval<C<T>>().size()) { return _container.size( ); }

void append( const T& item ) {
if ( isNullPtr( item, typename ItemDispatcher<T>::type{} ) )
void append(const T& item) {
if (isNullPtr(item, typename ItemDispatcher<T>::type{}))
return;
if ( _model ) {
fwdBeginInsertRows( QModelIndex{},
static_cast<int>(_container.size()),
static_cast<int>(_container.size()) );
if (_model) {
fwdBeginInsertRows(QModelIndex{},
static_cast<int>(_container.size()),
static_cast<int>(_container.size()));
qcm::adapter<C, T>::append(_container, item);
appendImpl( item, typename ItemDispatcher<T>::type{} );
appendImpl(item, typename ItemDispatcher<T>::type{});
fwdEndInsertRows();
fwdEmitLengthChanged();
} else {
qcm::adapter<C, T>::append(_container, item);
appendImpl( item, typename ItemDispatcher<T>::type{} );
appendImpl(item, typename ItemDispatcher<T>::type{});
}
}

Expand Down Expand Up @@ -311,10 +311,10 @@ class Container : public AbstractContainer
_modelImpl->_qObjectItemMap.insert( { item.get(), item } );
}
inline auto appendImpl( const T&, ItemDispatcherBase::weak_ptr_type ) noexcept -> void {}
inline auto appendImpl( const T& item, ItemDispatcherBase::weak_ptr_qobject_type ) noexcept -> void {
if ( _modelImpl &&
!item.expired() )
_modelImpl->_qObjectItemMap.insert( { item.lock().get(), item } );
inline auto appendImpl(const T& item, ItemDispatcherBase::weak_ptr_qobject_type) noexcept -> void {
if (_modelImpl &&
!item.expired())
_modelImpl->_qObjectItemMap.insert({item.lock().get(), item});
}

public:
Expand Down

0 comments on commit e068be3

Please sign in to comment.