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 697048 - GtkTextView: small code improvements
GtkTextView: small code improvements
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-04-01 14:55 UTC by Sébastien Wilmet
Modified: 2013-04-01 19:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Doc: move the GtkTextAttributes struct (1012 bytes, patch)
2013-04-01 14:55 UTC, Sébastien Wilmet
accepted-commit_now Details | Review
Doc: remove dead link to gtk_widget_override_text() (1.22 KB, patch)
2013-04-01 14:55 UTC, Sébastien Wilmet
reviewed Details | Review
gtktexttypes: remove inline_byte_begins_utf8_char() (916 bytes, patch)
2013-04-01 14:55 UTC, Sébastien Wilmet
accepted-commit_now Details | Review
gtktextattributes: remove outdated comment (988 bytes, patch)
2013-04-01 14:55 UTC, Sébastien Wilmet
reviewed Details | Review
gtktextattributes: include the right headers (768 bytes, patch)
2013-04-01 14:55 UTC, Sébastien Wilmet
accepted-commit_now Details | Review
gtktextattributes: explain what is "pg_bg" (840 bytes, patch)
2013-04-01 14:56 UTC, Sébastien Wilmet
accepted-commit_now Details | Review
GtkTextView: remove some dead code (1.08 KB, patch)
2013-04-01 14:56 UTC, Sébastien Wilmet
accepted-commit_now Details | Review
GtkTextView: minor code style improvements (7.82 KB, patch)
2013-04-01 14:56 UTC, Sébastien Wilmet
reviewed Details | Review
GtkTextTagTable: simplify a bit the code (5.34 KB, patch)
2013-04-01 14:56 UTC, Sébastien Wilmet
accepted-commit_now Details | Review

Description Sébastien Wilmet 2013-04-01 14:55:36 UTC
As I'm reading the code, I prefer to improve things at the same time.
Comment 1 Sébastien Wilmet 2013-04-01 14:55:39 UTC
Created attachment 240308 [details] [review]
Doc: move the GtkTextAttributes struct

It's more logical to have the GtkTextAttributes and GtkTextAppearance
structs together. And it creates a separation between gtk_text_tag and
gtk_text_attributes functions.
Comment 2 Sébastien Wilmet 2013-04-01 14:55:43 UTC
Created attachment 240309 [details] [review]
Doc: remove dead link to gtk_widget_override_text()

The function doesn't exist.
Comment 3 Sébastien Wilmet 2013-04-01 14:55:47 UTC
Created attachment 240310 [details] [review]
gtktexttypes: remove inline_byte_begins_utf8_char()

The function was used only in gtk_text_byte_begins_utf8_char().
Comment 4 Sébastien Wilmet 2013-04-01 14:55:51 UTC
Created attachment 240311 [details] [review]
gtktextattributes: remove outdated comment

GTK_WRAPMODE_CHAR etc don't exist anymore, it seems that the names have
changed. Anyway the comment is not really useful.
Comment 5 Sébastien Wilmet 2013-04-01 14:55:56 UTC
Created attachment 240312 [details] [review]
gtktextattributes: include the right headers

Some function prototypes in gtktexttagprivate.h are implemented in
gtktextattributes.c.
Comment 6 Sébastien Wilmet 2013-04-01 14:56:00 UTC
Created attachment 240313 [details] [review]
gtktextattributes: explain what is "pg_bg"

I didn't know what "pg" stands for.
Comment 7 Sébastien Wilmet 2013-04-01 14:56:06 UTC
Created attachment 240314 [details] [review]
GtkTextView: remove some dead code
Comment 8 Sébastien Wilmet 2013-04-01 14:56:10 UTC
Created attachment 240315 [details] [review]
GtkTextView: minor code style improvements
Comment 9 Sébastien Wilmet 2013-04-01 14:56:15 UTC
Created attachment 240316 [details] [review]
GtkTextTagTable: simplify a bit the code
Comment 10 Cosimo Cecchi 2013-04-01 18:01:18 UTC
Review of attachment 240308 [details] [review]:

OK
Comment 11 Cosimo Cecchi 2013-04-01 18:02:09 UTC
Review of attachment 240309 [details] [review]:

I believe the intention was to mention gtk_widget_override_color() here instead.
Comment 12 Cosimo Cecchi 2013-04-01 18:02:30 UTC
Review of attachment 240310 [details] [review]:

OK
Comment 13 Cosimo Cecchi 2013-04-01 18:03:31 UTC
Review of attachment 240311 [details] [review]:

I'd just update the comment with the correct values.
Comment 14 Cosimo Cecchi 2013-04-01 18:03:48 UTC
Review of attachment 240312 [details] [review]:

OK
Comment 15 Cosimo Cecchi 2013-04-01 18:04:03 UTC
Review of attachment 240313 [details] [review]:

Sure
Comment 16 Cosimo Cecchi 2013-04-01 18:04:27 UTC
Review of attachment 240314 [details] [review]:

OK
Comment 17 Cosimo Cecchi 2013-04-01 18:07:16 UTC
Review of attachment 240315 [details] [review]:

Honestly this is quite some churn for no real value...shuffling code around also makes it harder to follow the code history e.g. with git bisect.
In general I'd rather not take this patch, except for this part below.

::: gtk/gtktextattributes.h
@@ +106,3 @@
+ * As with most GTK+ structs, the fields in this struct should only
+ * be read, never modified directly.
+ */

This (moving the comment above the relevant struct) is OK
Comment 18 Cosimo Cecchi 2013-04-01 18:08:10 UTC
Review of attachment 240316 [details] [review]:

Nice cleanup.
Comment 19 Sébastien Wilmet 2013-04-01 19:16:51 UTC
Thanks for the review! I've adapted and pushed the commits.