[gnome-terminal] Remove S/Key support



commit 4314db8b4a52574d14a9f6c2c1dd3c1a352b5725
Author: Christian Persch <chpe gnome org>
Date:   Wed Nov 17 17:53:53 2010 +0100

    Remove S/Key support
    
    Bug #635063.

 configure.ac                  |   18 ---
 po/POTFILES.in                |    2 -
 po/POTFILES.skip              |    1 -
 src/Makefile.am               |   13 --
 src/gnome-terminal.schemas.in |   17 --
 src/skey-challenge.glade      |  198 ------------------------
 src/skey-popup.c              |  228 ----------------------------
 src/skey-popup.h              |   35 -----
 src/skey/Makefile.am          |   60 --------
 src/skey/btoe.c               |  304 -------------------------------------
 src/skey/btoe.h               |    2 -
 src/skey/md4.c                |  335 -----------------------------------------
 src/skey/md4.h                |   19 ---
 src/skey/md5.c                |   67 --------
 src/skey/md5.h                |    9 -
 src/skey/sha1.c               |  112 --------------
 src/skey/sha1.h               |    9 -
 src/skey/skey.c               |   37 -----
 src/skey/skey.h               |   10 --
 src/skey/skeyutil.c           |   24 ---
 src/skey/skeyutil.h           |    3 -
 src/skey/test.c               |   99 ------------
 src/terminal-profile.c        |    4 -
 src/terminal-profile.h        |    1 -
 src/terminal-screen.c         |  106 ++------------
 src/terminal-screen.h         |    3 +-
 src/terminal-util.c           |    2 -
 src/terminal-window.c         |   20 +--
 28 files changed, 15 insertions(+), 1723 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f3937c5..c487415 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,22 +139,6 @@ if test "$GTK_BUILDER_CONVERT" = "false"; then
   AC_MSG_ERROR([gtk-builder-convert not found])
 fi
 
-# *****
-# S/Key
-# *****
-
-AC_MSG_CHECKING([whether to enable s/key support])
-AC_ARG_ENABLE([skey],
-  [AS_HELP_STRING([--disable-skey],[disable s/key support (default: enabled)])],
-  [],[enable_skey=yes])
-AC_MSG_RESULT([$enable_skey])
-
-if test "$enable_skey" = "yes"; then
-  AC_DEFINE([ENABLE_SKEY],[1],[Define if s/key support is enabled])
-fi
-
-AM_CONDITIONAL([ENABLE_SKEY],[test "$enable_skey" = "yes"])
-
 # *************
 # Documentation
 # *************
@@ -175,7 +159,6 @@ Makefile
 gnome-terminal.desktop.in
 src/Makefile
 src/terminal-version.h
-src/skey/Makefile
 help/Makefile
 help/bg/Makefile
 help/ro/Makefile
@@ -195,5 +178,4 @@ gnome-terminal-$VERSION:
 	compiler:		${CC}
 
         using smclient:         ${with_smclient}
-        s/key support:          ${enable_skey}
 "
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 28708dc..5c5d8f3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -11,8 +11,6 @@ src/profile-editor.c
 src/profile-manager.glade
 src/profile-new-dialog.glade
 src/profile-preferences.glade
-src/skey-challenge.glade
-src/skey-popup.c
 src/terminal-accels.c
 src/terminal-app.c
 src/terminal.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 5946c28..a395e30 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -8,5 +8,4 @@ src/keybinding-editor.ui
 src/profile-manager.ui
 src/profile-new-dialog.ui
 src/profile-preferences.ui
-src/skey-challenge.ui
 src/terminal-find.ui
diff --git a/src/Makefile.am b/src/Makefile.am
index af271e6..634fa20 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,5 @@
 NULL =
 
-if ENABLE_SKEY
-SUBDIRS = skey
-endif
-
 bin_PROGRAMS = gnome-terminal
 
 BUILT_SOURCES = \
@@ -51,13 +47,6 @@ gnome_terminal_SOURCES= \
 	terminal-window.h \
 	$(NULL)
 
-if ENABLE_SKEY
-gnome_terminal_SOURCES += \
-	skey-popup.c \
-	skey-popup.h \
-	$(NULL)
-endif
-
 nodist_gnome_terminal_SOURCES= $(BUILT_SOURCES)
 
 gnome_terminal_CPPFLAGS = \
@@ -86,7 +75,6 @@ gnome_terminal_CFLAGS = \
 gnome_terminal_LDFLAGS =
 
 gnome_terminal_LDADD = \
-	skey/libskey.la \
 	$(TERM_LIBS)
 
 if WITH_SMCLIENT
@@ -168,7 +156,6 @@ builder_in_files = \
 	profile-manager.glade \
 	profile-new-dialog.glade \
 	profile-preferences.glade \
-	skey-challenge.glade \
 	$(NULL)
 
 builderdir = $(pkgdatadir)
diff --git a/src/gnome-terminal.schemas.in b/src/gnome-terminal.schemas.in
index 587e8d0..763ec22 100644
--- a/src/gnome-terminal.schemas.in
+++ b/src/gnome-terminal.schemas.in
@@ -703,23 +703,6 @@
       </locale>
     </schema>
 
-    <schema>
-      <key>/schemas/apps/gnome-terminal/profiles/Default/use_skey</key>
-      <applyto>/apps/gnome-terminal/profiles/Default/use_skey</applyto>
-      <owner>gnome-terminal</owner>
-      <type>bool</type>
-      <default>true</default>
-      <locale name="C">
-         <short><!-- Translators: S/Key is the name of an application, so it should
-         not be translated. -->Highlight S/Key challenges</short>
-         <long><!-- Translators: S/Key is the name of an application, so it should
-         not be translated. -->Popup a dialog when an S/Key challenge response query is
-	 detected and clicked on.  Typing a password into the dialog
-         will send it to the terminal.
-         </long>
-      </locale>
-    </schema>
-
     <!-- Keybindings -->
 
     <schema>
diff --git a/src/terminal-profile.c b/src/terminal-profile.c
index 1a8b67a..58ed5dd 100644
--- a/src/terminal-profile.c
+++ b/src/terminal-profile.c
@@ -81,7 +81,6 @@ enum
   PROP_UPDATE_RECORDS,
   PROP_USE_CUSTOM_COMMAND,
   PROP_USE_CUSTOM_DEFAULT_SIZE,
-  PROP_USE_SKEY,
   PROP_USE_SYSTEM_FONT,
   PROP_USE_THEME_COLORS,
   PROP_VISIBLE_NAME,
@@ -121,7 +120,6 @@ enum
 #define KEY_UPDATE_RECORDS "update_records"
 #define KEY_USE_CUSTOM_COMMAND "use_custom_command"
 #define KEY_USE_CUSTOM_DEFAULT_SIZE "use_custom_default_size"
-#define KEY_USE_SKEY "use_skey"
 #define KEY_USE_SYSTEM_FONT "use_system_font"
 #define KEY_USE_THEME_COLORS "use_theme_colors"
 #define KEY_VISIBLE_NAME "visible_name"
@@ -161,7 +159,6 @@ enum
 #define DEFAULT_UPDATE_RECORDS        (TRUE)
 #define DEFAULT_USE_CUSTOM_COMMAND    (FALSE)
 #define DEFAULT_USE_CUSTOM_DEFAULT_SIZE (FALSE)
-#define DEFAULT_USE_SKEY              (TRUE)
 #define DEFAULT_USE_SYSTEM_FONT       (TRUE)
 #define DEFAULT_USE_THEME_COLORS      (TRUE)
 #define DEFAULT_VISIBLE_NAME          (N_("Unnamed"))
@@ -1306,7 +1303,6 @@ terminal_profile_class_init (TerminalProfileClass *klass)
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (UPDATE_RECORDS, DEFAULT_UPDATE_RECORDS, KEY_UPDATE_RECORDS);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_CUSTOM_COMMAND, DEFAULT_USE_CUSTOM_COMMAND, KEY_USE_CUSTOM_COMMAND);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_CUSTOM_DEFAULT_SIZE, DEFAULT_USE_CUSTOM_DEFAULT_SIZE, KEY_USE_CUSTOM_DEFAULT_SIZE);
-  TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_SKEY, DEFAULT_USE_SKEY, KEY_USE_SKEY);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_SYSTEM_FONT, DEFAULT_USE_SYSTEM_FONT, KEY_USE_SYSTEM_FONT);
   TERMINAL_PROFILE_PROPERTY_BOOLEAN (USE_THEME_COLORS, DEFAULT_USE_THEME_COLORS, KEY_USE_THEME_COLORS);
 
diff --git a/src/terminal-profile.h b/src/terminal-profile.h
index a975ec0..d1474fb 100644
--- a/src/terminal-profile.h
+++ b/src/terminal-profile.h
@@ -99,7 +99,6 @@ typedef enum
 #define TERMINAL_PROFILE_UPDATE_RECORDS         "update-records"
 #define TERMINAL_PROFILE_USE_CUSTOM_COMMAND     "use-custom-command"
 #define TERMINAL_PROFILE_USE_CUSTOM_DEFAULT_SIZE "use-custom-default-size"
-#define TERMINAL_PROFILE_USE_SKEY               "use-skey"
 #define TERMINAL_PROFILE_USE_SYSTEM_FONT        "use-system-font"
 #define TERMINAL_PROFILE_USE_THEME_COLORS       "use-theme-colors"
 #define TERMINAL_PROFILE_VISIBLE_NAME           "visible-name"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 1481024..e5fb0be 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -50,7 +50,6 @@
 #include "eggshell.h"
 
 #define URL_MATCH_CURSOR  (GDK_HAND2)
-#define SKEY_MATCH_CURSOR (GDK_HAND2)
 
 typedef struct
 {
@@ -175,18 +174,6 @@ static GRegex **url_regexes;
 static TerminalURLFlavour *url_regex_flavors;
 static guint n_url_regexes;
 
-#ifdef ENABLE_SKEY
-static const TerminalRegexPattern skey_regex_patterns[] = {
-  { "s/key [[:digit:]]* [-[:alnum:]]*",         FLAVOR_AS_IS },
-  { "otp-[a-z0-9]* [[:digit:]]* [-[:alnum:]]*", FLAVOR_AS_IS },
-};
-
-static GRegex **skey_regexes;
-static guint n_skey_regexes;
-
-static void  terminal_screen_skey_match_remove (TerminalScreen            *screen);
-#endif /* ENABLE_SKEY */
-
 G_DEFINE_TYPE (TerminalScreen, terminal_screen, VTE_TYPE_TERMINAL)
 
 static char *
@@ -624,23 +611,6 @@ terminal_screen_class_init (TerminalScreenClass *klass)
       url_regex_flavors[i] = url_regex_patterns[i].flavor;
     }
 
-#ifdef ENABLE_SKEY
-  n_skey_regexes = G_N_ELEMENTS (skey_regex_patterns);
-  skey_regexes = g_new0 (GRegex*, n_skey_regexes);
-
-  for (i = 0; i < n_skey_regexes; ++i)
-    {
-      GError *error = NULL;
-
-      skey_regexes[i] = g_regex_new (skey_regex_patterns[i].pattern, G_REGEX_OPTIMIZE, 0, &error);
-      if (error)
-        {
-          g_message ("%s", error->message);
-          g_error_free (error);
-        }
-    }
-#endif /* ENABLE_SKEY */
-
   /* This fixes bug #329827 */
   app = terminal_app_get ();
   terminal_screen_class_enable_menu_bar_accel_notify_cb (app, NULL, klass);
@@ -979,32 +949,6 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
       vte_terminal_set_scrollback_lines (vte_terminal, lines);
     }
 
-#ifdef ENABLE_SKEY
-  if (!prop_name || prop_name == I_(TERMINAL_PROFILE_USE_SKEY))
-    {
-      if (terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_USE_SKEY))
-        {
-          guint i;
-
-          for (i = 0; i < n_skey_regexes; ++i)
-            {
-              TagData *tag_data;
-
-              tag_data = g_slice_new (TagData);
-              tag_data->flavor = FLAVOR_SKEY;
-              tag_data->tag = vte_terminal_match_add_gregex (vte_terminal, skey_regexes[i], 0);
-              vte_terminal_match_set_cursor_type (vte_terminal, tag_data->tag, SKEY_MATCH_CURSOR);
-
-              priv->match_tags = g_slist_prepend (priv->match_tags, tag_data);
-            }
-        }
-      else
-        {
-          terminal_screen_skey_match_remove (screen);
-        }
-    }
-#endif /* ENABLE_SKEY */
-
   if (!prop_name ||
       prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE) ||
       prop_name == I_(TERMINAL_PROFILE_BACKGROUND_IMAGE) ||
@@ -1612,29 +1556,23 @@ terminal_screen_button_press (GtkWidget      *widget,
 
   /* FIXMEchpe: add vte API to do this check by widget coords instead of grid coords */
   matched_string = terminal_screen_check_match (screen, row, col, &matched_flavor);
-  
+
   if (matched_string != NULL &&
       (event->button == 1 || event->button == 2) &&
       (state & GDK_CONTROL_MASK))
     {
       gboolean handled = FALSE;
 
-#ifdef ENABLE_SKEY
-      if (matched_flavor != FLAVOR_SKEY ||
-          terminal_profile_get_property_boolean (screen->priv->profile, TERMINAL_PROFILE_USE_SKEY))
-#endif
+      g_signal_emit (screen, signals[MATCH_CLICKED], 0,
+                     matched_string,
+                     matched_flavor,
+                     state,
+                     &handled);
+      if (handled)
         {
-          g_signal_emit (screen, signals[MATCH_CLICKED], 0,
-                         matched_string,
-                         matched_flavor,
-                         state,
-                         &handled);
-        }
-
-        g_free (matched_string);
-
-        if (handled)
+          g_free (matched_string);
           return TRUE; /* don't do anything else such as select with the click */
+        }
     }
 
   if (event->button == 3 &&
@@ -1655,6 +1593,8 @@ terminal_screen_button_press (GtkWidget      *widget,
       return TRUE;
     }
 
+  g_free (matched_string);
+
   /* default behavior is to let the terminal widget deal with it */
   if (button_press_event)
     return button_press_event (widget, event);
@@ -2211,30 +2151,6 @@ terminal_screen_get_cell_size (TerminalScreen *screen,
   *cell_height_pixels = vte_terminal_get_char_height (terminal);
 }
 
-#ifdef ENABLE_SKEY
-static void
-terminal_screen_skey_match_remove (TerminalScreen *screen)
-{
-  TerminalScreenPrivate *priv = screen->priv;
-  GSList *l, *next;
-
-  l = priv->match_tags;
-  while (l != NULL)
-    {
-      TagData *tag_data = (TagData *) l->data;
-
-      next = l->next;
-      if (tag_data->flavor == FLAVOR_SKEY)
-        {
-          vte_terminal_match_remove (VTE_TERMINAL (screen), tag_data->tag);
-          priv->match_tags = g_slist_delete_link (priv->match_tags, l);
-        }
-
-      l = next;
-    }
-}
-#endif /* ENABLE_SKEY */
-
 static char*
 terminal_screen_check_match (TerminalScreen *screen,
 			     int        column,
diff --git a/src/terminal-screen.h b/src/terminal-screen.h
index 885e7d2..25cc902 100644
--- a/src/terminal-screen.h
+++ b/src/terminal-screen.h
@@ -31,8 +31,7 @@ typedef enum {
   FLAVOR_AS_IS,
   FLAVOR_DEFAULT_TO_HTTP,
   FLAVOR_VOIP_CALL,
-  FLAVOR_EMAIL,
-  FLAVOR_SKEY
+  FLAVOR_EMAIL
 } TerminalURLFlavour;
 
 /* Forward decls */
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 8870e27..4055537 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -246,8 +246,6 @@ terminal_util_open_url (GtkWidget *parent,
     case FLAVOR_AS_IS:
       uri = g_strdup (orig_url);
       break;
-    case FLAVOR_SKEY:
-      /* shouldn't get this */
     default:
       uri = NULL;
       g_assert_not_reached ();
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 4434b21..e33628a 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -45,10 +45,6 @@
 #include "terminal-util.h"
 #include "terminal-window.h"
 
-#ifdef ENABLE_SKEY
-#include "skey-popup.h"
-#endif
-
 struct _TerminalWindowPrivate
 {
   GtkActionGroup *action_group;
@@ -1427,19 +1423,9 @@ screen_match_clicked_cb (TerminalScreen *screen,
   if (screen != priv->active_screen)
     return FALSE;
 
-  switch (flavour)
-    {
-#ifdef ENABLE_SKEY
-      case FLAVOR_SKEY:
-        terminal_skey_do_popup (GTK_WINDOW (window), screen, match);
-        break;
-#endif
-      default:
-        gtk_widget_grab_focus (GTK_WIDGET (screen));
-        terminal_util_open_url (GTK_WIDGET (window), match, flavour,
-                                gtk_get_current_event_time ());
-        break;
-    }
+  gtk_widget_grab_focus (GTK_WIDGET (screen));
+  terminal_util_open_url (GTK_WIDGET (window), match, flavour,
+                          gtk_get_current_event_time ());
 
   return TRUE;
 }



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