[mednaffe] 91/99: [Linux] Set channel encoding to NULL

Stephen Kitt skitt at moszumanska.debian.org
Tue Aug 2 21:00:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

skitt pushed a commit to branch master
in repository mednaffe.

commit e191e005c2977f6ae3cf4d2b2f12710ade7f1f35
Author: AmatCoder <amatcoder at gmail.com>
Date:   Fri Jul 24 13:10:07 2015 +0200

    [Linux] Set channel encoding to NULL
---
 src/command.c        | 17 +++++++++++------
 src/log.c            |  2 ++
 src/mednaffe_glade.h |  9 +++++++++
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/command.c b/src/command.c
index ab8e9af..7a4da56 100644
--- a/src/command.c
+++ b/src/command.c
@@ -96,7 +96,7 @@ gchar **build_command(guidata *gui)
 gboolean out_watch( GIOChannel *channel, GIOCondition cond, guidata *gui)
 {
   gsize size;
-
+GError *err = NULL;
   if (cond == G_IO_HUP)
   {
     g_io_channel_unref(channel);
@@ -106,13 +106,15 @@ gboolean out_watch( GIOChannel *channel, GIOCondition cond, guidata *gui)
   g_free(gui->m_error);
   gui->m_error= NULL;
 
-  if (g_io_channel_read_line(channel, &gui->m_error, &size, NULL, NULL) != G_IO_STATUS_NORMAL)
+  if (g_io_channel_read_line(channel, &gui->m_error, &size, NULL, &err) != G_IO_STATUS_NORMAL)
     return TRUE;
 
   if (gui->m_error != NULL)
   {
+    if (g_utf8_validate (gui->m_error, -1, NULL))
       gtk_text_buffer_insert_at_cursor(gui->textout, gui->m_error, size);
   }
+
   return TRUE;
 }
 
@@ -246,7 +248,7 @@ void row_exec(GtkTreeView *treeview, GtkTreePath *patho,
   gui->command = build_command_win(gui);
   delete_log(EMU, gui);
 
-  print_log("Executing mednafen with command line: \n", FE|EMU, gui);
+  print_log("\nExecuting mednafen with command line: \n", FE|EMU, gui);
   print_log(gui->command, FE|EMU, gui);
   print_log("\n", FE|EMU, gui);
 
@@ -290,7 +292,7 @@ void row_exec(GtkTreeView *treeview, GtkTreePath *patho,
   gui->command = build_command(gui);
   
   delete_log(EMU, gui);
-  print_log("Executing mednafen with command line: \n\"", FE|EMU, gui);
+  print_log("\nExecuting mednafen with command line: \n\"", FE|EMU, gui);
 
     gint i=0;
     while (gui->command[i])
@@ -313,9 +315,12 @@ void row_exec(GtkTreeView *treeview, GtkTreePath *patho,
   }
 
   g_child_watch_add(pid, (GChildWatchFunc)child_watch, gui);
+
   out_ch = g_io_channel_unix_new(out);
-  g_io_channel_set_flags (out_ch, G_IO_FLAG_NONBLOCK, NULL);
-  //g_io_channel_set_close_on_unref(out_ch, TRUE);
+
+  g_io_channel_set_encoding(out_ch, NULL, NULL);
+  g_io_channel_set_flags (out_ch, G_IO_FLAG_NONBLOCK| G_IO_FLAG_APPEND, NULL);
+
   g_io_add_watch(out_ch, G_IO_IN|G_IO_HUP, (GIOFunc)out_watch, gui);
 
   gui->executing = TRUE;
diff --git a/src/log.c b/src/log.c
index 01b2a13..89b9e52 100644
--- a/src/log.c
+++ b/src/log.c
@@ -46,7 +46,9 @@ void print_log(const gchar *text, elog log, guidata *gui)
 {
   if (log & FE)
   {
+  #ifdef G_OS_UNIX
     printf("%s", text);
+  #endif
     gtk_text_buffer_insert_at_cursor(gui->textfe, text, -1);
   }
 
diff --git a/src/mednaffe_glade.h b/src/mednaffe_glade.h
index 3d729b6..28532fb 100644
--- a/src/mednaffe_glade.h
+++ b/src/mednaffe_glade.h
@@ -4369,6 +4369,9 @@ static const char *mednaffe_glade =
 "<child>\n"
 "<placeholder/>\n"
 "</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
 "</object>\n"
 "</child>\n"
 "</object>\n"
@@ -4614,6 +4617,9 @@ static const char *mednaffe_glade =
 "<child>\n"
 "<placeholder/>\n"
 "</child>\n"
+"<child>\n"
+"<placeholder/>\n"
+"</child>\n"
 "</object>\n"
 "</child>\n"
 "</object>\n"
@@ -5249,6 +5255,7 @@ static const char *mednaffe_glade =
 "<object class=\"GtkLabel\" id=\"label85\">\n"
 "<property name=\"visible\">True</property>\n"
 "<property name=\"can_focus\">False</property>\n"
+"<property name=\"xalign\">0</property>\n"
 "<property name=\"label\" translatable=\"yes\">Element 3 (green, value * U):</property>\n"
 "</object>\n"
 "<packing>\n"
@@ -5262,6 +5269,7 @@ static const char *mednaffe_glade =
 "<object class=\"GtkLabel\" id=\"label88\">\n"
 "<property name=\"visible\">True</property>\n"
 "<property name=\"can_focus\">False</property>\n"
+"<property name=\"xalign\">0</property>\n"
 "<property name=\"label\" translatable=\"yes\">Element 4 (blue, value * V):</property>\n"
 "</object>\n"
 "<packing>\n"
@@ -5275,6 +5283,7 @@ static const char *mednaffe_glade =
 "<object class=\"GtkLabel\" id=\"label89\">\n"
 "<property name=\"visible\">True</property>\n"
 "<property name=\"can_focus\">False</property>\n"
+"<property name=\"xalign\">0</property>\n"
 "<property name=\"label\" translatable=\"yes\">Element 5 (blue, value * U):</property>\n"
 "</object>\n"
 "<packing>\n"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mednaffe.git



More information about the Pkg-games-commits mailing list