qulogic/pidgin

Parents b31d8cb21d31
Children 8737840a09b7
Deprecate purple_util_write_data_to_file_absolute and use g_file_set_contents in place of it

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/279/
--- a/ChangeLog.API Thu Dec 17 23:30:40 2020 -0600
+++ b/ChangeLog.API Thu Dec 17 23:31:11 2020 -0600
@@ -526,6 +526,8 @@
* purple_txt_resolve_account
* PurpleType, use GType instead.
* purple_utf8_salvage. Use g_utf8_make_valid instead.
+ * purple_util_write_data_to_file_absolute. Use g_file_set_contents
+ instead.
* purple_util_fetch_url_len. Use purple_util_fetch_url, instead.
* purple_util_fetch_url_request_len. Use
* purple_util_fetch_url_request, instead.
--- a/libpurple/image.c Thu Dec 17 23:30:40 2020 -0600
+++ b/libpurple/image.c Thu Dec 17 23:31:11 2020 -0600
@@ -253,7 +253,7 @@
g_return_val_if_fail(data != NULL, FALSE);
g_return_val_if_fail(len > 0, FALSE);
- succ = purple_util_write_data_to_file_absolute(path, data, len);
+ succ = g_file_set_contents(path, data, len, NULL);
if (succ && priv->path == NULL)
priv->path = g_strdup(path);
--- a/libpurple/protocols/gg/gg.c Thu Dec 17 23:30:40 2020 -0600
+++ b/libpurple/protocols/gg/gg.c Thu Dec 17 23:31:11 2020 -0600
@@ -121,7 +121,7 @@
return;
}
- if (purple_util_write_data_to_file_absolute(filename, buddylist, -1)) {
+ if (g_file_set_contents(filename, buddylist, -1, NULL)) {
purple_notify_info(account, _("Save Buddylist..."),
_("Buddylist saved successfully!"), NULL,
purple_request_cpar_from_connection(gc));
--- a/libpurple/util.h Thu Dec 17 23:30:40 2020 -0600
+++ b/libpurple/util.h Thu Dec 17 23:31:11 2020 -0600
@@ -371,12 +371,13 @@
*
* This exists for Glib backwards compatibility reasons.
*
- * See purple_util_write_data_to_file()
+ * 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.
*/
-/* TODO: Remove this function (use g_file_set_contents instead) when 3.0.0
- * rolls around. */
+G_DEPRECATED_FOR(g_file_set_contents)
gboolean
purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size);
--- a/libpurple/xmlnode.c Thu Dec 17 23:30:40 2020 -0600
+++ b/libpurple/xmlnode.c Thu Dec 17 23:31:11 2020 -0600
@@ -852,7 +852,7 @@
purple_debug_error("util", "Error parsing file %s. Renaming old "
"file to %s\n", filename_full, filename_temp);
- purple_util_write_data_to_file_absolute(filename_temp_full, contents, length);
+ g_file_set_contents(filename_temp_full, contents, length, NULL);
g_free(filename_temp_full);
g_free(filename_temp);
--- a/pidgin/gtkconv.c Thu Dec 17 23:30:40 2020 -0600
+++ b/pidgin/gtkconv.c Thu Dec 17 23:31:11 2020 -0600
@@ -2052,7 +2052,7 @@
icon = purple_im_conversation_get_icon(im);
data = purple_buddy_icon_get_data(icon, &len);
- if ((len <= 0) || (data == NULL) || !purple_util_write_data_to_file_absolute(filename, data, len)) {
+ if ((len <= 0) || (data == NULL) || !g_file_set_contents(filename, data, len, NULL)) {
purple_notify_error(gtkconv, NULL, _("Unable to save icon file to disk."), NULL, NULL);
}
}