[gnome-terminal] app: Rename some variables related to regex matching



commit 0789b02ee11038743fde08795eb4a1ac0bcc3f47
Author: Egmont Koblinger <egmont gmail com>
Date:   Sat Oct 24 00:42:11 2015 +0200

    app: Rename some variables related to regex matching
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741728

 src/terminal-screen.c |   40 ++++++++++++++++++++--------------------
 src/terminal-screen.h |    8 ++++----
 src/terminal-util.c   |    2 +-
 src/terminal-util.h   |    2 +-
 src/terminal-window.c |   18 +++++++++---------
 5 files changed, 35 insertions(+), 35 deletions(-)
---
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 017bb63..a30726e 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -75,7 +75,7 @@ typedef struct {
 typedef struct
 {
   int tag;
-  TerminalURLFlavour flavor;
+  TerminalURLFlavor flavor;
 } TagData;
 
 struct _TerminalScreenPrivate
@@ -176,7 +176,7 @@ static guint signals[LAST_SIGNAL];
 
 typedef struct {
   const char *pattern;
-  TerminalURLFlavour flavor;
+  TerminalURLFlavor flavor;
   gboolean caseless;
 } TerminalRegexPattern;
 
@@ -193,7 +193,7 @@ static VteRegex **url_regexes;
 #else
 static GRegex **url_regexes;
 #endif
-static TerminalURLFlavour *url_regex_flavors;
+static TerminalURLFlavor *url_regex_flavors;
 static guint n_url_regexes;
 
 /* See bug #697024 */
@@ -228,7 +228,7 @@ precompile_regexes (const TerminalRegexPattern *regex_patterns,
 #else
                     GRegex ***regexes,
 #endif
-                    TerminalURLFlavour **regex_flavors)
+                    TerminalURLFlavor **regex_flavors)
 {
   guint i;
 
@@ -237,7 +237,7 @@ precompile_regexes (const TerminalRegexPattern *regex_patterns,
 #else
   *regexes = g_new0 (GRegex*, n_regexes);
 #endif
-  *regex_flavors = g_new0 (TerminalURLFlavour, n_regexes);
+  *regex_flavors = g_new0 (TerminalURLFlavor, n_regexes);
 
   for (i = 0; i < n_regexes; ++i)
     {
@@ -1444,7 +1444,7 @@ terminal_screen_popup_info_unref (TerminalScreenPopupInfo *info)
 
   g_object_unref (info->screen);
   g_weak_ref_clear (&info->window_weak_ref);
-  g_free (info->string);
+  g_free (info->url);
   g_slice_free (TerminalScreenPopupInfo, info);
 }
 
@@ -1481,8 +1481,8 @@ terminal_screen_popup_menu (GtkWidget *widget)
 static void
 terminal_screen_do_popup (TerminalScreen *screen,
                           GdkEventButton *event,
-                          char *matched_string,
-                          int matched_flavor)
+                          char *url,
+                          int url_flavor)
 {
   TerminalScreenPopupInfo *info;
 
@@ -1490,8 +1490,8 @@ terminal_screen_do_popup (TerminalScreen *screen,
   info->button = event->button;
   info->state = event->state & gtk_accelerator_get_default_mod_mask ();
   info->timestamp = event->time;
-  info->string = matched_string; /* adopted */
-  info->flavour = matched_flavor;
+  info->url = url; /* adopted */
+  info->url_flavor = url_flavor;
 
   g_signal_emit (screen, signals[SHOW_POPUP_MENU], 0, info);
   terminal_screen_popup_info_unref (info);
@@ -1504,23 +1504,23 @@ terminal_screen_button_press (GtkWidget      *widget,
   TerminalScreen *screen = TERMINAL_SCREEN (widget);
   gboolean (* button_press_event) (GtkWidget*, GdkEventButton*) =
     GTK_WIDGET_CLASS (terminal_screen_parent_class)->button_press_event;
-  gs_free char *matched_string = NULL;
-  int matched_flavor = 0;
+  gs_free char *url = NULL;
+  int url_flavor = 0;
   guint state;
 
   state = event->state & gtk_accelerator_get_default_mod_mask ();
 
-  matched_string = terminal_screen_check_match (screen, (GdkEvent*)event, &matched_flavor);
+  url = terminal_screen_check_match (screen, (GdkEvent*)event, &url_flavor);
 
-  if (matched_string != NULL &&
+  if (url != NULL &&
       (event->button == 1 || event->button == 2) &&
       (state & GDK_CONTROL_MASK))
     {
       gboolean handled = FALSE;
 
       g_signal_emit (screen, signals[MATCH_CLICKED], 0,
-                     matched_string,
-                     matched_flavor,
+                     url,
+                     url_flavor,
                      state,
                      &handled);
       if (handled)
@@ -1536,15 +1536,15 @@ terminal_screen_button_press (GtkWidget      *widget,
           if (button_press_event && button_press_event (widget, event))
             return TRUE;
 
-          terminal_screen_do_popup (screen, event, matched_string, matched_flavor);
-          matched_string = NULL; /* adopted to the popup info */
+          terminal_screen_do_popup (screen, event, url, url_flavor);
+          url = NULL; /* adopted to the popup info */
           return TRUE;
         }
       else if (!(event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
         {
           /* do popup on shift+right-click */
-          terminal_screen_do_popup (screen, event, matched_string, matched_flavor);
-          matched_string = NULL; /* adopted to the popup info */
+          terminal_screen_do_popup (screen, event, url, url_flavor);
+          url = NULL; /* adopted to the popup info */
           return TRUE;
         }
     }
diff --git a/src/terminal-screen.h b/src/terminal-screen.h
index a168e57..5ac7f4c 100644
--- a/src/terminal-screen.h
+++ b/src/terminal-screen.h
@@ -31,7 +31,7 @@ typedef enum {
   FLAVOR_DEFAULT_TO_HTTP,
   FLAVOR_VOIP_CALL,
   FLAVOR_EMAIL
-} TerminalURLFlavour;
+} TerminalURLFlavor;
 
 /* Forward decls */
 typedef struct _TerminalScreenPopupInfo TerminalScreenPopupInfo;
@@ -65,7 +65,7 @@ struct _TerminalScreenClass
                                TerminalScreenPopupInfo *info);
   gboolean (* match_clicked)  (TerminalScreen *screen,
                                const char *url,
-                               int flavour,
+                               int flavor,
                                guint state);
   void (* close_screen)       (TerminalScreen *screen);
 };
@@ -137,8 +137,8 @@ struct _TerminalScreenPopupInfo {
   int ref_count;
   GWeakRef window_weak_ref;
   TerminalScreen *screen;
-  char *string;
-  TerminalURLFlavour flavour;
+  char *url;
+  TerminalURLFlavor url_flavor;
   guint button;
   guint state;
   guint32 timestamp;
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 2c4e0ff..973bd19 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -278,7 +278,7 @@ terminal_util_set_atk_name_description (GtkWidget  *widget,
 void
 terminal_util_open_url (GtkWidget *parent,
                         const char *orig_url,
-                        TerminalURLFlavour flavor,
+                        TerminalURLFlavor flavor,
                         guint32 user_time)
 {
   gs_free_error GError *error = NULL;
diff --git a/src/terminal-util.h b/src/terminal-util.h
index d4b5ae3..b3f9df1 100644
--- a/src/terminal-util.h
+++ b/src/terminal-util.h
@@ -43,7 +43,7 @@ void terminal_util_set_atk_name_description (GtkWidget  *widget,
 
 void terminal_util_open_url (GtkWidget *parent,
                              const char *orig_url,
-                             TerminalURLFlavour flavor,
+                             TerminalURLFlavor flavor,
                              guint32 user_time);
 
 void terminal_util_transform_uris_to_quoted_fuse_paths (char **uris);
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 645945f..e7e7e9c 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -1957,7 +1957,7 @@ popup_open_url_callback (GtkAction *action,
   if (info == NULL)
     return;
 
-  terminal_util_open_url (GTK_WIDGET (window), info->string, info->flavour,
+  terminal_util_open_url (GTK_WIDGET (window), info->url, info->url_flavor,
                           gtk_get_current_event_time ());
 }
 
@@ -1972,11 +1972,11 @@ popup_copy_url_callback (GtkAction *action,
   if (info == NULL)
     return;
 
-  if (info->string == NULL)
+  if (info->url == NULL)
     return;
 
   clipboard = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_CLIPBOARD);
-  gtk_clipboard_set_text (clipboard, info->string, -1);
+  gtk_clipboard_set_text (clipboard, info->url, -1);
 }
 
 static void
@@ -2069,9 +2069,9 @@ popup_clipboard_targets_received_cb (GtkClipboard *clipboard,
 
   can_paste = targets != NULL && gtk_targets_include_text (targets, n_targets);
   can_paste_uris = targets != NULL && gtk_targets_include_uri (targets, n_targets);
-  show_link = info->string != NULL && (info->flavour == FLAVOR_AS_IS || info->flavour == 
FLAVOR_DEFAULT_TO_HTTP);
-  show_email_link = info->string != NULL && info->flavour == FLAVOR_EMAIL;
-  show_call_link = info->string != NULL && info->flavour == FLAVOR_VOIP_CALL;
+  show_link = info->url != NULL && (info->url_flavor == FLAVOR_AS_IS || info->url_flavor == 
FLAVOR_DEFAULT_TO_HTTP);
+  show_email_link = info->url != NULL && info->url_flavor == FLAVOR_EMAIL;
+  show_call_link = info->url != NULL && info->url_flavor == FLAVOR_VOIP_CALL;
 
   action = gtk_action_group_get_action (priv->action_group, "PopupSendEmail");
   gtk_action_set_visible (action, show_email_link);
@@ -2131,8 +2131,8 @@ screen_show_popup_menu_callback (TerminalScreen *screen,
 
 static gboolean
 screen_match_clicked_cb (TerminalScreen *screen,
-                         const char *match,
-                         int flavour,
+                         const char *url,
+                         int url_flavor,
                          guint state,
                          TerminalWindow *window)
 {
@@ -2142,7 +2142,7 @@ screen_match_clicked_cb (TerminalScreen *screen,
     return FALSE;
 
   gtk_widget_grab_focus (GTK_WIDGET (screen));
-  terminal_util_open_url (GTK_WIDGET (window), match, flavour,
+  terminal_util_open_url (GTK_WIDGET (window), url, url_flavor,
                           gtk_get_current_event_time ());
 
   return TRUE;


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