Accepting request 427008 from GNOME:Next
New upstream release OBS-URL: https://build.opensuse.org/request/show/427008 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/evolution?expand=0&rev=311
This commit is contained in:
parent
4a0f295a53
commit
4cb1cbafb3
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:5388df01942e0ca0493a0f59335433277b83fb5ff314fcc9e0d6134b03306a2f
|
|
||||||
size 12255552
|
|
3
evolution-3.21.92.tar.xz
Normal file
3
evolution-3.21.92.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:1b66df5ff25acca499686cb1dc0c2b22ef70700581f420e6632ff64eadee709b
|
||||||
|
size 12234148
|
@ -1,649 +0,0 @@
|
|||||||
From b5681c51321045e0a509e5b656301e1032d8c4aa Mon Sep 17 00:00:00 2001
|
|
||||||
From: Razvan Chitu <razvan.ch95@gmail.com>
|
|
||||||
Date: Fri, 26 Aug 2016 14:55:12 +0300
|
|
||||||
Subject: Fix archives support in attachments
|
|
||||||
|
|
||||||
The API of gnome-autoar was recently modified so compression and extraction
|
|
||||||
were no longer working. Replace autoar preferences objects with two shell
|
|
||||||
settings. Save memory file to disk before extracting it. Handle generation of
|
|
||||||
unique file names internally.
|
|
||||||
|
|
||||||
https://bugzilla.gnome.org/show_bug.cgi?id=770380
|
|
||||||
---
|
|
||||||
configure.ac | 4 +-
|
|
||||||
data/org.gnome.evolution.shell.gschema.xml.in | 10 +
|
|
||||||
e-util/e-attachment-store.c | 78 +++----
|
|
||||||
e-util/e-attachment.c | 280 +++++++++++++++++++-------
|
|
||||||
4 files changed, 254 insertions(+), 118 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index a1ba2c0..a841591 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -368,8 +368,8 @@ AC_ARG_ENABLE([autoar],
|
|
||||||
if test x"$enable_autoar" = xyes; then
|
|
||||||
PKG_CHECK_MODULES(
|
|
||||||
[AUTOAR],
|
|
||||||
- [gnome-autoar >= gnome_autoar_minimum_version
|
|
||||||
- gnome-autoar-gtk >= gnome_autoar_minimum_version],,
|
|
||||||
+ [gnome-autoar-0 >= gnome_autoar_minimum_version
|
|
||||||
+ gnome-autoar-gtk-0 >= gnome_autoar_minimum_version],,
|
|
||||||
[AC_MSG_ERROR([
|
|
||||||
|
|
||||||
gnome-autoar or gnome-autoar-gtk not found
|
|
||||||
diff --git a/data/org.gnome.evolution.shell.gschema.xml.in b/data/org.gnome.evolution.shell.gschema.xml.in
|
|
||||||
index 18ece74..02a5a18 100644
|
|
||||||
--- a/data/org.gnome.evolution.shell.gschema.xml.in
|
|
||||||
+++ b/data/org.gnome.evolution.shell.gschema.xml.in
|
|
||||||
@@ -15,6 +15,16 @@
|
|
||||||
<_summary>Initial file chooser folder</_summary>
|
|
||||||
<_description>Initial folder for GtkFileChooser dialogs.</_description>
|
|
||||||
</key>
|
|
||||||
+ <key name="autoar-format" type="s">
|
|
||||||
+ <default>''</default>
|
|
||||||
+ <_summary>Compression format used by autoar</_summary>
|
|
||||||
+ <_description>Compression format used when compressing attached directories with autoar.</_description>
|
|
||||||
+ </key>
|
|
||||||
+ <key name="autoar-filter" type="s">
|
|
||||||
+ <default>''</default>
|
|
||||||
+ <_summary>Compression filter used by autoar</_summary>
|
|
||||||
+ <_description>Compression filter used when compressing attached directories with autoar.</_description>
|
|
||||||
+ </key>
|
|
||||||
<key name="start-offline" type="b">
|
|
||||||
<default>false</default>
|
|
||||||
<_summary>Start in offline mode</_summary>
|
|
||||||
diff --git a/e-util/e-attachment-store.c b/e-util/e-attachment-store.c
|
|
||||||
index 85fa19a..05e4809 100644
|
|
||||||
--- a/e-util/e-attachment-store.c
|
|
||||||
+++ b/e-util/e-attachment-store.c
|
|
||||||
@@ -29,7 +29,7 @@
|
|
||||||
#include <glib/gi18n.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
-#include <gnome-autoar/autoar.h>
|
|
||||||
+#include <gnome-autoar/gnome-autoar.h>
|
|
||||||
#include <gnome-autoar/autoar-gtk.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -648,8 +648,10 @@ e_attachment_store_run_load_dialog (EAttachmentStore *store,
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
GSettings *settings;
|
|
||||||
- AutoarPref *arpref;
|
|
||||||
- gint format, filter;
|
|
||||||
+ char *format_string;
|
|
||||||
+ char *filter_string;
|
|
||||||
+ gint format;
|
|
||||||
+ gint filter;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_return_if_fail (E_IS_ATTACHMENT_STORE (store));
|
|
||||||
@@ -699,14 +701,23 @@ e_attachment_store_run_load_dialog (EAttachmentStore *store,
|
|
||||||
option_format_box = GTK_BOX (option_format_box_widget);
|
|
||||||
gtk_box_pack_start (extra_box, option_format_box_widget, FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
- settings = e_util_ref_settings (AUTOAR_PREF_DEFAULT_GSCHEMA_ID);
|
|
||||||
- arpref = autoar_pref_new_with_gsettings (settings);
|
|
||||||
+ settings = e_util_ref_settings ("org.gnome.evolution.shell");
|
|
||||||
+
|
|
||||||
+ format_string = g_settings_get_string (settings, "autoar-format");
|
|
||||||
+ filter_string = g_settings_get_string (settings, "autoar-filter");
|
|
||||||
+
|
|
||||||
+ if (!e_enum_from_string (AUTOAR_TYPE_FORMAT, format_string, &format)) {
|
|
||||||
+ format = AUTOAR_FORMAT_ZIP;
|
|
||||||
+ }
|
|
||||||
+ if (!e_enum_from_string (AUTOAR_TYPE_FILTER, filter_string, &filter)) {
|
|
||||||
+ filter = AUTOAR_FILTER_NONE;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
option_format_label = gtk_label_new (
|
|
||||||
_("Archive selected directories using this format:"));
|
|
||||||
option_format_combo = autoar_gtk_chooser_simple_new (
|
|
||||||
- autoar_pref_get_default_format (arpref),
|
|
||||||
- autoar_pref_get_default_filter (arpref));
|
|
||||||
+ format,
|
|
||||||
+ filter);
|
|
||||||
gtk_box_pack_start (option_format_box, option_format_label, FALSE, FALSE, 0);
|
|
||||||
gtk_box_pack_start (option_format_box, option_format_combo, FALSE, FALSE, 0);
|
|
||||||
#endif
|
|
||||||
@@ -729,8 +740,23 @@ e_attachment_store_run_load_dialog (EAttachmentStore *store,
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
autoar_gtk_chooser_simple_get (option_format_combo, &format, &filter);
|
|
||||||
- autoar_pref_set_default_format (arpref, format);
|
|
||||||
- autoar_pref_set_default_filter (arpref, filter);
|
|
||||||
+
|
|
||||||
+ if (!e_enum_to_string (AUTOAR_TYPE_FORMAT, format)) {
|
|
||||||
+ format = AUTOAR_FORMAT_ZIP;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (!e_enum_to_string (AUTOAR_TYPE_FORMAT, filter)) {
|
|
||||||
+ filter = AUTOAR_FILTER_NONE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ g_settings_set_string (
|
|
||||||
+ settings,
|
|
||||||
+ "autoar-format",
|
|
||||||
+ e_enum_to_string (AUTOAR_TYPE_FORMAT, format));
|
|
||||||
+ g_settings_set_string (
|
|
||||||
+ settings,
|
|
||||||
+ "autoar-filter",
|
|
||||||
+ e_enum_to_string (AUTOAR_TYPE_FILTER, filter));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (iter = files; iter != NULL; iter = g_slist_next (iter)) {
|
|
||||||
@@ -742,11 +768,6 @@ e_attachment_store_run_load_dialog (EAttachmentStore *store,
|
|
||||||
e_attachment_set_disposition (attachment, disposition);
|
|
||||||
e_attachment_store_add_attachment (store, attachment);
|
|
||||||
|
|
||||||
-#ifdef HAVE_AUTOAR
|
|
||||||
- g_object_set_data_full (G_OBJECT (attachment),
|
|
||||||
- "autoar-pref", g_object_ref (arpref), g_object_unref);
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
e_attachment_load_async (
|
|
||||||
attachment, (GAsyncReadyCallback)
|
|
||||||
e_attachment_load_handle_error, parent);
|
|
||||||
@@ -760,7 +781,8 @@ exit:
|
|
||||||
gtk_widget_destroy (dialog);
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
g_object_unref (settings);
|
|
||||||
- g_object_unref (arpref);
|
|
||||||
+ g_free (format_string);
|
|
||||||
+ g_free (filter_string);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -848,8 +870,6 @@ e_attachment_store_run_save_dialog (EAttachmentStore *store,
|
|
||||||
const gchar *name = NULL;
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
- AutoarPref *arpref;
|
|
||||||
- GSettings *settings;
|
|
||||||
gchar *mime_type;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -867,15 +887,10 @@ e_attachment_store_run_save_dialog (EAttachmentStore *store,
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
mime_type = e_attachment_dup_mime_type (attachment);
|
|
||||||
- settings = e_util_ref_settings (AUTOAR_PREF_DEFAULT_GSCHEMA_ID);
|
|
||||||
- arpref = autoar_pref_new_with_gsettings (settings);
|
|
||||||
- if (!autoar_pref_check_file_name (arpref, name) &&
|
|
||||||
- !autoar_pref_check_mime_type_d (arpref, mime_type)) {
|
|
||||||
+ if (!autoar_check_mime_type_supported (mime_type)) {
|
|
||||||
gtk_widget_hide (extra_box_widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
- g_clear_object (&settings);
|
|
||||||
- g_clear_object (&arpref);
|
|
||||||
g_free (mime_type);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -903,27 +918,16 @@ e_attachment_store_run_save_dialog (EAttachmentStore *store,
|
|
||||||
e_attachment_set_save_self (attachment_list->data, save_self);
|
|
||||||
e_attachment_set_save_extracted (attachment_list->data, save_extracted);
|
|
||||||
} else {
|
|
||||||
- AutoarPref *arpref;
|
|
||||||
- GSettings *settings;
|
|
||||||
GList *iter;
|
|
||||||
|
|
||||||
- settings = e_util_ref_settings (AUTOAR_PREF_DEFAULT_GSCHEMA_ID);
|
|
||||||
- arpref = autoar_pref_new_with_gsettings (settings);
|
|
||||||
-
|
|
||||||
for (iter = attachment_list; iter != NULL; iter = iter->next) {
|
|
||||||
EAttachment *attachment;
|
|
||||||
- GFileInfo *file_info;
|
|
||||||
- const gchar *name;
|
|
||||||
gchar *mime_type;
|
|
||||||
|
|
||||||
attachment = iter->data;
|
|
||||||
- file_info = e_attachment_ref_file_info (attachment);
|
|
||||||
- name = g_file_info_get_display_name (file_info);
|
|
||||||
mime_type = e_attachment_dup_mime_type (attachment);
|
|
||||||
|
|
||||||
- if ((name != NULL &&
|
|
||||||
- autoar_pref_check_file_name (arpref, name)) ||
|
|
||||||
- autoar_pref_check_mime_type_d (arpref, mime_type)) {
|
|
||||||
+ if (autoar_check_mime_type_supported (mime_type)) {
|
|
||||||
e_attachment_set_save_self (attachment, save_self);
|
|
||||||
e_attachment_set_save_extracted (attachment, save_extracted);
|
|
||||||
} else {
|
|
||||||
@@ -931,12 +935,8 @@ e_attachment_store_run_save_dialog (EAttachmentStore *store,
|
|
||||||
e_attachment_set_save_extracted (attachment, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
- g_object_unref (file_info);
|
|
||||||
g_free (mime_type);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- g_object_unref (settings);
|
|
||||||
- g_object_unref (arpref);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
diff --git a/e-util/e-attachment.c b/e-util/e-attachment.c
|
|
||||||
index d451f18..21dec66 100644
|
|
||||||
--- a/e-util/e-attachment.c
|
|
||||||
+++ b/e-util/e-attachment.c
|
|
||||||
@@ -29,8 +29,7 @@
|
|
||||||
#include <glib/gstdio.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
-#include <gnome-autoar/autoar.h>
|
|
||||||
-#include <gnome-autoar/autoar-gtk.h>
|
|
||||||
+#include <gnome-autoar/gnome-autoar.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <libedataserver/libedataserver.h>
|
|
||||||
@@ -2027,7 +2026,7 @@ attachment_load_file_read_cb (GFile *file,
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
static void
|
|
||||||
-attachment_load_created_decide_dest_cb (AutoarCreate *arcreate,
|
|
||||||
+attachment_load_created_decide_dest_cb (AutoarCompressor *compressor,
|
|
||||||
GFile *destination,
|
|
||||||
EAttachment *attachment)
|
|
||||||
{
|
|
||||||
@@ -2035,23 +2034,23 @@ attachment_load_created_decide_dest_cb (AutoarCreate *arcreate,
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-attachment_load_created_cancelled_cb (AutoarCreate *arcreate,
|
|
||||||
+attachment_load_created_cancelled_cb (AutoarCompressor *compressor,
|
|
||||||
LoadContext *load_context)
|
|
||||||
{
|
|
||||||
attachment_load_check_for_error (load_context,
|
|
||||||
g_error_new_literal (
|
|
||||||
G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled")));
|
|
||||||
- g_object_unref (arcreate);
|
|
||||||
+ g_object_unref (compressor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-attachment_load_created_completed_cb (AutoarCreate *arcreate,
|
|
||||||
+attachment_load_created_completed_cb (AutoarCompressor *compressor,
|
|
||||||
LoadContext *load_context)
|
|
||||||
{
|
|
||||||
EAttachment *attachment;
|
|
||||||
GFile *file;
|
|
||||||
|
|
||||||
- g_object_unref (arcreate);
|
|
||||||
+ g_object_unref (compressor);
|
|
||||||
|
|
||||||
/* We have set the file to the created temporary archive, so we can
|
|
||||||
* query info again and use the regular procedure to load the
|
|
||||||
@@ -2068,12 +2067,12 @@ attachment_load_created_completed_cb (AutoarCreate *arcreate,
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-attachment_load_created_error_cb (AutoarCreate *arcreate,
|
|
||||||
+attachment_load_created_error_cb (AutoarCompressor *compressor,
|
|
||||||
GError *error,
|
|
||||||
LoadContext *load_context)
|
|
||||||
{
|
|
||||||
attachment_load_check_for_error (load_context, g_error_copy (error));
|
|
||||||
- g_object_unref (arcreate);
|
|
||||||
+ g_object_unref (compressor);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -2101,25 +2100,49 @@ attachment_load_query_info_cb (GFile *file,
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY) {
|
|
||||||
- AutoarCreate *arcreate;
|
|
||||||
- AutoarPref *arpref; /* Do not unref */
|
|
||||||
+ AutoarCompressor *compressor;
|
|
||||||
GFile *temporary;
|
|
||||||
+ GSettings *settings;
|
|
||||||
+ GList *files = NULL;
|
|
||||||
+ char *format_string;
|
|
||||||
+ char *filter_string;
|
|
||||||
+ gint format;
|
|
||||||
+ gint filter;
|
|
||||||
|
|
||||||
- arpref = g_object_get_data (G_OBJECT (attachment), "autoar-pref");
|
|
||||||
temporary = attachment_get_temporary (&error);
|
|
||||||
if (attachment_load_check_for_error (load_context, error))
|
|
||||||
return;
|
|
||||||
- arcreate = autoar_create_new_file (arpref, temporary, file, NULL);
|
|
||||||
- g_signal_connect (arcreate, "decide-dest",
|
|
||||||
+
|
|
||||||
+ settings = e_util_ref_settings ("org.gnome.evolution.shell");
|
|
||||||
+
|
|
||||||
+ format_string = g_settings_get_string (settings, "autoar-format");
|
|
||||||
+ filter_string = g_settings_get_string (settings, "autoar-filter");
|
|
||||||
+
|
|
||||||
+ if (!e_enum_from_string (AUTOAR_TYPE_FORMAT, format_string, &format)) {
|
|
||||||
+ format = AUTOAR_FORMAT_ZIP;
|
|
||||||
+ }
|
|
||||||
+ if (!e_enum_from_string (AUTOAR_TYPE_FILTER, filter_string, &filter)) {
|
|
||||||
+ filter = AUTOAR_FILTER_NONE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ files = g_list_prepend (files, file);
|
|
||||||
+
|
|
||||||
+ compressor = autoar_compressor_new (
|
|
||||||
+ files, temporary, format, filter, FALSE);
|
|
||||||
+ g_signal_connect (compressor, "decide-dest",
|
|
||||||
G_CALLBACK (attachment_load_created_decide_dest_cb), attachment);
|
|
||||||
- g_signal_connect (arcreate, "cancelled",
|
|
||||||
+ g_signal_connect (compressor, "cancelled",
|
|
||||||
G_CALLBACK (attachment_load_created_cancelled_cb), load_context);
|
|
||||||
- g_signal_connect (arcreate, "completed",
|
|
||||||
+ g_signal_connect (compressor, "completed",
|
|
||||||
G_CALLBACK (attachment_load_created_completed_cb), load_context);
|
|
||||||
- g_signal_connect (arcreate, "error",
|
|
||||||
+ g_signal_connect (compressor, "error",
|
|
||||||
G_CALLBACK (attachment_load_created_error_cb), load_context);
|
|
||||||
- autoar_create_start_async (arcreate, cancellable);
|
|
||||||
+ autoar_compressor_start_async (compressor, cancellable);
|
|
||||||
|
|
||||||
+ g_object_unref (settings);
|
|
||||||
+ g_free (format_string);
|
|
||||||
+ g_free (filter_string);
|
|
||||||
+ g_list_free (files);
|
|
||||||
g_object_unref (temporary);
|
|
||||||
} else {
|
|
||||||
#endif
|
|
||||||
@@ -2752,6 +2775,7 @@ struct _SaveContext {
|
|
||||||
|
|
||||||
GByteArray *input_buffer;
|
|
||||||
gchar *suggested_destname;
|
|
||||||
+ GFile *temporary_file;
|
|
||||||
|
|
||||||
guint total_tasks : 2;
|
|
||||||
guint completed_tasks : 2;
|
|
||||||
@@ -2815,6 +2839,9 @@ attachment_save_context_free (SaveContext *save_context)
|
|
||||||
if (save_context->suggested_destname != NULL)
|
|
||||||
g_free (save_context->suggested_destname);
|
|
||||||
|
|
||||||
+ if (save_context->temporary_file != NULL)
|
|
||||||
+ g_clear_object (&save_context->temporary_file);
|
|
||||||
+
|
|
||||||
g_mutex_clear (&(save_context->completed_tasks_mutex));
|
|
||||||
g_mutex_clear (&(save_context->prepared_tasks_mutex));
|
|
||||||
|
|
||||||
@@ -2872,6 +2899,33 @@ attachment_save_complete (SaveContext *save_context) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+static gchar *
|
|
||||||
+get_new_name_with_count (const gchar *initial_name,
|
|
||||||
+ gint count)
|
|
||||||
+{
|
|
||||||
+ GString *string;
|
|
||||||
+ const gchar *ext;
|
|
||||||
+ gsize length;
|
|
||||||
+
|
|
||||||
+ if (count == 0) {
|
|
||||||
+ return g_strdup (initial_name);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ string = g_string_sized_new (strlen (initial_name));
|
|
||||||
+ ext = g_utf8_strchr (initial_name, -1, '.');
|
|
||||||
+
|
|
||||||
+ if (ext != NULL)
|
|
||||||
+ length = ext - initial_name;
|
|
||||||
+ else
|
|
||||||
+ length = strlen (initial_name);
|
|
||||||
+
|
|
||||||
+ g_string_append_len (string, initial_name, length);
|
|
||||||
+ g_string_append_printf (string, " (%d)", count);
|
|
||||||
+ g_string_append (string, (ext != NULL) ? ext : "");
|
|
||||||
+
|
|
||||||
+ return g_string_free (string, FALSE);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static GFile *
|
|
||||||
attachment_save_new_candidate (SaveContext *save_context)
|
|
||||||
{
|
|
||||||
@@ -2890,27 +2944,7 @@ attachment_save_new_candidate (SaveContext *save_context)
|
|
||||||
/* Translators: Default attachment filename. */
|
|
||||||
display_name = _("attachment.dat");
|
|
||||||
|
|
||||||
- if (save_context->count == 0)
|
|
||||||
- basename = g_strdup (display_name);
|
|
||||||
- else {
|
|
||||||
- GString *string;
|
|
||||||
- const gchar *ext;
|
|
||||||
- gsize length;
|
|
||||||
-
|
|
||||||
- string = g_string_sized_new (strlen (display_name));
|
|
||||||
- ext = g_utf8_strchr (display_name, -1, '.');
|
|
||||||
-
|
|
||||||
- if (ext != NULL)
|
|
||||||
- length = ext - display_name;
|
|
||||||
- else
|
|
||||||
- length = strlen (display_name);
|
|
||||||
-
|
|
||||||
- g_string_append_len (string, display_name, length);
|
|
||||||
- g_string_append_printf (string, " (%d)", save_context->count);
|
|
||||||
- g_string_append (string, (ext != NULL) ? ext : "");
|
|
||||||
-
|
|
||||||
- basename = g_string_free (string, FALSE);
|
|
||||||
- }
|
|
||||||
+ basename = get_new_name_with_count (display_name, save_context->count);
|
|
||||||
|
|
||||||
save_context->count++;
|
|
||||||
|
|
||||||
@@ -3009,43 +3043,151 @@ attachment_save_read_cb (GInputStream *input_stream,
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
+static GFile*
|
|
||||||
+attachment_save_extracted_decide_destination_cb (AutoarExtractor *extractor,
|
|
||||||
+ GFile *destination,
|
|
||||||
+ GList *files,
|
|
||||||
+ SaveContext *save_context)
|
|
||||||
+{
|
|
||||||
+ gchar *basename;
|
|
||||||
+ GFile *destination_directory;
|
|
||||||
+ GFile *new_destination;
|
|
||||||
+ gint count = 0;
|
|
||||||
+
|
|
||||||
+ basename = g_file_get_basename (destination);
|
|
||||||
+ destination_directory = g_file_get_parent (destination);
|
|
||||||
+
|
|
||||||
+ new_destination = g_object_ref (destination);
|
|
||||||
+
|
|
||||||
+ while (g_file_query_exists (new_destination, NULL)) {
|
|
||||||
+ gchar *new_basename;
|
|
||||||
+
|
|
||||||
+ new_basename = get_new_name_with_count (basename, ++count);
|
|
||||||
+
|
|
||||||
+ g_object_unref (new_destination);
|
|
||||||
+
|
|
||||||
+ new_destination = g_file_get_child (
|
|
||||||
+ destination_directory, new_basename);
|
|
||||||
+
|
|
||||||
+ g_free (new_basename);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ g_object_unref (destination_directory);
|
|
||||||
+ g_free (basename);
|
|
||||||
+
|
|
||||||
+ return new_destination;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static void
|
|
||||||
-attachment_save_extracted_progress_cb (AutoarExtract *arextract,
|
|
||||||
+attachment_save_extracted_progress_cb (AutoarExtractor *extractor,
|
|
||||||
guint64 completed_size,
|
|
||||||
guint completed_files,
|
|
||||||
SaveContext *save_context)
|
|
||||||
{
|
|
||||||
attachment_progress_cb (
|
|
||||||
- autoar_extract_get_size (arextract),
|
|
||||||
+ autoar_extractor_get_total_size (extractor),
|
|
||||||
completed_size, save_context->attachment);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-attachment_save_extracted_cancelled_cb (AutoarExtract *arextract,
|
|
||||||
+attachment_save_extracted_cancelled_cb (AutoarExtractor *extractor,
|
|
||||||
SaveContext *save_context)
|
|
||||||
{
|
|
||||||
attachment_save_check_for_error (save_context,
|
|
||||||
g_error_new_literal (
|
|
||||||
G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled")));
|
|
||||||
- g_object_unref (arextract);
|
|
||||||
+ g_object_unref (extractor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-attachment_save_extracted_completed_cb (AutoarExtract *arextract,
|
|
||||||
+attachment_save_extracted_completed_cb (AutoarExtractor *extractor,
|
|
||||||
SaveContext *save_context)
|
|
||||||
{
|
|
||||||
attachment_save_complete (save_context);
|
|
||||||
- g_object_unref (arextract);
|
|
||||||
+ g_object_unref (extractor);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
-attachment_save_extracted_error_cb (AutoarExtract *arextract,
|
|
||||||
+attachment_save_extracted_error_cb (AutoarExtractor *extractor,
|
|
||||||
GError *error,
|
|
||||||
SaveContext *save_context)
|
|
||||||
{
|
|
||||||
attachment_save_check_for_error (save_context, g_error_copy (error));
|
|
||||||
- g_object_unref (arextract);
|
|
||||||
+ g_object_unref (extractor);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+attachament_save_write_archive_cb (GOutputStream *output_stream,
|
|
||||||
+ GAsyncResult *result,
|
|
||||||
+ SaveContext *save_context)
|
|
||||||
+{
|
|
||||||
+ AutoarExtractor *extractor;
|
|
||||||
+ GError *error = NULL;
|
|
||||||
+ gsize bytes_written;
|
|
||||||
+
|
|
||||||
+ g_output_stream_write_all_finish (
|
|
||||||
+ output_stream, result, &bytes_written, &error);
|
|
||||||
+
|
|
||||||
+ g_object_unref (output_stream);
|
|
||||||
+
|
|
||||||
+ if (attachment_save_check_for_error (save_context, error)) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ extractor = autoar_extractor_new (
|
|
||||||
+ save_context->temporary_file, save_context->directory);
|
|
||||||
+
|
|
||||||
+ autoar_extractor_set_delete_after_extraction (extractor, TRUE);
|
|
||||||
+
|
|
||||||
+ g_signal_connect (extractor, "decide-destination",
|
|
||||||
+ G_CALLBACK (attachment_save_extracted_decide_destination_cb),
|
|
||||||
+ save_context);
|
|
||||||
+ g_signal_connect (extractor, "progress",
|
|
||||||
+ G_CALLBACK (attachment_save_extracted_progress_cb),
|
|
||||||
+ save_context);
|
|
||||||
+ g_signal_connect (extractor, "cancelled",
|
|
||||||
+ G_CALLBACK (attachment_save_extracted_cancelled_cb),
|
|
||||||
+ save_context);
|
|
||||||
+ g_signal_connect (extractor, "error",
|
|
||||||
+ G_CALLBACK (attachment_save_extracted_error_cb),
|
|
||||||
+ save_context);
|
|
||||||
+ g_signal_connect (extractor, "completed",
|
|
||||||
+ G_CALLBACK (attachment_save_extracted_completed_cb),
|
|
||||||
+ save_context);
|
|
||||||
+
|
|
||||||
+ autoar_extractor_start_async (
|
|
||||||
+ extractor, save_context->attachment->priv->cancellable);
|
|
||||||
+
|
|
||||||
+ /* We do not g_object_unref (extractor); here because
|
|
||||||
+ * autoar_extractor_run_start_async () does not increase the
|
|
||||||
+ * reference count of extractor. We unref the object in
|
|
||||||
+ * callbacks instead. */
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void
|
|
||||||
+attachment_save_create_archive_cb (GFile *file,
|
|
||||||
+ GAsyncResult *result,
|
|
||||||
+ SaveContext *save_context)
|
|
||||||
+{
|
|
||||||
+ GFileOutputStream *output_stream;
|
|
||||||
+ GError *error = NULL;
|
|
||||||
+
|
|
||||||
+ output_stream = g_file_create_finish (file, result, &error);
|
|
||||||
+
|
|
||||||
+ if (attachment_save_check_for_error (save_context, error)) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ g_output_stream_write_all_async (
|
|
||||||
+ G_OUTPUT_STREAM (output_stream),
|
|
||||||
+ save_context->input_buffer->data,
|
|
||||||
+ save_context->input_buffer->len,
|
|
||||||
+ G_PRIORITY_DEFAULT,
|
|
||||||
+ save_context->attachment->priv->cancellable,
|
|
||||||
+ (GAsyncReadyCallback) attachament_save_write_archive_cb,
|
|
||||||
+ save_context);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
|
||||||
@@ -3097,41 +3239,25 @@ attachment_save_got_output_stream (SaveContext *save_context)
|
|
||||||
|
|
||||||
#ifdef HAVE_AUTOAR
|
|
||||||
if (attachment->priv->save_extracted) {
|
|
||||||
- GSettings *settings;
|
|
||||||
- AutoarPref *arpref;
|
|
||||||
- AutoarExtract *arextract;
|
|
||||||
+ GFile *temporary_directory;
|
|
||||||
+ GError *error = NULL;
|
|
||||||
|
|
||||||
- settings = e_util_ref_settings (AUTOAR_PREF_DEFAULT_GSCHEMA_ID);
|
|
||||||
- arpref = autoar_pref_new_with_gsettings (settings);
|
|
||||||
- autoar_pref_set_delete_if_succeed (arpref, FALSE);
|
|
||||||
+ temporary_directory = attachment_get_temporary (&error);
|
|
||||||
+ if (attachment_save_check_for_error (save_context, error))
|
|
||||||
+ return;
|
|
||||||
|
|
||||||
- arextract = autoar_extract_new_memory_file (
|
|
||||||
- buffer->data, buffer->len,
|
|
||||||
- save_context->suggested_destname,
|
|
||||||
- save_context->directory, arpref);
|
|
||||||
+ save_context->temporary_file = g_file_get_child (
|
|
||||||
+ temporary_directory, save_context->suggested_destname);
|
|
||||||
|
|
||||||
- g_signal_connect (arextract, "progress",
|
|
||||||
- G_CALLBACK (attachment_save_extracted_progress_cb),
|
|
||||||
- save_context);
|
|
||||||
- g_signal_connect (arextract, "cancelled",
|
|
||||||
- G_CALLBACK (attachment_save_extracted_cancelled_cb),
|
|
||||||
- save_context);
|
|
||||||
- g_signal_connect (arextract, "error",
|
|
||||||
- G_CALLBACK (attachment_save_extracted_error_cb),
|
|
||||||
- save_context);
|
|
||||||
- g_signal_connect (arextract, "completed",
|
|
||||||
- G_CALLBACK (attachment_save_extracted_completed_cb),
|
|
||||||
+ g_file_create_async (
|
|
||||||
+ save_context->temporary_file,
|
|
||||||
+ G_FILE_CREATE_NONE,
|
|
||||||
+ G_PRIORITY_DEFAULT,
|
|
||||||
+ cancellable,
|
|
||||||
+ (GAsyncReadyCallback) attachment_save_create_archive_cb,
|
|
||||||
save_context);
|
|
||||||
|
|
||||||
- autoar_extract_start_async (arextract, cancellable);
|
|
||||||
-
|
|
||||||
- g_object_unref (settings);
|
|
||||||
- g_object_unref (arpref);
|
|
||||||
-
|
|
||||||
- /* We do not g_object_unref (arextract); here because
|
|
||||||
- * autoar_extract_run_start_async () do not increase the
|
|
||||||
- * reference count of arextract. We unref the object in
|
|
||||||
- * callbacks instead. */
|
|
||||||
+ g_object_unref (temporary_directory);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
--
|
|
||||||
cgit v0.12
|
|
||||||
|
|
@ -1,304 +0,0 @@
|
|||||||
From 7c8ee5067ce58911e68586a0887b2e57abc5c9c2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Tomas Popela <tpopela@redhat.com>
|
|
||||||
Date: Thu, 1 Sep 2016 17:53:46 +0200
|
|
||||||
Subject: Adapt to WebKit Unstable DOM API changes in WebKitGTK+ 2.13.90
|
|
||||||
|
|
||||||
Also increase the minimal required WebKitGTK+ version.
|
|
||||||
---
|
|
||||||
configure.ac | 2 +-
|
|
||||||
.../web-extension/e-composer-dom-functions.c | 6 +--
|
|
||||||
.../web-extension/e-dialogs-dom-functions.c | 2 +-
|
|
||||||
.../web-extension/e-editor-dom-functions.c | 45 +++++++++++-----------
|
|
||||||
4 files changed, 28 insertions(+), 27 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/modules/webkit-editor/web-extension/e-composer-dom-functions.c b/modules/webkit-editor/web-extension/e-composer-dom-functions.c
|
|
||||||
index a54b180..221c0af 100644
|
|
||||||
--- a/modules/webkit-editor/web-extension/e-composer-dom-functions.c
|
|
||||||
+++ b/modules/webkit-editor/web-extension/e-composer-dom-functions.c
|
|
||||||
@@ -25,7 +25,7 @@
|
|
||||||
#define WEBKIT_DOM_USE_UNSTABLE_API
|
|
||||||
#include <webkitdom/WebKitDOMDOMSelection.h>
|
|
||||||
#include <webkitdom/WebKitDOMDOMWindowUnstable.h>
|
|
||||||
-#include <webkitdom/WebKitDOMHTMLElementUnstable.h>
|
|
||||||
+#include <webkitdom/WebKitDOMElementUnstable.h>
|
|
||||||
#undef WEBKIT_DOM_USE_UNSTABLE_API
|
|
||||||
|
|
||||||
#include <camel/camel.h>
|
|
||||||
@@ -370,8 +370,8 @@ e_composer_dom_insert_signature (EEditorPage *editor_page,
|
|
||||||
WEBKIT_DOM_NODE (insert_signature_in), node, NULL);
|
|
||||||
remove_node (WEBKIT_DOM_NODE (converted_signature));
|
|
||||||
} else
|
|
||||||
- webkit_dom_html_element_insert_adjacent_html (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (insert_signature_in),
|
|
||||||
+ webkit_dom_element_insert_adjacent_html (
|
|
||||||
+ insert_signature_in,
|
|
||||||
"beforeend",
|
|
||||||
signature_text,
|
|
||||||
NULL);
|
|
||||||
diff --git a/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c b/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
|
|
||||||
index b3ac1bf..d3699a2 100644
|
|
||||||
--- a/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
|
|
||||||
+++ b/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
|
|
||||||
@@ -1087,7 +1087,7 @@ e_dialogs_dom_spell_check_run (EEditorPage *editor_page,
|
|
||||||
* reached only when we reach the beginning/end of the document */
|
|
||||||
if (start && end)
|
|
||||||
webkit_dom_dom_selection_set_base_and_extent (
|
|
||||||
- dom_selection, start, start_offset, end, end_offset, NULL);
|
|
||||||
+ dom_selection, start, start_offset, end, end_offset);
|
|
||||||
|
|
||||||
g_clear_object (&dom_selection);
|
|
||||||
|
|
||||||
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
|
|
||||||
index e778849..7d89495 100644
|
|
||||||
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
|
|
||||||
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
|
|
||||||
@@ -26,6 +26,7 @@
|
|
||||||
#include <webkitdom/WebKitDOMDOMSelection.h>
|
|
||||||
#include <webkitdom/WebKitDOMDOMWindowUnstable.h>
|
|
||||||
#include <webkitdom/WebKitDOMHTMLElementUnstable.h>
|
|
||||||
+#include <webkitdom/WebKitDOMElementUnstable.h>
|
|
||||||
#include <webkitdom/WebKitDOMRangeUnstable.h>
|
|
||||||
#undef WEBKIT_DOM_USE_UNSTABLE_API
|
|
||||||
|
|
||||||
@@ -1677,8 +1678,8 @@ e_editor_dom_check_magic_links (EEditorPage *editor_page,
|
|
||||||
new_href);
|
|
||||||
|
|
||||||
if (appending_to_link) {
|
|
||||||
- webkit_dom_html_element_insert_adjacent_html (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (parent),
|
|
||||||
+ webkit_dom_element_insert_adjacent_html (
|
|
||||||
+ WEBKIT_DOM_ELEMENT (parent),
|
|
||||||
"beforeend",
|
|
||||||
text_to_append,
|
|
||||||
NULL);
|
|
||||||
@@ -1710,8 +1711,8 @@ e_editor_dom_check_magic_links (EEditorPage *editor_page,
|
|
||||||
new_href);
|
|
||||||
|
|
||||||
if (appending_to_link) {
|
|
||||||
- webkit_dom_html_element_insert_adjacent_html (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (parent),
|
|
||||||
+ webkit_dom_element_insert_adjacent_html (
|
|
||||||
+ WEBKIT_DOM_ELEMENT (parent),
|
|
||||||
"beforeend",
|
|
||||||
text_to_append,
|
|
||||||
NULL);
|
|
||||||
@@ -2087,8 +2088,8 @@ emoticon_insert_span (EEmoticon *emoticon,
|
|
||||||
|
|
||||||
if (!e_editor_page_get_unicode_smileys_enabled (editor_page)) {
|
|
||||||
/* ​ == UNICODE_ZERO_WIDTH_SPACE */
|
|
||||||
- webkit_dom_html_element_insert_adjacent_html (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (span), "afterend", "​", NULL);
|
|
||||||
+ webkit_dom_element_insert_adjacent_html (
|
|
||||||
+ WEBKIT_DOM_ELEMENT (span), "afterend", "​", NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ev) {
|
|
||||||
@@ -2112,8 +2113,8 @@ emoticon_insert_span (EEmoticon *emoticon,
|
|
||||||
dom_create_selection_marker (document, FALSE)),
|
|
||||||
NULL);
|
|
||||||
} else
|
|
||||||
- webkit_dom_html_element_insert_adjacent_html (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (node), "afterend", "​", NULL);
|
|
||||||
+ webkit_dom_element_insert_adjacent_html (
|
|
||||||
+ WEBKIT_DOM_ELEMENT (node), "afterend", "​", NULL);
|
|
||||||
ev->data.fragment = g_object_ref (fragment);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -3910,8 +3911,8 @@ e_editor_dom_body_key_up_event_process_return_key (EEditorPage *editor_page)
|
|
||||||
if (!webkit_dom_node_get_previous_sibling (WEBKIT_DOM_NODE (selection_start_marker)) &&
|
|
||||||
(!webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (selection_end_marker)) ||
|
|
||||||
WEBKIT_DOM_IS_HTML_BR_ELEMENT (webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (selection_end_marker)))))
|
|
||||||
- webkit_dom_html_element_insert_adjacent_text (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (parent),
|
|
||||||
+ webkit_dom_element_insert_adjacent_text (
|
|
||||||
+ WEBKIT_DOM_ELEMENT (parent),
|
|
||||||
"afterbegin",
|
|
||||||
UNICODE_ZERO_WIDTH_SPACE,
|
|
||||||
NULL);
|
|
||||||
@@ -5494,14 +5495,14 @@ e_editor_dom_quote_and_insert_text_into_selection (EEditorPage *editor_page,
|
|
||||||
static void
|
|
||||||
mark_citation (WebKitDOMElement *citation)
|
|
||||||
{
|
|
||||||
- webkit_dom_html_element_insert_adjacent_text (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (citation),
|
|
||||||
+ webkit_dom_element_insert_adjacent_text (
|
|
||||||
+ citation,
|
|
||||||
"beforebegin",
|
|
||||||
"##CITATION_START##",
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
- webkit_dom_html_element_insert_adjacent_text (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (citation),
|
|
||||||
+ webkit_dom_element_insert_adjacent_text (
|
|
||||||
+ citation,
|
|
||||||
"afterend",
|
|
||||||
"##CITATION_END##",
|
|
||||||
NULL);
|
|
||||||
@@ -5537,8 +5538,8 @@ create_text_markers_for_selection_in_element (WebKitDOMElement *element)
|
|
||||||
selection_marker = webkit_dom_element_query_selector (
|
|
||||||
element, "#-x-evo-selection-start-marker", NULL);
|
|
||||||
if (selection_marker)
|
|
||||||
- webkit_dom_html_element_insert_adjacent_text (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (selection_marker),
|
|
||||||
+ webkit_dom_element_insert_adjacent_text (
|
|
||||||
+ selection_marker,
|
|
||||||
"afterend",
|
|
||||||
"##SELECTION_START##",
|
|
||||||
NULL);
|
|
||||||
@@ -5546,8 +5547,8 @@ create_text_markers_for_selection_in_element (WebKitDOMElement *element)
|
|
||||||
selection_marker = webkit_dom_element_query_selector (
|
|
||||||
element, "#-x-evo-selection-end-marker", NULL);
|
|
||||||
if (selection_marker)
|
|
||||||
- webkit_dom_html_element_insert_adjacent_text (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (selection_marker),
|
|
||||||
+ webkit_dom_element_insert_adjacent_text (
|
|
||||||
+ selection_marker,
|
|
||||||
"afterend",
|
|
||||||
"##SELECTION_END##",
|
|
||||||
NULL);
|
|
||||||
@@ -11090,8 +11091,8 @@ e_editor_dom_insert_base64_image (EEditorPage *editor_page,
|
|
||||||
webkit_dom_node_clone_node_with_error (WEBKIT_DOM_NODE (resizable_wrapper), TRUE, NULL),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
- webkit_dom_html_element_insert_adjacent_html (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (node), "afterend", "​", NULL);
|
|
||||||
+ webkit_dom_element_insert_adjacent_html (
|
|
||||||
+ WEBKIT_DOM_ELEMENT (node), "afterend", "​", NULL);
|
|
||||||
ev->data.fragment = g_object_ref (fragment);
|
|
||||||
|
|
||||||
e_editor_dom_selection_get_coordinates (editor_page,
|
|
||||||
@@ -14617,8 +14618,8 @@ set_font_style (WebKitDOMDocument *document,
|
|
||||||
text_content = webkit_dom_node_get_text_content (first_child);
|
|
||||||
|
|
||||||
if (g_strcmp0 (text_content, UNICODE_ZERO_WIDTH_SPACE) != 0)
|
|
||||||
- webkit_dom_html_element_insert_adjacent_text (
|
|
||||||
- WEBKIT_DOM_HTML_ELEMENT (parent),
|
|
||||||
+ webkit_dom_element_insert_adjacent_text (
|
|
||||||
+ WEBKIT_DOM_ELEMENT (parent),
|
|
||||||
"afterend",
|
|
||||||
UNICODE_ZERO_WIDTH_SPACE,
|
|
||||||
NULL);
|
|
||||||
--
|
|
||||||
cgit v0.12
|
|
||||||
|
|
||||||
From 1093ace5577c87e4a5d208aca1c9eb4dbc805b30 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Tomas Popela <tpopela@redhat.com>
|
|
||||||
Date: Fri, 2 Sep 2016 12:09:38 +0200
|
|
||||||
Subject: Replace usage of deprecated WebKit DOM API functions
|
|
||||||
|
|
||||||
---
|
|
||||||
.../web-extension/e-editor-dom-functions.c | 30 ++++++++++------------
|
|
||||||
web-extensions/e-dom-utils.c | 4 +--
|
|
||||||
2 files changed, 15 insertions(+), 19 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
|
|
||||||
index 7d89495..f941eca 100644
|
|
||||||
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
|
|
||||||
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
|
|
||||||
@@ -4766,7 +4766,7 @@ dom_quote_plain_text (WebKitDOMDocument *document)
|
|
||||||
gchar *name, *value;
|
|
||||||
WebKitDOMNode *node = webkit_dom_named_node_map_item (attributes, ii);
|
|
||||||
|
|
||||||
- name = webkit_dom_node_get_local_name (node);
|
|
||||||
+ name = webkit_dom_attr_get_name (WEBKIT_DOM_ATTR (node));
|
|
||||||
value = webkit_dom_node_get_node_value (node);
|
|
||||||
|
|
||||||
webkit_dom_element_set_attribute (
|
|
||||||
@@ -5630,15 +5630,13 @@ clear_attributes (EEditorPage *editor_page)
|
|
||||||
length = webkit_dom_named_node_map_get_length (attributes);
|
|
||||||
for (ii = length - 1; ii >= 0; ii--) {
|
|
||||||
gchar *name;
|
|
||||||
- WebKitDOMNode *node = webkit_dom_named_node_map_item (attributes, ii);
|
|
||||||
+ WebKitDOMAttr *attribute = WEBKIT_DOM_ATTR (webkit_dom_named_node_map_item (attributes, ii));
|
|
||||||
|
|
||||||
- name = webkit_dom_node_get_local_name (node);
|
|
||||||
+ name = webkit_dom_attr_get_name (attribute);
|
|
||||||
|
|
||||||
if (!g_str_has_prefix (name, "data-") && (g_strcmp0 (name, "spellcheck") != 0))
|
|
||||||
webkit_dom_element_remove_attribute_node (
|
|
||||||
- WEBKIT_DOM_ELEMENT (body),
|
|
||||||
- WEBKIT_DOM_ATTR (node),
|
|
||||||
- NULL);
|
|
||||||
+ WEBKIT_DOM_ELEMENT (body), attribute, NULL);
|
|
||||||
|
|
||||||
g_free (name);
|
|
||||||
}
|
|
||||||
@@ -6590,11 +6588,11 @@ process_indented_element (WebKitDOMElement *element)
|
|
||||||
gchar *text_content;
|
|
||||||
gchar *indented_text;
|
|
||||||
|
|
||||||
- text_content = webkit_dom_text_get_whole_text (WEBKIT_DOM_TEXT (child));
|
|
||||||
+ text_content = webkit_dom_character_data_get_data (WEBKIT_DOM_CHARACTER_DATA (child));
|
|
||||||
indented_text = g_strconcat (spaces, text_content, NULL);
|
|
||||||
|
|
||||||
- webkit_dom_text_replace_whole_text (
|
|
||||||
- WEBKIT_DOM_TEXT (child),
|
|
||||||
+ webkit_dom_character_data_set_data (
|
|
||||||
+ WEBKIT_DOM_CHARACTER_DATA (child),
|
|
||||||
indented_text,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
@@ -7135,11 +7133,11 @@ process_node_to_plain_text_changing_composer_mode (EEditorPage *editor_page,
|
|
||||||
length = webkit_dom_named_node_map_get_length (attributes);
|
|
||||||
for (ii = 0; ii < length; ii++) {
|
|
||||||
gchar *name = NULL;
|
|
||||||
- WebKitDOMNode *attribute;
|
|
||||||
+ WebKitDOMAttr *attribute;
|
|
||||||
|
|
||||||
- attribute = webkit_dom_named_node_map_item (attributes, ii);
|
|
||||||
+ attribute = WEBKIT_DOM_ATTR (webkit_dom_named_node_map_item (attributes, ii));
|
|
||||||
|
|
||||||
- name = webkit_dom_node_get_local_name (attribute);
|
|
||||||
+ name = webkit_dom_attr_get_name (attribute);
|
|
||||||
|
|
||||||
if (g_strcmp0 (name, "bgcolor") == 0 ||
|
|
||||||
g_strcmp0 (name, "text") == 0 ||
|
|
||||||
@@ -7147,9 +7145,7 @@ process_node_to_plain_text_changing_composer_mode (EEditorPage *editor_page,
|
|
||||||
g_strcmp0 (name, "link") == 0) {
|
|
||||||
|
|
||||||
webkit_dom_element_remove_attribute_node (
|
|
||||||
- WEBKIT_DOM_ELEMENT (source),
|
|
||||||
- WEBKIT_DOM_ATTR (attribute),
|
|
||||||
- NULL);
|
|
||||||
+ WEBKIT_DOM_ELEMENT (source), attribute, NULL);
|
|
||||||
length--;
|
|
||||||
}
|
|
||||||
g_free (name);
|
|
||||||
@@ -8394,9 +8390,9 @@ change_cid_images_src_to_base64 (EEditorPage *editor_page)
|
|
||||||
length = webkit_dom_named_node_map_get_length (attributes);
|
|
||||||
for (ii = 0; ii < length; ii++) {
|
|
||||||
gchar *name;
|
|
||||||
- WebKitDOMNode *node = webkit_dom_named_node_map_item (attributes, ii);
|
|
||||||
+ WebKitDOMAttr *attribute = WEBKIT_DOM_ATTR( webkit_dom_named_node_map_item (attributes, ii));
|
|
||||||
|
|
||||||
- name = webkit_dom_node_get_local_name (node);
|
|
||||||
+ name = webkit_dom_attr_get_name (attribute);
|
|
||||||
|
|
||||||
if (g_str_has_prefix (name, "xmlns:")) {
|
|
||||||
const gchar *ns = name + 6;
|
|
||||||
diff --git a/web-extensions/e-dom-utils.c b/web-extensions/e-dom-utils.c
|
|
||||||
index 5322c17..170b975 100644
|
|
||||||
--- a/web-extensions/e-dom-utils.c
|
|
||||||
+++ b/web-extensions/e-dom-utils.c
|
|
||||||
@@ -969,7 +969,7 @@ e_dom_utils_get_active_element_name (WebKitDOMDocument *document)
|
|
||||||
element = webkit_dom_document_get_active_element (content_document);
|
|
||||||
}
|
|
||||||
|
|
||||||
- return webkit_dom_node_get_local_name (WEBKIT_DOM_NODE (element));
|
|
||||||
+ return webkit_dom_element_get_local_name (element);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
@@ -1459,7 +1459,7 @@ element_has_tag (WebKitDOMElement *element,
|
|
||||||
if (!WEBKIT_DOM_IS_ELEMENT (element))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
- element_tag = webkit_dom_node_get_local_name (WEBKIT_DOM_NODE (element));
|
|
||||||
+ element_tag = webkit_dom_element_get_tag_name (element);
|
|
||||||
|
|
||||||
if (g_ascii_strcasecmp (element_tag, tag) != 0) {
|
|
||||||
g_free (element_tag);
|
|
||||||
--
|
|
||||||
cgit v0.12
|
|
||||||
|
|
||||||
|
|
@ -1,3 +1,44 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 12 12:29:42 UTC 2016 - zaitor@opensuse.org
|
||||||
|
|
||||||
|
- Update to version 3.21.92:
|
||||||
|
+ [itip-formatter]: Guess meeting time zone when not provided in
|
||||||
|
the invitation.
|
||||||
|
+ Remove CSS sheet from the DOM only when it exists.
|
||||||
|
+ Critical warning could be printed when replying on message
|
||||||
|
with inline images.
|
||||||
|
+ Adapt to WebKit Unstable DOM API changes in WebKitGTK+ 2.13.90.
|
||||||
|
+ Replace usage of deprecated WebKit DOM API functions.
|
||||||
|
+ Replace last usage of deprecated WebKit DOM API functions.
|
||||||
|
+ Fix archives support in attachments.
|
||||||
|
+ Undoing a citation split could fail.
|
||||||
|
+ When removing empty blocks from citations, don't remove BR
|
||||||
|
elements.
|
||||||
|
+ Extra new line is inserted on the end of converted content.
|
||||||
|
+ Save selection in save_history_for_delete_or_backspace().
|
||||||
|
+ Selection end marker could be saved wrong in the quoted
|
||||||
|
content.
|
||||||
|
+ Correctly handle the undo operation the Backspace was pressed
|
||||||
|
in the beginning of LI element.
|
||||||
|
+ e_editor_dom_move_quoted_block_level_up() is wrong for HTML
|
||||||
|
mode.
|
||||||
|
+ Try to fix the "NL between tags" when inserting HTML into the
|
||||||
|
editor.
|
||||||
|
+ Update the tests expectations.
|
||||||
|
+ Change URL and e-mail pattern regular expressions.
|
||||||
|
+ Prefer OAuth2 authentication for Mail-only Google accounts.
|
||||||
|
+ Add 'OAuth2 Google' authentication type to Google-based
|
||||||
|
accounts.
|
||||||
|
+ Use DIV instead of P element for 'Normal' block.
|
||||||
|
+ After pressing the return key, caret is moved to a wrong place.
|
||||||
|
+ An extra quote character is inserted on the end of an empty PRE
|
||||||
|
element.
|
||||||
|
+ Bugs fixed: bgo#770496, bgo#771044, bgo#770380, bgo#771131.
|
||||||
|
+ Updated translations.
|
||||||
|
- Drop evolution-webkit2gtk3-adaptation.patch and
|
||||||
|
evolution-gnome-autoar.patch: Fixed upstream. Flip need_autogen
|
||||||
|
to 0 again, no longer needed.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 1 19:01:46 UTC 2016 - zaitor@opensuse.org
|
Thu Sep 1 19:01:46 UTC 2016 - zaitor@opensuse.org
|
||||||
|
|
||||||
|
@ -19,16 +19,15 @@
|
|||||||
# wait for port of gtkimageview to gtk3
|
# wait for port of gtkimageview to gtk3
|
||||||
%define use_gtkimageview 0
|
%define use_gtkimageview 0
|
||||||
|
|
||||||
%define need_autogen 1
|
%define need_autogen 0
|
||||||
|
|
||||||
Name: evolution
|
Name: evolution
|
||||||
# This should be updated upon major version changes; it should match BASE_VERSION as defined in configure.in.
|
# This should be updated upon major version changes; it should match BASE_VERSION as defined in configure.in.
|
||||||
%define evolution_base_version 3.22
|
%define evolution_base_version 3.22
|
||||||
Version: 3.21.91
|
Version: 3.21.92
|
||||||
Release: 0
|
Release: 0
|
||||||
# _version needs to be %{version} stripped to major.minor.micro only...
|
# _version needs to be %{version} stripped to major.minor.micro only...
|
||||||
%define _version %(echo %{version} | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+')
|
%define _version %(echo %{version} | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+')
|
||||||
# FIXME: enable text-highligh once we have a package for it.
|
|
||||||
# FIXME: check if note on license is still valid (comment before license)
|
# FIXME: check if note on license is still valid (comment before license)
|
||||||
Summary: The Integrated GNOME Mail, Calendar, and Address Book Suite
|
Summary: The Integrated GNOME Mail, Calendar, and Address Book Suite
|
||||||
License: LGPL-2.0 and LGPL-3.0
|
License: LGPL-2.0 and LGPL-3.0
|
||||||
@ -36,10 +35,6 @@ Group: Productivity/Networking/Email/Clients
|
|||||||
# NOTE: Some files are currently GPL-2.0 but pending relicensing, see bnc#749859
|
# NOTE: Some files are currently GPL-2.0 but pending relicensing, see bnc#749859
|
||||||
Url: http://wiki.gnome.org/Apps/Evolution/
|
Url: http://wiki.gnome.org/Apps/Evolution/
|
||||||
Source0: http://download.gnome.org/sources/evolution/3.21/%{name}-%{version}.tar.xz
|
Source0: http://download.gnome.org/sources/evolution/3.21/%{name}-%{version}.tar.xz
|
||||||
# PATCH-FIX-UPSTREAM evolution-webkit2gtk3-adaptation.patch zaitor@opensuse.org -- Make evo work with webkit2gtk3 2.13.90
|
|
||||||
Patch0: evolution-webkit2gtk3-adaptation.patch
|
|
||||||
# PATCH-FIX-UPSTREAM evolution-gnome-autoar.patch bgo#770380 zaitor@opensuse.org -- Make configure look for the new name of gnome-autoar
|
|
||||||
Patch1: evolution-gnome-autoar.patch
|
|
||||||
# The icon we rely on is from adwaita-icon-theme
|
# The icon we rely on is from adwaita-icon-theme
|
||||||
BuildRequires: adwaita-icon-theme
|
BuildRequires: adwaita-icon-theme
|
||||||
BuildRequires: bison
|
BuildRequires: bison
|
||||||
@ -168,8 +163,6 @@ to develop applications that require these.
|
|||||||
%lang_package
|
%lang_package
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1
|
|
||||||
%patch1 -p1
|
|
||||||
%if !0%{?is_opensuse}
|
%if !0%{?is_opensuse}
|
||||||
translation-update-upstream
|
translation-update-upstream
|
||||||
%endif
|
%endif
|
||||||
|
Loading…
Reference in New Issue
Block a user