Changeset View
Changeset View
Standalone View
Standalone View
language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
Show First 20 Lines • Show All 275 Lines • ▼ Show 20 Line(s) | 255 | if( !shorten ) { | |||
---|---|---|---|---|---|
276 | } | 276 | } | ||
277 | 277 | | |||
278 | modifyHtml() += QStringLiteral(" "); //The action name _must_ stay "show_uses", since that is also used from outside | 278 | modifyHtml() += QStringLiteral(" "); //The action name _must_ stay "show_uses", since that is also used from outside | ||
279 | makeLink(i18n("Show uses"), QStringLiteral("show_uses"), NavigationAction(m_declaration, NavigationAction::NavigateUses)); | 279 | makeLink(i18n("Show uses"), QStringLiteral("show_uses"), NavigationAction(m_declaration, NavigationAction::NavigateUses)); | ||
280 | } | 280 | } | ||
281 | 281 | | |||
282 | QByteArray declarationComment = m_declaration->comment(); | 282 | QByteArray declarationComment = m_declaration->comment(); | ||
283 | if( !shorten && (!declarationComment.isEmpty() || doc) ) { | 283 | if( !shorten && (!declarationComment.isEmpty() || doc) ) { | ||
284 | modifyHtml() += QStringLiteral("<br />"); | 284 | modifyHtml() += QStringLiteral("<p>"); | ||
285 | 285 | | |||
286 | if(doc) { | 286 | if(doc) { | ||
287 | QString comment = doc->description(); | 287 | QString comment = doc->description(); | ||
288 | connect(doc.data(), &IDocumentation::descriptionChanged, this, &AbstractDeclarationNavigationContext::contentsChanged); | 288 | connect(doc.data(), &IDocumentation::descriptionChanged, this, &AbstractDeclarationNavigationContext::contentsChanged); | ||
289 | 289 | | |||
290 | if(!comment.isEmpty()) { | 290 | if(!comment.isEmpty()) { | ||
291 | modifyHtml() += "<br />" + commentHighlight(comment); | 291 | modifyHtml() += "<p>" + commentHighlight(comment) + "</p>"; | ||
292 | } | 292 | } | ||
293 | } | 293 | } | ||
294 | 294 | | |||
295 | QString comment = QString::fromUtf8(declarationComment); | 295 | QString comment = QString::fromUtf8(declarationComment); | ||
296 | if(!comment.isEmpty()) { | 296 | if(!comment.isEmpty()) { | ||
297 | // if the first paragraph does not contain a tag, we assume that this is a plain-text comment | 297 | // if the first paragraph does not contain a tag, we assume that this is a plain-text comment | ||
298 | if (!Qt::mightBeRichText(comment)) { | 298 | if (!Qt::mightBeRichText(comment)) { | ||
299 | // still might contain extra html tags for line breaks (this is the case for doxygen-style comments sometimes) | 299 | // still might contain extra html tags for line breaks (this is the case for doxygen-style comments sometimes) | ||
300 | // let's protect them from being removed completely | 300 | // let's protect them from being removed completely | ||
301 | comment.replace(QRegExp("<br */>"), QStringLiteral("\n")); | 301 | comment.replace(QRegExp("<br */>"), QStringLiteral("\n")); | ||
302 | comment = comment.toHtmlEscaped(); | 302 | comment = comment.toHtmlEscaped(); | ||
303 | comment.replace('\n', QLatin1String("<br />")); //Replicate newlines in html | 303 | comment.replace('\n', QLatin1String("<br />")); //Replicate newlines in html | ||
304 | } | 304 | } | ||
305 | modifyHtml() += commentHighlight(comment); | 305 | modifyHtml() += commentHighlight(comment); | ||
306 | modifyHtml() += QStringLiteral("<br />"); | 306 | modifyHtml() += QStringLiteral("</p>"); | ||
307 | } | 307 | } | ||
308 | } | 308 | } | ||
309 | 309 | | |||
310 | if(!shorten && doc) { | 310 | if(!shorten && doc) { | ||
311 | modifyHtml() += "<br />" + i18n("Show documentation for "); | 311 | modifyHtml() += "<p>" + i18n("Show documentation for "); | ||
312 | makeLink(prettyQualifiedName(m_declaration), | 312 | makeLink(prettyQualifiedName(m_declaration), | ||
313 | m_declaration, NavigationAction::ShowDocumentation); | 313 | m_declaration, NavigationAction::ShowDocumentation); | ||
314 | modifyHtml() += "</p>"; | ||||
314 | } | 315 | } | ||
315 | 316 | | |||
316 | 317 | | |||
317 | //modifyHtml() += "<br />"; | 318 | //modifyHtml() += "<br />"; | ||
318 | 319 | | |||
319 | addExternalHtml(m_suffix); | 320 | addExternalHtml(m_suffix); | ||
320 | 321 | | |||
321 | modifyHtml() += fontSizeSuffix(shorten) + "</p></body></html>"; | 322 | modifyHtml() += fontSizeSuffix(shorten) + "</p></body></html>"; | ||
▲ Show 20 Lines • Show All 443 Lines • Show Last 20 Lines |