MCPcopy Create free account
hub / github.com/SpartanJ/eepp / index

Method index

src/eepp/ui/models/sortingproxymodel.cpp:140–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140ModelIndex SortingProxyModel::index( int row, int column, const ModelIndex& parent ) const {
141 if ( row < 0 || column < 0 )
142 return {};
143
144 auto sourceParent = mapToSource( parent );
145 const_cast<SortingProxyModel*>( this )->buildMapping( sourceParent );
146
147 auto it = mMappings.find( sourceParent );
148 eeASSERT( it != mMappings.end() );
149 auto& mapping = *it->second;
150 if ( row >= static_cast<int>( mapping.sourceRows.size() ) || column >= (Int64)columnCount() )
151 return {};
152 return createIndex( row, column, &mapping );
153}
154
155ModelIndex SortingProxyModel::parentIndex( const ModelIndex& proxyIndex ) const {
156 if ( !proxyIndex.isValid() )

Callers 2

sortMappingMethod · 0.95
mapToSourceMethod · 0.45

Calls 5

columnCountFunction · 0.85
buildMappingMethod · 0.80
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected