[gedit] Revert "No longer use gedit_utils_str_middle_truncate()"



commit 88a1e6da550ea4e1bc9710453a8d055bd423ed39
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Nov 6 13:02:54 2019 -0600

    Revert "No longer use gedit_utils_str_middle_truncate()"
    
    This reverts commit db9bc7cf298e85d73e2c322bd2cd0986d4f0ac95.

 gedit/gedit-commands-file.c     |  5 ++---
 gedit/gedit-documents-panel.c   |  3 +--
 gedit/gedit-io-error-info-bar.c | 41 ++++++++++++++++++++---------------------
 gedit/gedit-print-job.c         |  4 ++--
 gedit/gedit-tab.c               | 13 ++++++-------
 gedit/gedit-window.c            |  9 ++++-----
 6 files changed, 35 insertions(+), 40 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 7d1cb1849..65e32d705 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -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)
diff --git a/gedit/gedit-documents-panel.c b/gedit/gedit-documents-panel.c
index b1fd22a3a..ddd1436b7 100644
--- a/gedit/gedit-documents-panel.c
+++ b/gedit/gedit-documents-panel.c
@@ -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);
 
diff --git a/gedit/gedit-io-error-info-bar.c b/gedit/gedit-io-error-info-bar.c
index 729d36397..d8d024f90 100644
--- a/gedit/gedit-io-error-info-bar.c
+++ b/gedit/gedit-io-error-info-bar.c
@@ -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);
diff --git a/gedit/gedit-print-job.c b/gedit/gedit-print-job.c
index 6b0752584..6d4afb2e0 100644
--- a/gedit/gedit-print-job.c
+++ b/gedit/gedit-print-job.c
@@ -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);
 
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 3c0065a6b..02d243714 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -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)))
        {
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 62d5b34a7..8f25e9526 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -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);
                }
        }


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