Commit 88a1e6da authored by Michael Catanzaro's avatar Michael Catanzaro

Revert "No longer use gedit_utils_str_middle_truncate()"

This reverts commit db9bc7cf.
parent 79077579
......@@ -31,7 +31,6 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <tepl/tepl.h>
#include "gedit-debug.h"
#include "gedit-document.h"
......@@ -549,7 +548,7 @@ replace_read_only_file (GtkWindow *parent,
* though the dialog uses wrapped text, if the name doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
name_for_display = tepl_utils_str_middle_truncate (parse_name, 50);
name_for_display = gedit_utils_str_middle_truncate (parse_name, 50);
g_free (parse_name);
dialog = gtk_message_dialog_new (parent,
......@@ -601,7 +600,7 @@ change_compression (GtkWindow *parent,
* though the dialog uses wrapped text, if the name doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
name_for_display = tepl_utils_str_middle_truncate (parse_name, 50);
name_for_display = gedit_utils_str_middle_truncate (parse_name, 50);
g_free (parse_name);
if (compressed)
......
......@@ -25,7 +25,6 @@
#include "gedit-documents-panel.h"
#include <glib/gi18n.h>
#include <tepl/tepl.h>
#include "gedit-debug.h"
#include "gedit-document.h"
......@@ -449,7 +448,7 @@ doc_get_name (GeditDocument *doc)
name = gedit_document_get_short_name_for_display (doc);
/* Truncate the name so it doesn't get insanely wide. */
docname = tepl_utils_str_middle_truncate (name, MAX_DOC_NAME_LENGTH);
docname = gedit_utils_str_middle_truncate (name, MAX_DOC_NAME_LENGTH);
g_free (name);
......
......@@ -28,7 +28,6 @@
#include <string.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <tepl/tepl.h>
#include "gedit-encodings-combo-box.h"
#include "gedit-settings.h"
......@@ -331,8 +330,8 @@ gedit_unrecoverable_reverting_error_info_bar_new (GFile *location,
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -423,8 +422,8 @@ gedit_network_unavailable_info_bar_new (GFile *location)
full_formatted_uri = g_file_get_parse_name (location);
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_printf_escaped ("<i>%s</i>", temp_uri_for_display);
g_free (temp_uri_for_display);
......@@ -576,8 +575,8 @@ gedit_io_loading_error_info_bar_new (GFile *location,
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -682,8 +681,8 @@ gedit_conversion_error_while_saving_info_bar_new (GFile *locat
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -751,8 +750,8 @@ gedit_file_already_open_warning_info_bar_new (GFile *location)
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -837,8 +836,8 @@ gedit_externally_modified_saving_error_info_bar_new (GFile *location,
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -927,8 +926,8 @@ gedit_no_backup_saving_error_info_bar_new (GFile *location,
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -1025,8 +1024,8 @@ gedit_unrecoverable_saving_error_info_bar_new (GFile *location,
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -1148,8 +1147,8 @@ gedit_externally_modified_info_bar_new (GFile *location,
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......@@ -1217,8 +1216,8 @@ gedit_invalid_character_info_bar_new (GFile *location)
* though the dialog uses wrapped text, if the URI doesn't contain
* white space then the text-wrapping code is too stupid to wrap it.
*/
temp_uri_for_display = tepl_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
temp_uri_for_display = gedit_utils_str_middle_truncate (full_formatted_uri,
MAX_URI_IN_DIALOG_LENGTH);
g_free (full_formatted_uri);
uri_for_display = g_markup_escape_text (temp_uri_for_display, -1);
......
......@@ -23,7 +23,7 @@
#include "gedit-print-job.h"
#include <glib/gi18n.h>
#include <tepl/tepl.h>
#include <gtksourceview/gtksource.h>
#include "gedit-debug.h"
#include "gedit-print-preview.h"
......@@ -534,7 +534,7 @@ create_compositor (GeditPrintJob *job)
gchar *left;
doc_name = gedit_document_get_uri_for_display (GEDIT_DOCUMENT (buf));
name_to_display = tepl_utils_str_middle_truncate (doc_name, 60);
name_to_display = gedit_utils_str_middle_truncate (doc_name, 60);
left = g_strdup_printf (_("File: %s"), name_to_display);
......
......@@ -24,7 +24,6 @@
#include <stdlib.h>
#include <glib/gi18n.h>
#include <tepl/tepl.h>
#include "gedit-app.h"
#include "gedit-app-private.h"
......@@ -786,7 +785,7 @@ show_loading_info_bar (GTask *loading_task)
{
gchar *str;
str = tepl_utils_str_middle_truncate (name, MAX_MSG_LENGTH);
str = gedit_utils_str_middle_truncate (name, MAX_MSG_LENGTH);
g_free (name);
name = str;
}
......@@ -805,8 +804,8 @@ show_loading_info_bar (GTask *loading_task)
* we have a title long 99 + 20, but I think it's a rare enough
* case to be acceptable. It's justa darn title afterall :)
*/
dirname = tepl_utils_str_middle_truncate (str,
MAX (20, MAX_MSG_LENGTH - len));
dirname = gedit_utils_str_middle_truncate (str,
MAX (20, MAX_MSG_LENGTH - len));
g_free (str);
}
}
......@@ -900,7 +899,7 @@ show_saving_info_bar (GTask *saving_task)
*/
if (len > MAX_MSG_LENGTH)
{
from = tepl_utils_str_middle_truncate (short_name, MAX_MSG_LENGTH);
from = gedit_utils_str_middle_truncate (short_name, MAX_MSG_LENGTH);
g_free (short_name);
}
else
......@@ -914,7 +913,7 @@ show_saving_info_bar (GTask *saving_task)
from = short_name;
to = g_file_get_parse_name (location);
str = tepl_utils_str_middle_truncate (to, MAX (20, MAX_MSG_LENGTH - len));
str = gedit_utils_str_middle_truncate (to, MAX (20, MAX_MSG_LENGTH - len));
g_free (to);
to = str;
......@@ -1487,7 +1486,7 @@ _gedit_tab_get_name (GeditTab *tab)
name = gedit_document_get_short_name_for_display (doc);
/* Truncate the name so it doesn't get insanely wide. */
docname = tepl_utils_str_middle_truncate (name, MAX_DOC_NAME_LENGTH);
docname = gedit_utils_str_middle_truncate (name, MAX_DOC_NAME_LENGTH);
if (gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc)))
{
......
......@@ -30,7 +30,6 @@
#include <glib/gi18n.h>
#include <libpeas/peas-extension-set.h>
#include <tepl/tepl.h>
#include "gedit-window-private.h"
#include "gedit-app.h"
......@@ -1121,8 +1120,8 @@ set_title (GeditWindow *window)
{
gchar *tmp;
tmp = tepl_utils_str_middle_truncate (name,
MAX_TITLE_LENGTH);
tmp = gedit_utils_str_middle_truncate (name,
MAX_TITLE_LENGTH);
g_free (name);
name = tmp;
}
......@@ -1140,8 +1139,8 @@ set_title (GeditWindow *window)
* we have a title long 99 + 20, but I think it's a rare enough
* case to be acceptable. It's justa darn title afterall :)
*/
dirname = tepl_utils_str_middle_truncate (str,
MAX (20, MAX_TITLE_LENGTH - len));
dirname = gedit_utils_str_middle_truncate (str,
MAX (20, MAX_TITLE_LENGTH - len));
g_free (str);
}
}
......
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