[gtk+/wip/baedert/children: 31/36] label: Remove :track-visited-links



commit 2b3c5dd967b65f5daaa850eb24cb3ba76a9a7f34
Author: Timm Bäder <mail baedert org>
Date:   Thu Dec 1 10:52:33 2016 +0100

    label: Remove :track-visited-links

 docs/reference/gtk/gtk4-sections.txt |    2 -
 gtk/gtklabel.c                       |   82 +---------------------------------
 gtk/gtklabel.h                       |    5 --
 3 files changed, 2 insertions(+), 87 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 3a66888..9c5f10f 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -1661,8 +1661,6 @@ gtk_label_set_use_markup
 gtk_label_set_use_underline
 gtk_label_set_single_line_mode
 gtk_label_get_current_uri
-gtk_label_set_track_visited_links
-gtk_label_get_track_visited_links
 <SUBSECTION Standard>
 GTK_LABEL
 GTK_IS_LABEL
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 613c6ca..1b0907c 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -274,7 +274,6 @@ struct _GtkLabelPrivate
   guint    in_click           : 1;
   guint    wrap_mode          : 3;
   guint    pattern_set        : 1;
-  guint    track_links        : 1;
 
   guint    mnemonic_keyval;
 
@@ -374,7 +373,6 @@ enum {
   PROP_WIDTH_CHARS,
   PROP_SINGLE_LINE_MODE,
   PROP_MAX_WIDTH_CHARS,
-  PROP_TRACK_VISITED_LINKS,
   PROP_LINES,
   PROP_XALIGN,
   PROP_YALIGN,
@@ -994,22 +992,6 @@ gtk_label_class_init (GtkLabelClass *class)
                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
 
   /**
-   * GtkLabel:track-visited-links:
-   *
-   * Set this property to %TRUE to make the label track which links
-   * have been visited. It will then apply the #GTK_STATE_FLAG_VISITED
-   * when rendering this link, in addition to #GTK_STATE_FLAG_LINK.
-   *
-   * Since: 2.18
-   */
-  label_props[PROP_TRACK_VISITED_LINKS] =
-      g_param_spec_boolean ("track-visited-links",
-                            P_("Track visited links"),
-                            P_("Whether visited links should be tracked"),
-                            TRUE,
-                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
-
-  /**
    * GtkLabel:lines:
    *
    * The number of lines to which an ellipsized, wrapping label
@@ -1207,9 +1189,6 @@ gtk_label_set_property (GObject      *object,
     case PROP_MAX_WIDTH_CHARS:
       gtk_label_set_max_width_chars (label, g_value_get_int (value));
       break;
-    case PROP_TRACK_VISITED_LINKS:
-      gtk_label_set_track_visited_links (label, g_value_get_boolean (value));
-      break;
     case PROP_LINES:
       gtk_label_set_lines (label, g_value_get_int (value));
       break;
@@ -1284,9 +1263,6 @@ gtk_label_get_property (GObject     *object,
     case PROP_MAX_WIDTH_CHARS:
       g_value_set_int (value, gtk_label_get_max_width_chars (label));
       break;
-    case PROP_TRACK_VISITED_LINKS:
-      g_value_set_boolean (value, gtk_label_get_track_visited_links (label));
-      break;
     case PROP_LINES:
       g_value_set_int (value, gtk_label_get_lines (label));
       break;
@@ -1328,7 +1304,6 @@ gtk_label_init (GtkLabel *label)
   priv->use_underline = FALSE;
   priv->use_markup = FALSE;
   priv->pattern_set = FALSE;
-  priv->track_links = TRUE;
 
   priv->mnemonic_keyval = GDK_KEY_VoidSymbol;
   priv->layout = NULL;
@@ -2390,7 +2365,7 @@ start_element_handler (GMarkupParseContext  *context,
 
       visited = FALSE;
       priv = pdata->label->priv;
-      if (priv->track_links && priv->select_info)
+      if (priv->select_info)
         {
           GList *l;
           for (l = priv->select_info->links; l; l = l->next)
@@ -6338,12 +6313,11 @@ static void
 emit_activate_link (GtkLabel     *label,
                     GtkLabelLink *link)
 {
-  GtkLabelPrivate *priv = label->priv;
   gboolean handled;
   GtkStateFlags state;
 
   g_signal_emit (label, signals[ACTIVATE_LINK], 0, link->uri, &handled);
-  if (handled && priv->track_links && !link->visited)
+  if (handled && !link->visited)
     {
       link->visited = TRUE;
       state = gtk_css_node_get_state (link->cssnode);
@@ -6438,58 +6412,6 @@ gtk_label_get_current_uri (GtkLabel *label)
   return NULL;
 }
 
-/**
- * gtk_label_set_track_visited_links:
- * @label: a #GtkLabel
- * @track_links: %TRUE to track visited links
- *
- * Sets whether the label should keep track of clicked
- * links (and use a different color for them).
- *
- * Since: 2.18
- */
-void
-gtk_label_set_track_visited_links (GtkLabel *label,
-                                   gboolean  track_links)
-{
-  GtkLabelPrivate *priv;
-
-  g_return_if_fail (GTK_IS_LABEL (label));
-
-  priv = label->priv;
-
-  track_links = track_links != FALSE;
-
-  if (priv->track_links != track_links)
-    {
-      priv->track_links = track_links;
-
-      /* FIXME: shouldn't have to redo everything here */
-      gtk_label_recalculate (label);
-
-      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_TRACK_VISITED_LINKS]);
-    }
-}
-
-/**
- * gtk_label_get_track_visited_links:
- * @label: a #GtkLabel
- *
- * Returns whether the label is currently keeping track
- * of clicked links.
- *
- * Returns: %TRUE if clicked links are remembered
- *
- * Since: 2.18
- */
-gboolean
-gtk_label_get_track_visited_links (GtkLabel *label)
-{
-  g_return_val_if_fail (GTK_IS_LABEL (label), FALSE);
-
-  return label->priv->track_links;
-}
-
 static gboolean
 gtk_label_query_tooltip (GtkWidget  *widget,
                          gint        x,
diff --git a/gtk/gtklabel.h b/gtk/gtklabel.h
index ea33db9..a9e2418 100644
--- a/gtk/gtklabel.h
+++ b/gtk/gtklabel.h
@@ -200,11 +200,6 @@ gboolean     gtk_label_get_single_line_mode  (GtkLabel *label);
 
 GDK_AVAILABLE_IN_ALL
 const gchar *gtk_label_get_current_uri (GtkLabel *label);
-GDK_AVAILABLE_IN_ALL
-void         gtk_label_set_track_visited_links  (GtkLabel *label,
-                                                 gboolean  track_links);
-GDK_AVAILABLE_IN_ALL
-gboolean     gtk_label_get_track_visited_links  (GtkLabel *label);
 
 GDK_AVAILABLE_IN_3_16
 void         gtk_label_set_xalign (GtkLabel *label,


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