| 255 | ////////////////////////////////////////////////////////////////////////////// |
| 256 | |
| 257 | FunctionNode::FunctionNode(Declaration* a_decl, NodesModelInterface* a_model) |
| 258 | : IdentifierNode(a_decl, a_model) |
| 259 | { |
| 260 | // Append the argument signature to the identifier's name (which is what the displayName is. |
| 261 | if (FunctionType::Ptr type = a_decl->type<FunctionType>()) |
| 262 | m_displayName += type->partToString(FunctionType::SignatureArguments); |
| 263 | |
| 264 | // Add special values for ctor / dtor to sort first |
| 265 | auto* classmember = dynamic_cast<ClassFunctionDeclaration*>(a_decl); |
| 266 | if (classmember) { |
| 267 | if (classmember->isConstructor() || classmember->isDestructor()) |
| 268 | m_sortableString = QLatin1Char('0') + m_displayName; |
| 269 | else |
| 270 | m_sortableString = QLatin1Char('1') + m_displayName; |
| 271 | } else { |
| 272 | m_sortableString = m_displayName; |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | ////////////////////////////////////////////////////////////////////////////// |
| 277 | ////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected