Annotate libpurple constructors that return base types
Review Request #3837 — Created Feb. 14, 2025 and submitted — Latest diff uploaded
In that case, annotating the actual type will help bindings use the correct type.
Compared the gir before and after:
--- Purple-3.0.gir 2025-02-14 00:51:54.467548255 -0500 +++ build/libpurple/Purple-3.0.gir 2025-02-14 02:45:56.050535272 -0500 @@ -19676,8 +19676,9 @@ <return-value transfer-ownership="full"> <doc xml:space="preserve" filename="libpurple/purplenoopcredentialprovider.h" - line="62">The new #PurpleNoopCredentialProvider instance.</doc> - <type name="CredentialProvider" c:type="PurpleCredentialProvider*"/> + line="62">The new credential provider.</doc> + <type name="NoopCredentialProvider" + c:type="PurpleCredentialProvider*"/> </return-value> </constructor> </class> @@ -20412,7 +20413,7 @@ <doc xml:space="preserve" filename="libpurple/purplenotificationaddcontact.h" line="65">The new notification.</doc> - <type name="Notification" c:type="PurpleNotification*"/> + <type name="NotificationAddContact" c:type="PurpleNotification*"/> </return-value> <parameters> <parameter name="id" @@ -20507,7 +20508,8 @@ <doc xml:space="preserve" filename="libpurple/purplenotificationauthorizationrequest.h" line="65">The new notification.</doc> - <type name="Notification" c:type="PurpleNotification*"/> + <type name="NotificationAuthorizationRequest" + c:type="PurpleNotification*"/> </return-value> <parameters> <parameter name="id" @@ -20608,11 +20610,12 @@ line="55">Creates a new [class@Notification] for a connection error on @account.</doc> <source-position filename="libpurple/purplenotificationconnectionerror.h" line="67"/> - <return-value transfer-ownership="full" nullable="1"> + <return-value transfer-ownership="full"> <doc xml:space="preserve" filename="libpurple/purplenotificationconnectionerror.h" line="62">The new notification.</doc> - <type name="Notification" c:type="PurpleNotification*"/> + <type name="NotificationConnectionError" + c:type="PurpleNotification*"/> </return-value> <parameters> <parameter name="id" @@ -20668,7 +20671,7 @@ <doc xml:space="preserve" filename="libpurple/purplenotificationlink.h" line="61">The new notification.</doc> - <type name="Notification" c:type="PurpleNotification*"/> + <type name="NotificationLink" c:type="PurpleNotification*"/> </return-value> <parameters> <parameter name="id" @@ -21881,8 +21884,8 @@ <return-value transfer-ownership="full"> <doc xml:space="preserve" filename="libpurple/purpleplugininfo.h" - line="207">A new #PurplePluginInfo instance.</doc> - <type name="GPlugin.PluginInfo" c:type="GPluginPluginInfo*"/> + line="207">The new plugin info.</doc> + <type name="PluginInfo" c:type="GPluginPluginInfo*"/> </return-value> <parameters> <parameter name="first_property" transfer-ownership="none"> @@ -31364,7 +31367,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldaccount.h" line="79">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldAccount" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -31737,7 +31740,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldbool.h" line="61">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldBool" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -31918,7 +31921,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldchoice.h" line="61">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldChoice" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -32281,7 +32284,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldimage.h" line="63">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldImage" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -32508,7 +32511,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldint.h" line="61">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldInt" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -32825,7 +32828,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldlabel.h" line="58">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldLabel" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -32876,7 +32879,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldlist.h" line="58">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldList" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -33230,7 +33233,7 @@ <doc xml:space="preserve" filename="libpurple/request/purplerequestfieldstring.h" line="60">The new field.</doc> - <type name="RequestField" c:type="PurpleRequestField*"/> + <type name="RequestFieldString" c:type="PurpleRequestField*"/> </return-value> <parameters> <parameter name="id" transfer-ownership="none"> @@ -35252,8 +35255,8 @@ <return-value transfer-ownership="full"> <doc xml:space="preserve" filename="libpurple/purplesqlitehistoryadapter.h" - line="60">The new #PurpleSqliteHistoryAdapter instance.</doc> - <type name="HistoryAdapter" c:type="PurpleHistoryAdapter*"/> + line="60">The new history adapter.</doc> + <type name="SqliteHistoryAdapter" c:type="PurpleHistoryAdapter*"/> </return-value> <parameters> <parameter name="filename" transfer-ownership="none">