=?utf-8?q?=5Bvaladoc=5D_Link_to_classes_rather_than_constructors_if_the_c?= =?utf-8?q?onstructors_don=E2=80=99t_exist?=



commit b27fcf040f280950d6ea681e784678c7e6841e30
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Aug 15 00:03:48 2012 +0200

    Link to classes rather than constructors if the constructors donât exist
    
    If a link would resolve to a constructor, but that constructor doesnât
    exist, link to the class itself instead.

 src/doclets/gtkdoc/commentconverter.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/doclets/gtkdoc/commentconverter.vala b/src/doclets/gtkdoc/commentconverter.vala
index 3b90d48..b758910 100644
--- a/src/doclets/gtkdoc/commentconverter.vala
+++ b/src/doclets/gtkdoc/commentconverter.vala
@@ -100,7 +100,13 @@ public class Gtkdoc.CommentConverter : ContentVisitor {
 
 	public override void visit_symbol_link (SymbolLink sl) {
 		if (sl.symbol != null) {
-			current_builder.append (get_docbook_link (sl.symbol, is_dbus) ?? sl.label);
+			// If the symbol is a method and it doesn't have a constructor, fall back to linking to the class
+			if (sl.symbol is Method && ((Method) sl.symbol).is_constructor &&
+			    ((Method) sl.symbol).parent is Class && ((Class) ((Method) sl.symbol).parent).is_abstract) {
+				current_builder.append (get_docbook_link (((Method) sl.symbol).parent, is_dbus) ?? sl.label);
+			} else {
+				current_builder.append (get_docbook_link (sl.symbol, is_dbus) ?? sl.label);
+			}
 		} else {
 			current_builder.append (sl.label);
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]