Re: [PATCH] More cleanups



Hi Peter:

attached is a patch removing more completely unused stuff...

Cheers,
Albrecht.


Am 16.04.17 15:38 schrieb(en) Peter Bloomfield:
Hi Albrecht:

On 04/15/2017 09:48:49 AM Sat, Albrecht Dreß wrote:
Hi all,

inspired by Peter's recent clean-ups in libbalsa/misc.[hc], here are more of them:

- src/sendmsg-window.c: replace libbalsa_readfile() by g_file_get_contents(), including better error 
reporting; remove unused #define
- libbalsa/identity.c: replace libbalsa_readfile_nostat() by g_file_get_contents() for reading a signature 
file, including better error checking
- libbalsa/misc.[hc]: libbalsa_get_hostname() and libbalsa_readfile() are never used, remove them

Opinions?

It all looks good--pushed to master.

Happy Easter to everybody,

…and to you!

Peter
_______________________________________________
balsa-list mailing list
balsa-list gnome org
https://mail.gnome.org/mailman/listinfo/balsa-list
diff --git a/libbalsa/misc.c b/libbalsa/misc.c
index 33133a4..7b04fff 100644
--- a/libbalsa/misc.c
+++ b/libbalsa/misc.c
@@ -228,39 +228,6 @@ libbalsa_delete_directory_contents(const gchar *path)
     return TRUE;
 }
 
-/* libbalsa_truncate_string
- *
- * Arguments:
- *   str    the string to be truncated;
- *   length truncation length;
- *   dots   the number of trailing dots to be used to indicate
- *          truncation.
- *
- * Value:
- *   pointer to a newly allocated string; free with `g_free' when it's
- *   no longer needed.
- */
-gchar *
-libbalsa_truncate_string(const gchar *str, gint length, gint dots)
-{
-    gchar *res;
-    gchar *p;
-
-    if (str == NULL)
-        return NULL;
-
-    if (length <= 0 || strlen(str) <= (guint) length)
-        return g_strdup(str);
-
-    res = g_strndup(str, length);
-
-    p = res + length - dots;
-    while (--dots >= 0)
-        *p++ = '.';
-
-    return res;
-}
-
 /* libbalsa_expand_path:
    We handle only references to ~/.
 */
diff --git a/libbalsa/misc.h b/libbalsa/misc.h
index ec63140..677394c 100644
--- a/libbalsa/misc.h
+++ b/libbalsa/misc.h
@@ -108,13 +108,8 @@ void libbalsa_wrap_view(GtkTextView * view, gint length);
 void libbalsa_unwrap_buffer(GtkTextBuffer * buffer, GtkTextIter * iter,
                             gint lines);
 
-const char* libbalsa_set_charset(const gchar * charset);
-const char* libbalsa_set_send_charset(const gchar * charset);
-
 gboolean libbalsa_delete_directory_contents(const gchar *path);
-gchar *libbalsa_truncate_string(const gchar * str, gint length, gint dots);
 gchar *libbalsa_expand_path(const gchar *path);
-void libbalsa_contract_path(gchar *path);
 gboolean libbalsa_mktempdir(gchar ** name);
 LibBalsaCodeset libbalsa_set_fallback_codeset(LibBalsaCodeset codeset);
 gboolean libbalsa_utf8_sanitize(gchar ** text, gboolean fallback,

Attachment: pgp2rjDRsYEjv.pgp
Description: PGP signature



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