gnome-mud r744 - in trunk: . src



Author: lharris
Date: Wed Feb 18 03:37:15 2009
New Revision: 744
URL: http://svn.gnome.org/viewvc/gnome-mud?rev=744&view=rev

Log:
Consolidated encoding to a single place.


Modified:
   trunk/ChangeLog
   trunk/src/mud-connection-view.c
   trunk/src/mud-window.c

Modified: trunk/src/mud-connection-view.c
==============================================================================
--- trunk/src/mud-connection-view.c	(original)
+++ trunk/src/mud-connection-view.c	Wed Feb 18 03:37:15 2009
@@ -318,6 +318,11 @@
             local_codeset, 
             &bytes_read, &bytes_written, &error);
 
+    g_free(buf);
+
+    if(error)
+        g_message("%s", error->message);
+
     vte_terminal_set_encoding(VTE_TERMINAL(view->priv->terminal), encoding);
 
     g_free(encoding);

Modified: trunk/src/mud-window.c
==============================================================================
--- trunk/src/mud-window.c	(original)
+++ trunk/src/mud-window.c	Wed Feb 18 03:37:15 2009
@@ -273,14 +273,10 @@
 static gboolean
 mud_window_textview_keypress(GtkWidget *widget, GdkEventKey *event, MudWindow *window)
 {
-    gchar *text, *buf;
-    const gchar *local_codeset;
+    gchar *text;
     GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(window->priv->textview));
     GtkTextIter start, end;
     MudParseBase *base;
-    gsize bytes_read, bytes_written;
-    GError *error = NULL;
-    MudProfile *profile;
 
     if ((event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) &&
             (event->state & gtk_accelerator_get_default_mod_mask()) == 0)
@@ -294,19 +290,6 @@
             if (g_str_equal(text, ""))
                 text = g_strdup(" ");
 
-            buf = text;
-
-            g_get_charset(&local_codeset);
-            profile = mud_connection_view_get_current_profile(
-                    MUD_CONNECTION_VIEW(window->priv->current_view));
-
-            text = g_convert(text, -1,
-                    profile->preferences->Encoding,
-                    local_codeset, 
-                    &bytes_read, &bytes_written, &error);
-
-            g_free(buf);
-
             base = mud_connection_view_get_parsebase(MUD_CONNECTION_VIEW(window->priv->current_view));
 
             if(mud_parse_base_do_aliases(base, text))



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