Remove the deprecated functions from util.[ch]

Mon, 12 Sep 2022 21:21:28 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 12 Sep 2022 21:21:28 -0500
changeset 41673
b26a160abce5
parent 41672
7d3c68e0a8ee
child 41674
c53f5d62e14f

Remove the deprecated functions from util.[ch]

Testing Done:
Compiled.

Reviewed at https://reviews.imfreedom.org/r/1756/

ChangeLog.API file | annotate | diff | comparison | revisions
libpurple/util.c file | annotate | diff | comparison | revisions
libpurple/util.h file | annotate | diff | comparison | revisions
--- a/ChangeLog.API	Mon Sep 12 21:10:57 2022 -0500
+++ b/ChangeLog.API	Mon Sep 12 21:21:28 2022 -0500
@@ -717,6 +717,9 @@
 		  purple_util_fetch_url_request, instead.
 		* purple_util_get_image_checksum.  Use
 		  g_compute_checksum_for_data(G_CHECKSUM_SHA1, ...), instead.
+		* purple_util_read_xml_from_file
+		* purple_util_write_data_to_file
+		* purple_util_write_data_to_file_absolute
 		* purple_uts35_to_str
 		* purple_xfer_add
 		* purple_xfer_get_ui_data and purple_xfer_set_ui_data. Use
@@ -770,8 +773,6 @@
 
 		Deprecated:
 		* purple_user_dir
-		* purple_util_write_data_to_file
-		* purple_util_read_xml_from_file
 
 	Pidgin:
 		Added:
--- a/libpurple/util.c	Mon Sep 12 21:10:57 2022 -0500
+++ b/libpurple/util.c	Mon Sep 12 21:21:28 2022 -0500
@@ -111,17 +111,6 @@
 }
 
 gboolean
-purple_util_write_data_to_file(const char *filename, const char *data, gssize size)
-{
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-	const char *user_dir = purple_user_dir();
-G_GNUC_END_IGNORE_DEPRECATIONS
-	gboolean ret = purple_util_write_data_to_file_common(user_dir, filename, data, size);
-
-	return ret;
-}
-
-gboolean
 purple_util_write_data_to_cache_file(const char *filename, const char *data, gssize size)
 {
 	const char *cache_dir = purple_cache_dir();
@@ -148,41 +137,6 @@
 	return ret;
 }
 
-gboolean
-purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size)
-{
-	GFile *file;
-	GError *err = NULL;
-
-	g_return_val_if_fail(size >= -1, FALSE);
-
-	if (size == -1) {
-		size = strlen(data);
-	}
-
-	file = g_file_new_for_path(filename_full);
-
-	if (!g_file_replace_contents(file, data, size, NULL, FALSE,
-			G_FILE_CREATE_PRIVATE, NULL, NULL, &err)) {
-		purple_debug_error("util", "Error writing file: %s: %s\n",
-				   filename_full, err->message);
-		g_clear_error(&err);
-		g_object_unref(file);
-		return FALSE;
-	}
-
-	g_object_unref(file);
-	return TRUE;
-}
-
-PurpleXmlNode *
-purple_util_read_xml_from_file(const char *filename, const char *description)
-{
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-	return purple_xmlnode_from_file(purple_user_dir(), filename, description, "util");
-G_GNUC_END_IGNORE_DEPRECATIONS
-}
-
 PurpleXmlNode *
 purple_util_read_xml_from_cache_file(const char *filename, const char *description)
 {
--- a/libpurple/util.h	Mon Sep 12 21:10:57 2022 -0500
+++ b/libpurple/util.h	Mon Sep 12 21:21:28 2022 -0500
@@ -111,29 +111,6 @@
 /**************************************************************************/
 /* Path/Filename Functions                                                */
 /**************************************************************************/
-/**
- * purple_util_write_data_to_file:
- * @filename: The basename of the file to write in the purple_user_dir.
- * @data:     A string of data to write.
- * @size:     The size of the data to save.  If data is
- *                 null-terminated you can pass in -1.
- *
- * Write a string of data to a file of the given name in the Purple
- * user directory ($HOME/.purple by default).  The data is typically
- * a serialized version of one of Purple's config files, such as
- * prefs.xml, accounts.xml, etc.  And the string is typically
- * obtained using purple_xmlnode_to_formatted_str.  However, this function
- * should work fine for saving binary files as well.
- *
- * Returns: TRUE if the file was written successfully.  FALSE otherwise.
- * 
- * Deprecated: Use purple_util_write_data_to_cache_file(),
- *             purple_util_write_data_to_config_file() or
- *             purple_util_write_data_to_data_file() instead.
- */
-G_DEPRECATED_FOR(purple_util_write_data_to_cache_file or purple_util_write_data_to_config_file or purple_util_write_data_to_data_file)
-gboolean purple_util_write_data_to_file(const char *filename, const char *data,
-									  gssize size);
 
 /**
  * purple_util_write_data_to_cache_file:
@@ -187,50 +164,6 @@
 purple_util_write_data_to_data_file(const char *filename, const char *data, gssize size);
 
 /**
- * purple_util_write_data_to_file_absolute:
- * @filename_full: Filename to write to
- * @data:          A string of data to write.
- * @size:          The size of the data to save.  If data is
- *                      null-terminated you can pass in -1.
- *
- * Write data to a file using the absolute path.
- *
- * This exists for Glib backwards compatibility reasons.
- *
- * See purple_util_write_data_to_file()
- *
- * Returns: TRUE if the file was written successfully.  FALSE otherwise.
- *
- * Deprecated: 3.0.0: Use g_file_set_contents() instead.
- */
-G_DEPRECATED_FOR(g_file_set_contents)
-gboolean
-purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size);
-
-/**
- * purple_util_read_xml_from_file:
- * @filename:    The basename of the file to open in the purple_user_dir.
- * @description: A very short description of the contents of this
- *                    file.  This is used in error messages shown to the
- *                    user when the file can not be opened.  For example,
- *                    "preferences," or "buddy pounces."
- *
- * Read the contents of a given file and parse the results into an
- * PurpleXmlNode tree structure.  This is intended to be used to read
- * Purple's configuration xml files (prefs.xml, pounces.xml, etc.)
- *
- * Returns: An PurpleXmlNode tree of the contents of the given file.  Or NULL, if
- *         the file does not exist or there was an error reading the file.
- * 
- * Deprecated: Use purple_util_read_xml_from_cache_file(),
- *             purple_util_read_xml_from_config_file() or
- *             purple_util_read_xml_from_data_file() instead.
- */
-G_DEPRECATED_FOR(purple_util_read_xml_from_cache_file or purple_util_read_xml_from_config_file or purple_util_read_xml_from_data_file)
-PurpleXmlNode *purple_util_read_xml_from_file(const char *filename,
-									  const char *description);
-
-/**
  * purple_util_read_xml_from_cache_file:
  * @filename:    The basename of the file to open in the purple_cache_dir.
  * @description: A very short description of the contents of this

mercurial