aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-11-02 21:41:55 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-11-02 21:41:55 +0800
commit0849af1df6b923a534b3982406d690bb344355ab (patch)
treea85e9a409d0da412f7e84b218a0c46f6ad5141df
parent5182ae7cef949001e6aa8b36f1c8fa1694570f98 (diff)
parentbcf8dbb96f31e1b7fcca3a179f64885ca04ff565 (diff)
downloadgsoc2013-evolution-0849af1df6b923a534b3982406d690bb344355ab.tar
gsoc2013-evolution-0849af1df6b923a534b3982406d690bb344355ab.tar.gz
gsoc2013-evolution-0849af1df6b923a534b3982406d690bb344355ab.tar.bz2
gsoc2013-evolution-0849af1df6b923a534b3982406d690bb344355ab.tar.lz
gsoc2013-evolution-0849af1df6b923a534b3982406d690bb344355ab.tar.xz
gsoc2013-evolution-0849af1df6b923a534b3982406d690bb344355ab.tar.zst
gsoc2013-evolution-0849af1df6b923a534b3982406d690bb344355ab.zip
Merge branch 'master' into wip/gsettings
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c43
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c1
-rw-r--r--addressbook/util/eab-book-util.c1
-rw-r--r--mail/em-account-editor.c31
-rw-r--r--plugins/google-account-setup/google-source.c2
5 files changed, 63 insertions, 15 deletions
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index da558352bb..d428f8ed77 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -427,6 +427,8 @@ render_title_block (GString *buffer,
/* Only handle inlined photos for now */
if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) {
g_string_append (buffer, "<img border=\"1\" src=\"internal-contact-photo:\">");
+ } else if (photo && photo->type == E_CONTACT_PHOTO_TYPE_URI && photo->data.uri && *photo->data.uri) {
+ g_string_append_printf (buffer, "<img border=\"1\" src=\"%s\">", photo->data.uri);
}
if (photo)
e_contact_photo_free (photo);
@@ -929,7 +931,22 @@ eab_contact_display_render_compact (EABContactDisplay *display,
* image here. we don't scale the pixbuf
* itself, just insert width/height tags in
* the html */
- gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL);
+ if (photo->type == E_CONTACT_PHOTO_TYPE_INLINED) {
+ gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL);
+ } else if (photo->type == E_CONTACT_PHOTO_TYPE_URI && photo->data.uri &&
+ g_ascii_strncasecmp (photo->data.uri, "file://", 7) == 0) {
+ gchar *filename, *contents = NULL;
+ gsize length;
+
+ filename = g_filename_from_uri (photo->data.uri, NULL, NULL);
+ if (filename) {
+ if (g_file_get_contents (filename, &contents, &length, NULL)) {
+ gdk_pixbuf_loader_write (loader, (const guchar *) contents, length, NULL);
+ g_free (contents);
+ }
+ g_free (filename);
+ }
+ }
gdk_pixbuf_loader_close (loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
if (pixbuf)
@@ -949,13 +966,20 @@ eab_contact_display_render_compact (EABContactDisplay *display,
calced_width *= ((gfloat) MAX_COMPACT_IMAGE_DIMENSION / max_dimension);
calced_height *= ((gfloat) MAX_COMPACT_IMAGE_DIMENSION / max_dimension);
}
+ g_object_unref (pixbuf);
}
- g_object_unref (pixbuf);
- g_string_append_printf (
- buffer,
- "<img width=\"%d\" height=\"%d\" src=\"internal-contact-photo:\">",
- calced_width, calced_height);
+ if (photo->type == E_CONTACT_PHOTO_TYPE_URI && photo->data.uri && *photo->data.uri)
+ g_string_append_printf (
+ buffer,
+ "<img width=\"%d\" height=\"%d\" src=\"%s\">",
+ calced_width, calced_height, photo->data.uri);
+ else
+ g_string_append_printf (
+ buffer,
+ "<img width=\"%d\" height=\"%d\" src=\"internal-contact-photo:\">",
+ calced_width, calced_height);
+
e_contact_photo_free (photo);
}
@@ -1174,9 +1198,10 @@ contact_display_url_requested (GtkHTML *html,
if (photo == NULL)
photo = e_contact_get (contact, E_CONTACT_LOGO);
- gtk_html_stream_write (
- handle, (gchar *) photo->data.inlined.data,
- photo->data.inlined.length);
+ if (photo->type == E_CONTACT_PHOTO_TYPE_INLINED)
+ gtk_html_stream_write (
+ handle, (gchar *) photo->data.inlined.data,
+ photo->data.inlined.length);
gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index eb98676169..befc8836ca 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -495,6 +495,7 @@ do_copy (gpointer data,
contact = data;
book_client = process->destination;
+ e_contact_inline_local_photos (contact, NULL);
process->count++;
eab_merging_book_add_contact (
diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c
index eff5fc1058..30cd2acb96 100644
--- a/addressbook/util/eab-book-util.c
+++ b/addressbook/util/eab-book-util.c
@@ -136,6 +136,7 @@ eab_contact_list_to_string (const GSList *contacts)
EContact *contact = l->data;
gchar *vcard_str;
+ e_contact_inline_local_photos (contact, NULL);
vcard_str = e_vcard_to_string (
E_VCARD (contact), EVC_FORMAT_VCARD_30);
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 70a392a327..036570730c 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -2161,12 +2161,10 @@ emae_setup_service (EMAccountEditor *emae,
EAccount *account;
struct _service_info *info = &emae_service_info[service->type];
CamelURL *url = emae_account_url (emae, info->account_uri_key);
- const gchar *uri;
account = em_account_editor_get_modified_account (emae);
- uri = e_account_get_string (account, info->account_uri_key);
- service->provider = uri ? camel_provider_get (uri, NULL) : NULL;
+ service->provider = url && url->protocol ? camel_provider_get (url->protocol, NULL) : NULL;
/* Extract all widgets we need from the builder file. */
@@ -4071,9 +4069,21 @@ emae_commit (EConfig *ec,
url = camel_url_new (modified_account->source->url, NULL);
if (url != NULL) {
- if (emae->priv->source.settings != NULL)
+ if (emae->priv->source.settings != NULL) {
+ gchar *host = g_strdup (url->host);
+ gchar *path = g_strdup (url->path);
+ gint port = url->port;
+
camel_settings_save_to_url (
emae->priv->source.settings, url);
+
+ camel_url_set_host (url, host);
+ camel_url_set_path (url, path);
+ camel_url_set_port (url, port);
+
+ g_free (host);
+ g_free (path);
+ }
g_free (modified_account->source->url);
modified_account->source->url = camel_url_to_string (url, 0);
camel_url_free (url);
@@ -4081,9 +4091,20 @@ emae_commit (EConfig *ec,
url = camel_url_new (modified_account->transport->url, NULL);
if (url != NULL) {
- if (emae->priv->transport.settings != NULL)
+ if (emae->priv->transport.settings != NULL) {
+ gchar *host = g_strdup (url->host);
+ gchar *path = g_strdup (url->path);
+ gint port = url->port;
+
camel_settings_save_to_url (
emae->priv->transport.settings, url);
+ camel_url_set_host (url, host);
+ camel_url_set_path (url, path);
+ camel_url_set_port (url, port);
+
+ g_free (host);
+ g_free (path);
+ }
g_free (modified_account->transport->url);
modified_account->transport->url = camel_url_to_string (url, 0);
camel_url_free (url);
diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c
index a9785ad844..405d52155e 100644
--- a/plugins/google-account-setup/google-source.c
+++ b/plugins/google-account-setup/google-source.c
@@ -467,6 +467,7 @@ retrieve_list_clicked (GtkButton *button,
authorizer = gdata_client_login_authorizer_new ("evolution-client-0.1.0", GDATA_TYPE_CALENDAR_SERVICE);
service = gdata_calendar_service_new (GDATA_AUTHORIZER (authorizer));
+ update_proxy_settings (GDATA_SERVICE (service), URL_GET_SUBSCRIBED_CALENDARS);
if (!gdata_client_login_authorizer_authenticate (authorizer, user, password, NULL, &error)) {
/* Error! */
claim_error (parent, error->message);
@@ -481,7 +482,6 @@ retrieve_list_clicked (GtkButton *button,
memset (password, 0, strlen (password));
g_free (password);
- update_proxy_settings (GDATA_SERVICE (service), URL_GET_SUBSCRIBED_CALENDARS);
feed = gdata_calendar_service_query_all_calendars (service, NULL, NULL, NULL, NULL, &error);
if (feed) {