Commit aada2ea6 authored by Paolo Borelli's avatar Paolo Borelli Committed by Paolo Borelli

Simply use g_strdelimit instead of a cutsom function to escape slashes.

2007-10-28  Paolo Borelli  <pborelli@katamail.com>

	* gedit/gedit-utils.[ch]:
	* gedit/gedit-window.c:

	Simply use g_strdelimit instead of a cutsom function to escape slashes.


svn path=/trunk/; revision=5987
parent 9722ffa2
2007-10-28 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-utils.[ch]:
* gedit/gedit-window.c:
Simply use g_strdelimit instead of a cutsom function to escape slashes.
=== gedit 2.20.3 ===
......
......@@ -115,16 +115,6 @@ gedit-utils
@Returns:
<!-- ##### FUNCTION gedit_utils_escape_slashes ##### -->
<para>
</para>
@text:
@length:
@Returns:
<!-- ##### FUNCTION gedit_utils_str_middle_truncate ##### -->
<para>
......
......@@ -619,43 +619,6 @@ gedit_utils_escape_underscores (const gchar* text,
return g_string_free (str, FALSE);
}
/*
* Replaces '/' with '-' to avoid problems in xml paths.
*/
gchar *
gedit_utils_escape_slashes (const gchar *text,
gssize length)
{
GString *str;
const gchar *p;
const gchar *end;
g_return_val_if_fail (text != NULL, NULL);
if (length < 0)
length = strlen (text);
str = g_string_sized_new (length);
p = text;
end = text + length;
while (p != end)
{
const gchar *next;
next = g_utf8_next_char (p);
if (*p == '/')
g_string_append (str, "-");
else
g_string_append_len (str, p, next - p);
p = next;
}
return g_string_free (str, FALSE);
}
/* the following functions are taken from eel */
gchar *
......
......@@ -81,9 +81,6 @@ GtkWidget *gedit_dialog_add_button (GtkDialog *dialog,
gchar *gedit_utils_escape_underscores (const gchar *text,
gssize length);
gchar *gedit_utils_escape_slashes (const gchar *text,
gssize length);
gchar *gedit_utils_str_middle_truncate (const gchar *string,
guint truncate_length);
......
......@@ -806,17 +806,12 @@ language_toggled (GtkToggleAction *action,
static gchar *
escape_section_name (const gchar *name)
{
gchar *tmp;
gchar *ret;
gssize len;
len = strlen (name);
ret = g_markup_escape_text (name, -1);
/* escape slashes doesn't change the string lenght */
tmp = gedit_utils_escape_slashes (name, len);
ret = g_markup_escape_text (tmp, len);
g_free (tmp);
/* Replace '/' with '-' to avoid problems in xml paths */
g_strdelimit (ret, "/", '-');
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment