anjuta r3644 - in trunk: . global-tags libanjuta
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r3644 - in trunk: . global-tags libanjuta
- Date: Tue, 12 Feb 2008 13:57:43 +0000 (GMT)
Author: jhs
Date: Tue Feb 12 13:57:40 2008
New Revision: 3644
URL: http://svn.gnome.org/viewvc/anjuta?rev=3644&view=rev
Log:
2008-02-12 Johannes Schmid <jhs gnome org>
Patch from Gennaro Bellizio <genbell tiscali it>:
* global-tags/Makefile.am:
* AUTHORS
#515954 â create_global_tags.sh: wrong anjuta-tags path
* libanjuta/anjuta-launcher.c: (anjuta_launcher_initialize),
(anjuta_launcher_dispose), (anjuta_launcher_check_password_real),
(anjuta_launcher_scan_output), (anjuta_launcher_scan_error),
(anjuta_launcher_scan_pty), (anjuta_launcher_set_encoding),
(anjuta_launcher_fork):
* libanjuta/anjuta-launcher.h:
Fix anjuta_launcher_set_encoding() and cleaned-up. Mostly backported
from symbol-db branch
Modified:
trunk/AUTHORS
trunk/ChangeLog
trunk/global-tags/Makefile.am
trunk/libanjuta/anjuta-launcher.c
trunk/libanjuta/anjuta-launcher.h
Modified: trunk/AUTHORS
==============================================================================
--- trunk/AUTHORS (original)
+++ trunk/AUTHORS Tue Feb 12 13:57:40 2008
@@ -59,6 +59,7 @@
Franco Catrin L. <fcatrin tuxpan cl>
Fredrik Axelsson <fraxbe gmail com>
Frederic RUAUDEL <grumz users sourceforge net>
+ Gennaro Bellizio <genbell tiscali it>
Giovanni Corriga <valkadesh libero it> (Italy)
Gregory Schmitt <gregory schmitt free fr> (France)
GÃnther Brammer <gbrammer gmx de>
Modified: trunk/global-tags/Makefile.am
==============================================================================
--- trunk/global-tags/Makefile.am (original)
+++ trunk/global-tags/Makefile.am Tue Feb 12 13:57:40 2008
@@ -19,7 +19,7 @@
anjuta_tags_LDFLAGS = $(GLIB_LIBS)
edit = sed \
- -e 's,\ bindir\@,$(bindir),g'
+ -e 's,\ bindir\@,$(scriptdir),g'
create_global_tags.sh: Makefile create_global_tags.sh.in
rm -f create_global_tags.sh
Modified: trunk/libanjuta/anjuta-launcher.c
==============================================================================
--- trunk/libanjuta/anjuta-launcher.c (original)
+++ trunk/libanjuta/anjuta-launcher.c Tue Feb 12 13:57:40 2008
@@ -110,9 +110,6 @@
/* Terminal echo */
gboolean terminal_echo_on;
- /* Check for passwords in input */
- gboolean disable_password_check;
-
/* The child */
pid_t child_pid;
guint source;
@@ -140,6 +137,10 @@
/* Callback data */
gpointer callback_data;
+
+ /* Encondig */
+ gboolean custom_encoding;
+ gchar* encoding;
};
enum
@@ -185,7 +186,6 @@
obj->priv->pty_output_buffer = NULL;
obj->priv->terminal_echo_on = TRUE;
- obj->priv->disable_password_check = FALSE;
/* The child */
obj->priv->child_pid = 0;
@@ -208,6 +208,10 @@
/* Output callback */
obj->priv->output_callback = NULL;
obj->priv->callback_data = NULL;
+
+ /* Encoding */
+ obj->priv->custom_encoding = FALSE;
+ obj->priv->encoding = NULL;
}
GType
@@ -252,6 +256,9 @@
*/
kill (child_pid_save, SIGTERM);
launcher->priv->busy = FALSE;
+
+ if (launcher->priv->custom_encoding && launcher->priv->encoding)
+ g_free (launcher->priv->encoding);
}
GNOME_CALL_PARENT (G_OBJECT_CLASS, dispose, (obj));
}
@@ -578,9 +585,6 @@
if (anjuta_launcher_is_busy (launcher) == FALSE)
return;
- if (launcher->priv->disable_password_check)
- return;
-
if (last_line) {
/* DEBUG_PRINT ("(In password) Last line = %s", last_line); */
@@ -746,7 +750,7 @@
do
{
g_io_channel_read_chars (channel, buffer, FILE_BUFFER_SIZE-1, &n, &err);
- if (n > 0 && !err) /* There is output */
+ if (n > 0) /* There is output */
{
gchar *utf8_chars;
buffer[n] = '\0';
@@ -757,9 +761,9 @@
g_free (utf8_chars);
}
/* Ignore illegal characters */
- else if (err && err->domain == G_CONVERT_ERROR)
+ if (err && err->domain == G_CONVERT_ERROR)
{
- DEBUG_PRINT ("stdout: %s", err->message);
+ g_warning ("stdout: %s", err->message);
g_error_free (err);
err = NULL;
}
@@ -767,7 +771,7 @@
/* if not related to non blocking read or interrupted syscall */
else if (err && errno != EAGAIN && errno != EINTR)
{
- DEBUG_PRINT ("stdout: %s", err->message);
+ g_warning ("stdout: %s", err->message);
launcher->priv->stdout_is_done = TRUE;
anjuta_launcher_synchronize (launcher);
ret = FALSE;
@@ -802,7 +806,7 @@
do
{
g_io_channel_read_chars (channel, buffer, FILE_BUFFER_SIZE-1, &n, &err);
- if (n > 0 && !err) /* There is stderr output */
+ if (n > 0) /* There is stderr output */
{
gchar *utf8_chars;
buffer[n] = '\0';
@@ -813,9 +817,9 @@
g_free (utf8_chars);
}
/* Ignore illegal characters */
- else if (err && err->domain == G_CONVERT_ERROR)
+ if (err && err->domain == G_CONVERT_ERROR)
{
- DEBUG_PRINT ("stderr: %s", err->message);
+ g_warning ("stderr: %s", err->message);
g_error_free (err);
err = NULL;
}
@@ -823,7 +827,7 @@
/* if not related to non blocking read or interrupted syscall */
else if (err && errno != EAGAIN && errno != EINTR)
{
- DEBUG_PRINT ("stderr: %s", err->message);
+ g_warning ("stderr: %s", err->message);
launcher->priv->stderr_is_done = TRUE;
anjuta_launcher_synchronize (launcher);
@@ -859,7 +863,7 @@
do
{
g_io_channel_read_chars (channel, buffer, FILE_BUFFER_SIZE-1, &n, &err);
- if (n > 0 && !err) /* There is stderr output */
+ if (n > 0) /* There is stderr output */
{
gchar *utf8_chars;
gchar *old_str = launcher->priv->pty_output_buffer;
@@ -876,9 +880,9 @@
g_free (utf8_chars);
}
/* Ignore illegal characters */
- else if (err && err->domain == G_CONVERT_ERROR)
+ if (err && err->domain == G_CONVERT_ERROR)
{
- DEBUG_PRINT ("pty: %s", err->message);
+ g_warning ("pty: %s", err->message);
g_error_free (err);
err = NULL;
}
@@ -886,7 +890,7 @@
/* if not related to non blocking read or interrupted syscall */
else if (err && errno != EAGAIN && errno != EINTR)
{
- DEBUG_PRINT ("pty: %s", err->message);
+ g_warning ("pty: %s", err->message);
ret = FALSE;
}
/* Read next chars if buffer was too small
@@ -1051,6 +1055,12 @@
g_return_val_if_fail (launcher != NULL, FALSE);
// charset can be NULL
+ launcher->priv->custom_encoding = TRUE;
+ if (charset)
+ launcher->priv->encoding = g_strdup(charset);
+ else
+ launcher->priv->encoding = NULL;
+
s = g_io_channel_set_encoding (launcher->priv->stderr_channel, charset, NULL);
if (s != G_IO_STATUS_NORMAL) r = FALSE;
s = g_io_channel_set_encoding (launcher->priv->stdout_channel, charset, NULL);
@@ -1073,7 +1083,6 @@
int stdout_pipe[2], stderr_pipe[2];
pid_t child_pid;
struct termios termios_flags;
- const gchar *charset;
working_dir = g_get_current_dir ();
@@ -1143,11 +1152,11 @@
launcher->priv->pty_channel = g_io_channel_unix_new (pty_master_fd);
g_io_channel_set_buffer_size (launcher->priv->pty_channel, FILE_INPUT_BUFFER_SIZE);
-
-
- g_get_charset (&charset);
- anjuta_launcher_set_encoding (launcher, charset);
+ if (!launcher->priv->custom_encoding)
+ g_get_charset ((const gchar**)&launcher->priv->encoding);
+ anjuta_launcher_set_encoding (launcher, launcher->priv->encoding);
+
tcgetattr(pty_master_fd, &termios_flags);
termios_flags.c_iflag &= ~(IGNPAR | INPCK | INLCR | IGNCR | ICRNL | IXON |
IXOFF | ISTRIP);
@@ -1350,22 +1359,6 @@
}
/**
- * anjuta_launcher_disable_password_check:
- * @launcher: IAnjutaLauncher object
- * @disable: TRUE disables password check
- *
- * Do not check for password prompts in input
- *
- * Return value: a new instance of #AnjutaLancher class.
- */
-
-void anjuta_launcher_disable_password_check (AnjutaLauncher* launcher,
- gboolean disable)
-{
- launcher->priv->disable_password_check = disable;
-}
-
-/**
* anjuta_launcher_new:
*
* Sets if input (those given in STDIN) should enabled or disabled. By default,
Modified: trunk/libanjuta/anjuta-launcher.h
==============================================================================
--- trunk/libanjuta/anjuta-launcher.h (original)
+++ trunk/libanjuta/anjuta-launcher.h Tue Feb 12 13:57:40 2008
@@ -108,9 +108,6 @@
gboolean anjuta_launcher_set_terminate_on_exit (AnjutaLauncher *launcher,
gboolean terminate_on_exit);
-void anjuta_launcher_disable_password_check (AnjutaLauncher* launcher,
- gboolean disable);
-
G_END_DECLS
#endif /* __ANJUTA_LAUNCHER_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]