After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636319 - Add/Fix GObject introspection annotations
Add/Fix GObject introspection annotations
Status: RESOLVED FIXED
Product: gtranslator
Classification: Other
Component: general
HEAD
Other Linux
: Normal enhancement
: 2.0
Assigned To: gtranslator-maint
gtranslator-maint
Depends on:
Blocks:
 
 
Reported: 2010-12-02 19:37 UTC by Kenny Meyer
Modified: 2010-12-02 21:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add/Fix GObject annotations patch (16.54 KB, patch)
2010-12-02 19:37 UTC, Kenny Meyer
needs-work Details | Review
Add/Fix GObject annotations patch (16.82 KB, patch)
2010-12-02 20:41 UTC, Kenny Meyer
needs-work Details | Review
Add/Fix GObject annotations patch (21.01 KB, patch)
2010-12-02 21:22 UTC, Kenny Meyer
needs-work Details | Review
Add/Fix GObject annotations patch (21.01 KB, patch)
2010-12-02 21:39 UTC, Kenny Meyer
committed Details | Review

Description Kenny Meyer 2010-12-02 19:37:30 UTC
Created attachment 175731 [details] [review]
Add/Fix GObject annotations patch

When building src/ there were some warnings from the GIR typelib converter. The attached patch fixes that.

(Some) warnings before the patch:
gtr-msg.c:192: Warning: Gtranslator: gtr_msg_set_iterator: unknown parameter 'message' in documentation comment, should be one of 'msg', 'iter'
gtr-msg.c:256: Warning: Gtranslator: gtr_msg_set_row_reference: unknown parameter 'tree_iter' in documentation comment, should be one of 'msg', 'row_reference'
gtr-po.c:360: Warning: Gtranslator: gtr_po_parse: unknown parameter 'location' in documentation comment, should be one of 'po', 'filename', 'error'
gtr-notebook.c:144: Warning: Gtranslator: gtr_notebook_add_page: unknown parameter 'tab' in documentation comment, should be one of 'notebook', 'pax'
gtr-notebook.c:169: Warning: Gtranslator: gtr_notebook_remove_page: unknown parameter 'page_num' in documentation comment, should be one of 'notebook', 'i'
gtr-msg.c:179: Warning: Gtranslator: gtr_msg_get_iterator: return value: Unresolved type: 'po_message_iterator_t'
gtr-msg.c:189: Warning: Gtranslator: gtr_msg_set_iterator: argument iter: Unresolved type: 'po_message_iterator_t'
gtr-msg.c:210: Warning: Gtranslator: gtr_msg_get_message: return value: Unresolved type: 'po_message_t'
gtr-msg.c:220: Warning: Gtranslator: gtr_msg_set_message: argument message: Unresolved type: 'po_message_t'
gtr-msg.c:145: Warning: Gtranslator: gtr_msg_new: argument iter: Unresolved type: 'po_message_iterator_t'
gtr-msg.c:145: Warning: Gtranslator: gtr_msg_new: argument message: Unresolved type: 'po_message_t'
gtr-header.h:125: Warning: Gtranslator: gtr_header_get_profile: return value: Missing (transfer) annotation
gtr-header.h:69: Warning: Gtranslator: gtr_header_new: argument iter: Unresolved type: 'po_message_iterator_t'
gtr-header.h:69: Warning: Gtranslator: gtr_header_new: argument message: Unresolved type: 'po_message_t'
gtr-context.h:73: Warning: Gtranslator: gtr_context_panel_get_context_text_view: return value: Missing (transfer) annotation
gtr-po.h:112: Warning: Gtranslator: gtr_po_get_location: return value: Missing (transfer) annotation
gtr-po.c:700: Warning: Gtranslator: gtr_po_get_messages: return value: Missing (transfer) annotation
gtr-po.c:725: Warning: Gtranslator: gtr_po_get_current_message: return value: Missing (transfer) annotation
gtr-po.c:754: Warning: Gtranslator: gtr_po_get_domains: return value: Missing (transfer) annotation
gtr-po.c:766: Warning: Gtranslator: gtr_po_get_po_file: return value: Unresolved type: 'po_file_t'
gtr-po.c:778: Warning: Gtranslator: gtr_po_get_next_fuzzy: return value: Missing (transfer) annotation
gtr-po.c:800: Warning: Gtranslator: gtr_po_get_prev_fuzzy: return value: Missing (transfer) annotation
gtr-po.c:822: Warning: Gtranslator: gtr_po_get_next_untrans: return value: Missing (transfer) annotation
gtr-po.c:844: Warning: Gtranslator: gtr_po_get_prev_untrans: return value: Missing (transfer) annotation
gtr-po.c:866: Warning: Gtranslator: gtr_po_get_next_fuzzy_or_untrans: return value: Missing (transfer) annotation
gtr-po.c:888: Warning: Gtranslator: gtr_po_get_prev_fuzzy_or_untrans: return value: Missing (transfer) annotation
gtr-po.c:906: Warning: Gtranslator: gtr_po_get_msg_from_number: return value: Missing (transfer) annotation
gtr-po.c:925: Warning: Gtranslator: gtr_po_get_header: return value: Missing (transfer) annotation
gtr-tab.c:923: Warning: Gtranslator: gtr_tab_get_po: return value: Missing (transfer) annotation
gtr-tab.c:948: Warning: Gtranslator: gtr_tab_get_context_panel: return value: Missing (transfer) annotation
gtr-tab.c:960: Warning: Gtranslator: gtr_tab_get_translation_memory_ui: return value: Missing (transfer) annotation
gtr-tab.c:974: Warning: Gtranslator: gtr_tab_get_active_view: return value: Missing (transfer) annotation
gtr-tab.c:994: Warning: Gtranslator: gtr_tab_get_all_views: return value: Missing (transfer) annotation
gtr-tab.c:1189: Warning: Gtranslator: gtr_tab_get_from_document: return value: Missing (transfer) annotation
gtr-notebook.c:197: Warning: Gtranslator: gtr_notebook_get_page: return value: Missing (transfer) annotation
gtr-window.c:2085: Warning: Gtranslator: gtr_window_create_tab: return value: Missing (transfer) annotation
gtr-window.c:2106: Warning: Gtranslator: gtr_window_get_active_tab: return value: Missing (transfer) annotation
gtr-window.c:2120: Warning: Gtranslator: gtr_window_get_all_tabs: return value: Missing (transfer) annotation
gtr-window.c:2179: Warning: Gtranslator: gtr_window_get_notebook: return value: Missing (transfer) annotation
gtr-window.c:2151: Warning: Gtranslator: gtr_window_get_header_from_active_tab: return value: Missing (transfer) annotation
gtr-window.c:2193: Warning: Gtranslator: gtr_window_get_statusbar: return value: Missing (transfer) annotation
gtr-window.c:2207: Warning: Gtranslator: gtr_window_get_ui_manager: return value: Missing (transfer) annotation
gtr-window.c:2222: Warning: Gtranslator: gtr_window_get_active_view: return value: Missing (transfer) annotation
gtr-window.c:2245: Warning: Gtranslator: gtr_window_get_all_views: return value: Missing (transfer) annotation
gtr-window.h:128: Warning: Gtranslator: gtr_window_get_tab_from_location: return value: Missing (transfer) annotation
gtr-window.h:137: Warning: Gtranslator: gtr_window_get_tm_menu: return value: Missing (transfer) annotation
gtr-application.c:565: Warning: Gtranslator: gtr_application_get_views: return value: Missing (transfer) annotation
gtr-application.h:82: Warning: Gtranslator: gtr_application_create_window: return value: Missing (transfer) annotation
gtr-application.c:587: Warning: Gtranslator: gtr_application_get_active_window: return value: Missing (transfer) annotation
gtr-application.h:92: Warning: Gtranslator: gtr_application_get_translation_memory: return value: Missing (transfer) annotation
gtr-application.c:469: Warning: Gtranslator: gtr_application_get_default: return value: Missing (transfer) annotation

Warnings after the patch:

gtr-msg.c:179: Warning: Gtranslator: gtr_msg_get_iterator: return value: Unresolved type: 'po_message_iterator_t'
gtr-msg.c:189: Warning: Gtranslator: gtr_msg_set_iterator: argument iter: Unresolved type: 'po_message_iterator_t'
gtr-msg.c:210: Warning: Gtranslator: gtr_msg_get_message: return value: Unresolved type: 'po_message_t'
gtr-msg.c:220: Warning: Gtranslator: gtr_msg_set_message: argument message: Unresolved type: 'po_message_t'
gtr-msg.c:145: Warning: Gtranslator: gtr_msg_new: argument iter: Unresolved type: 'po_message_iterator_t'
gtr-msg.c:145: Warning: Gtranslator: gtr_msg_new: argument message: Unresolved type: 'po_message_t'
gtr-header.h:69: Warning: Gtranslator: gtr_header_new: argument iter: Unresolved type: 'po_message_iterator_t'
gtr-header.h:69: Warning: Gtranslator: gtr_header_new: argument message: Unresolved type: 'po_message_t'
gtr-po.c:769: Warning: Gtranslator: gtr_po_get_po_file: return value: Unresolved type: 'po_file_t'
Comment 1 Ignacio Casal Quinteiro (nacho) 2010-12-02 19:46:57 UTC
Review of attachment 175731 [details] [review]:

Comments inline.

::: src/gtr-application.c
@@ +481,3 @@
  * Creates a new #GtrWindow and shows it.
  * 
+ * Returns: (transfer full):  the #GtrWindow to be opened

this is transfer none

@@ +563,3 @@
  * Returns all the views currently present in #GtranslationApplication.
  *
+ * Return value: (transfer full): a newly allocated list of #GtranslationApplication objects

this is wrong, it should be transfer container. because you don't want the views to get freed

@@ +585,3 @@
  * @app: a #GtrApplication
  * 
+ * Return value: (transfer full): the active #GtrWindow

transfer none

@@ +666,3 @@
+ * Gets the translation memory.
+ *
+ * Returns: (transfer full): Get the translation memory.

none

::: src/gtr-context.c
@@ +516,3 @@
  * @panel: a #GtrContextPanel
  *
+ * Returns: (transfer full): the context #GtkTextView

wrong, here is transfer none

::: src/gtr-header.c
@@ +743,3 @@
+ * Gets the profile of the header
+ *
+ * Return value: (transfer full): the profile of the header.

none

::: src/gtr-notebook.c
@@ +195,3 @@
  * Gets the selected page in the #GtrNotebook.
  * 
+ * Returns: (transfer full): the selected page in the @notebook

none

::: src/gtr-po.c
@@ +699,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the messages list

container

@@ +724,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the current message

none

@@ +753,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the domains list

none

@@ +779,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the next fuzzy message

none

@@ +801,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the previously fuzzy message

none

@@ +823,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the next untranslated message

none

@@ +845,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the previously untranslated

none

@@ +868,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the next fuzzy or untranslated

none

@@ +891,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): a pointer to the previously fuzzy or

none

@@ +917,3 @@
  * Gets the message at the given position.
+ *
+ * Returns: (transfer full): the message at the given position.

none

@@ +931,3 @@
  * @po: a #GtrPo
  *
+ * Return value: (transfer full): The #GtrHeader of the @po.

none

::: src/gtr-tab.c
@@ +921,3 @@
  * @tab: a #GtrTab
  *
+ * Return value: (transfer full): the #GtrPo stored in the #GtrTab

none

@@ +946,3 @@
  * @tab: a #GtrTab
  *
+ * Return value: (transfer full): the #GtranslaorContextPanel

none

@@ +958,3 @@
  * @tab: a #GtrTab
  *
+ * Returns: (transfer full): the #GtrTranslationMemoryUi panel.

none

@@ +992,3 @@
  * Returns all the views currently present in #GtranslationTab
  *
+ * Return: (transfer full): a newly allocated list of #GtranslationTab objects

container

@@ +1187,3 @@
  * Returns the #GtrTab for a specific #GtrPo.
  *
+ * Returns: (transfer full): the #GtrTab for a specific #GtrPo

none

::: src/gtr-window.c
@@ +2083,3 @@
  * #GtrTab.
  * 
+ * Returns: (transfer full): a new #GtrTab object

none

@@ +2104,3 @@
  * Gets the active #GtrTab of the @window.
  *
+ * Returns: (transfer full): the active #GtrTab of the @window.

none

@@ +2150,3 @@
  * #GtrTab.
  *
+ * Returns: (transfer full): the #GtrHeader of the #GtrPo of in the active

container

@@ +2178,3 @@
  * Gets the main #GtrNotebook of the @window.
  *
+ * Returns: (transfer full): the #GtrNotebook of the @window

none

@@ +2192,3 @@
  * Gets the statusbar widget of the window.
  *
+ * Returns: (transfer full): the statusbar widget of the window

none

@@ +2206,3 @@
  * Gets the #GtkUIManager of the window.
  *
+ * Returns: (transfer full): the #GtkUIManager of the @window

none

@@ +2221,3 @@
  * NULL if there is not tab opened.
  *
+ * Returns: (transfer full): the active translation view in the

none

@@ +2222,3 @@
  *
+ * Returns: (transfer full): the active translation view in the
+ * #GtranslationWindow or NULL if there is not tab opened.

should be %NULL

@@ +2244,3 @@
  * Returns all the views currently present in #GtranslationWindow
  *
+ * Return value: (transfer full): a newly allocated list of #GtranslationWindow objects

container

@@ +2336,3 @@
  * @location.
  *
+ * Returns: (transfer full): the #GtrTab which @location matches with its po file.

none

@@ +2420,3 @@
+ * @window: a #GtrWindow
+ *
+ * Returns: (transfer full): get the tm_menu GtkWidget instance.

none, also check if this method is used somewhere, if not remove it.
Comment 2 Kenny Meyer 2010-12-02 20:40:59 UTC
(In reply to comment #1)
> @@ +2420,3 @@
> + * @window: a #GtrWindow
> + *
> + * Returns: (transfer full): get the tm_menu GtkWidget instance.
> 
> none, also check if this method is used somewhere, if not remove it.

Yes, it is used here: 

translation-memory/gtr-translation-memory-ui.c
152:  tm_menu = gtr_window_get_tm_menu (window);
Comment 3 Kenny Meyer 2010-12-02 20:41:15 UTC
Created attachment 175732 [details] [review]
Add/Fix GObject annotations patch
Comment 4 Ignacio Casal Quinteiro (nacho) 2010-12-02 20:50:41 UTC
Review of attachment 175732 [details] [review]:

some more comments.

::: src/gtr-application.c
@@ +467,3 @@
  * Returns the default instance of the application.
  * 
+ * Returns: (transfer full): the default instance of the application.

ups this should be none.

@@ +563,3 @@
  * Returns all the views currently present in #GtranslationApplication.
  *
+ * Return value: (transfer none): a newly allocated list of #GtranslationApplication objects

container

::: src/gtr-tab.c
@@ +992,3 @@
  * Returns all the views currently present in #GtranslationTab
  *
+ * Return: (transfer none): a newly allocated list of #GtranslationTab objects

container

::: src/gtr-window.c
@@ +2118,3 @@
  * Gets a list of all tabs in the @window or NULL if there is no tab opened.
  *
+ * Returns: (transfer full): a list of all tabs in the @window or NULL if there

container

@@ +2150,3 @@
  * #GtrTab.
  *
+ * Returns: (transfer container): the #GtrHeader of the #GtrPo of in the active

none

@@ +2221,3 @@
  * NULL if there is not tab opened.
  *
+ * Returns: (transfer full): the active translation view in the

none

@@ +2336,3 @@
  * @location.
  *
+ * Returns: (transfer container): the #GtrTab which @location matches with its po file.

none
Comment 5 Kenny Meyer 2010-12-02 21:22:45 UTC
Created attachment 175734 [details] [review]
Add/Fix GObject annotations patch

Fixed the previous issues and updated annotations in src/gtr-po.c which I didn't include previously.
Comment 6 Ignacio Casal Quinteiro (nacho) 2010-12-02 21:28:17 UTC
Review of attachment 175734 [details] [review]:

One more fix needed.

::: src/gtr-msg.c
@@ +662,3 @@
  * is marked as being a format string.  
+ *
+ * Return value: (transfer none): the message error or NULL if there is not any

full
Comment 7 Kenny Meyer 2010-12-02 21:39:39 UTC
Created attachment 175736 [details] [review]
Add/Fix GObject annotations patch

+ * Return value: (transfer full): the message error or NULL if there is not any

Done.
Comment 8 Ignacio Casal Quinteiro (nacho) 2010-12-02 21:42:25 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.