Returns only the name, no template-parameters or scope
| 214 | |
| 215 | //Returns only the name, no template-parameters or scope |
| 216 | QString cursorItemText() |
| 217 | { |
| 218 | KDevelop::DUChainReadLocker lock(DUChain::lock()); |
| 219 | |
| 220 | Declaration* decl = cursorDeclaration(); |
| 221 | if (!decl) { |
| 222 | return QString(); |
| 223 | } |
| 224 | |
| 225 | IDocument* doc = ICore::self()->documentController()->activeDocument(); |
| 226 | if (!doc) { |
| 227 | return QString(); |
| 228 | } |
| 229 | |
| 230 | TopDUContext* context = DUChainUtils::standardContextForUrl(doc->url()); |
| 231 | |
| 232 | if (!context) { |
| 233 | qCDebug(PLUGIN_QUICKOPEN) << "Got no standard context"; |
| 234 | return QString(); |
| 235 | } |
| 236 | |
| 237 | AbstractType::Ptr t = decl->abstractType(); |
| 238 | auto* idType = dynamic_cast<IdentifiedType*>(t.data()); |
| 239 | if (idType && idType->declaration(context)) { |
| 240 | decl = idType->declaration(context); |
| 241 | } |
| 242 | |
| 243 | if (!decl->qualifiedIdentifier().isEmpty()) { |
| 244 | return decl->qualifiedIdentifier().last().identifier().str(); |
| 245 | } |
| 246 | |
| 247 | return QString(); |
| 248 | } |
| 249 | |
| 250 | QuickOpenLineEdit* QuickOpenPlugin::createQuickOpenLineWidget() |
| 251 | { |
nothing calls this directly
no test coverage detected