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

Method data

src/tools/ecode/universallocator.cpp:27–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 size_t columnCount( const ModelIndex& ) const override { return 2; }
26
27 Variant data( const ModelIndex& index, ModelRole role ) const override {
28 if ( index.row() >= (Int64)mInfo.size() )
29 return {};
30 if ( role == ModelRole::Display ) {
31 switch ( index.column() ) {
32 case 0:
33 return Variant( mInfo[index.row()].name.c_str() );
34 case 1: {
35 if ( mDisplayLine ) {
36 std::string detail( !mInfo[index.row()].detail.empty()
37 ? mInfo[index.row()].detail + " (" +
38 mInfo[index.row()].range.toString() + ")"
39 : mInfo[index.row()].range.toString() );
40 return Variant( detail );
41 } else {
42 return Variant( mInfo[index.row()].url.getFSPath() );
43 }
44 }
45 }
46 } else if ( role == ModelRole::Icon && index.column() == 0 ) {
47 return mUISceneNode->findIcon(
48 LSPSymbolKindHelper::toIconString( mInfo[index.row()].kind ) );
49 } else if ( role == ModelRole::Custom && index.column() == 1 ) {
50 return Variant( mInfo[index.row()].range.toString() );
51 }
52 return {};
53 }
54
55 const LSPSymbolInformationList& getInfo() const { return mInfo; }
56

Callers 2

UniversalLocatorMethod · 0.45
initLocateBarMethod · 0.45

Calls 9

VariantFunction · 0.85
rowMethod · 0.80
columnMethod · 0.80
c_strMethod · 0.80
getFSPathMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
toStringMethod · 0.45
findIconMethod · 0.45

Tested by

no test coverage detected