4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) version 3.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with the program; if not, see <http://www.gnu.org/licenses/>
20 * SECTION: e-source-webdav
21 * @include: libedataserver/e-source-webdav.h
22 * @short_description: #ESource extension for WebDAV settings
24 * The #ESourceWebdav extension tracks settings for accessing resources
25 * on a remote WebDAV server.
27 * This class exists in libedataserver because we have several
28 * WebDAV-based backends. Each of these backends is free to use
29 * this class directly or subclass it with additional settings.
30 * Subclasses should override the extension name.
32 * The #SoupURI is parsed into components and distributed across
33 * several other built-in extensions such as #ESourceAuthentication
34 * and #ESourceSecurity.
36 * Access the extension as follows:
39 * #include <libedataserver/e-source-webdav.h>
41 * ESourceWebdav *extension;
43 * extension = e_source_get_extension (source, E_SOURCE_EXTENSION_WEBDAV_BACKEND);
47 #include "e-source-webdav.h"
49 #include <libedataserver/e-data-server-util.h>
50 #include <libedataserver/e-source-authentication.h>
51 #include <libedataserver/e-source-security.h>
53 #define E_SOURCE_WEBDAV_GET_PRIVATE(obj) \
54 (G_TYPE_INSTANCE_GET_PRIVATE \
55 ((obj), E_TYPE_SOURCE_WEBDAV, ESourceWebdavPrivate))
57 struct _ESourceWebdavPrivate {
58 GMutex *property_lock;
62 gboolean avoid_ifmatch;
63 gboolean calendar_auto_schedule;
64 gboolean ignore_invalid_cert;
71 PROP_CALENDAR_AUTO_SCHEDULE,
74 PROP_IGNORE_INVALID_CERT,
82 E_TYPE_SOURCE_EXTENSION)
85 source_webdav_host_to_soup_uri (GBinding *binding,
86 const GValue *source_value,
94 host = g_value_get_string (source_value);
96 target = g_binding_get_target (binding);
97 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (target), FALSE);
99 soup_uri = e_source_webdav_dup_soup_uri (E_SOURCE_WEBDAV (target));
100 soup_uri_set_host (soup_uri, host);
101 g_value_take_boxed (target_value, soup_uri);
107 source_webdav_soup_uri_to_host (GBinding *binding,
108 const GValue *source_value,
109 GValue *target_value,
114 soup_uri = g_value_get_boxed (source_value);
115 g_value_set_string (target_value, soup_uri->host);
121 source_webdav_path_to_soup_uri (GBinding *binding,
122 const GValue *source_value,
123 GValue *target_value,
130 path = g_value_get_string (source_value);
132 /* soup_uri_set_path() warns on NULL. */
136 target = g_binding_get_target (binding);
137 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (target), FALSE);
139 soup_uri = e_source_webdav_dup_soup_uri (E_SOURCE_WEBDAV (target));
140 soup_uri_set_path (soup_uri, path);
141 g_value_take_boxed (target_value, soup_uri);
147 source_webdav_soup_uri_to_path (GBinding *binding,
148 const GValue *source_value,
149 GValue *target_value,
154 soup_uri = g_value_get_boxed (source_value);
155 g_value_set_string (target_value, soup_uri->path);
161 source_webdav_port_to_soup_uri (GBinding *binding,
162 const GValue *source_value,
163 GValue *target_value,
170 port = g_value_get_uint (source_value);
172 target = g_binding_get_target (binding);
173 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (target), FALSE);
175 soup_uri = e_source_webdav_dup_soup_uri (E_SOURCE_WEBDAV (target));
176 soup_uri_set_port (soup_uri, port);
177 g_value_take_boxed (target_value, soup_uri);
183 source_webdav_soup_uri_to_port (GBinding *binding,
184 const GValue *source_value,
185 GValue *target_value,
190 soup_uri = g_value_get_boxed (source_value);
191 g_value_set_uint (target_value, soup_uri->port);
197 source_webdav_secure_to_soup_uri (GBinding *binding,
198 const GValue *source_value,
199 GValue *target_value,
206 secure = g_value_get_boolean (source_value);
208 target = g_binding_get_target (binding);
209 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (target), FALSE);
211 soup_uri = e_source_webdav_dup_soup_uri (E_SOURCE_WEBDAV (target));
213 soup_uri_set_scheme (soup_uri, SOUP_URI_SCHEME_HTTPS);
215 soup_uri_set_scheme (soup_uri, SOUP_URI_SCHEME_HTTP);
216 g_value_take_boxed (target_value, soup_uri);
222 source_webdav_soup_uri_to_secure (GBinding *binding,
223 const GValue *source_value,
224 GValue *target_value,
230 soup_uri = g_value_get_boxed (source_value);
231 secure = (soup_uri->scheme == SOUP_URI_SCHEME_HTTPS);
232 g_value_set_boolean (target_value, secure);
238 source_webdav_user_to_soup_uri (GBinding *binding,
239 const GValue *source_value,
240 GValue *target_value,
247 user = g_value_get_string (source_value);
249 target = g_binding_get_target (binding);
250 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (target), FALSE);
252 soup_uri = e_source_webdav_dup_soup_uri (E_SOURCE_WEBDAV (target));
253 soup_uri_set_user (soup_uri, user);
254 g_value_take_boxed (target_value, soup_uri);
260 source_webdav_soup_uri_to_user (GBinding *binding,
261 const GValue *source_value,
262 GValue *target_value,
267 soup_uri = g_value_get_boxed (source_value);
268 g_value_set_string (target_value, soup_uri->user);
274 source_webdav_user_to_method (GBinding *binding,
275 const GValue *source_value,
276 GValue *target_value,
281 user = g_value_get_string (source_value);
282 if (user == NULL || *user == '\0')
283 g_value_set_string (target_value, "none");
285 g_value_set_string (target_value, "plain/password");
291 source_webdav_set_property (GObject *object,
296 switch (property_id) {
297 case PROP_AVOID_IFMATCH:
298 e_source_webdav_set_avoid_ifmatch (
299 E_SOURCE_WEBDAV (object),
300 g_value_get_boolean (value));
303 case PROP_CALENDAR_AUTO_SCHEDULE:
304 e_source_webdav_set_calendar_auto_schedule (
305 E_SOURCE_WEBDAV (object),
306 g_value_get_boolean (value));
309 case PROP_DISPLAY_NAME:
310 e_source_webdav_set_display_name (
311 E_SOURCE_WEBDAV (object),
312 g_value_get_string (value));
315 case PROP_EMAIL_ADDRESS:
316 e_source_webdav_set_email_address (
317 E_SOURCE_WEBDAV (object),
318 g_value_get_string (value));
321 case PROP_IGNORE_INVALID_CERT:
322 e_source_webdav_set_ignore_invalid_cert (
323 E_SOURCE_WEBDAV (object),
324 g_value_get_boolean (value));
327 case PROP_RESOURCE_PATH:
328 e_source_webdav_set_resource_path (
329 E_SOURCE_WEBDAV (object),
330 g_value_get_string (value));
334 e_source_webdav_set_soup_uri (
335 E_SOURCE_WEBDAV (object),
336 g_value_get_boxed (value));
340 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
344 source_webdav_get_property (GObject *object,
349 switch (property_id) {
350 case PROP_AVOID_IFMATCH:
351 g_value_set_boolean (
353 e_source_webdav_get_avoid_ifmatch (
354 E_SOURCE_WEBDAV (object)));
357 case PROP_CALENDAR_AUTO_SCHEDULE:
358 g_value_set_boolean (
360 e_source_webdav_get_calendar_auto_schedule (
361 E_SOURCE_WEBDAV (object)));
364 case PROP_DISPLAY_NAME:
365 g_value_take_string (
367 e_source_webdav_dup_display_name (
368 E_SOURCE_WEBDAV (object)));
371 case PROP_EMAIL_ADDRESS:
372 g_value_take_string (
374 e_source_webdav_dup_email_address (
375 E_SOURCE_WEBDAV (object)));
378 case PROP_IGNORE_INVALID_CERT:
379 g_value_set_boolean (
381 e_source_webdav_get_ignore_invalid_cert (
382 E_SOURCE_WEBDAV (object)));
385 case PROP_RESOURCE_PATH:
386 g_value_take_string (
388 e_source_webdav_dup_resource_path (
389 E_SOURCE_WEBDAV (object)));
395 e_source_webdav_dup_soup_uri (
396 E_SOURCE_WEBDAV (object)));
400 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
404 source_webdav_finalize (GObject *object)
406 ESourceWebdavPrivate *priv;
408 priv = E_SOURCE_WEBDAV_GET_PRIVATE (object);
410 g_mutex_free (priv->property_lock);
412 g_free (priv->display_name);
413 g_free (priv->email_address);
414 g_free (priv->resource_path);
416 soup_uri_free (priv->uri);
418 /* Chain up to parent's finalize() method. */
419 G_OBJECT_CLASS (e_source_webdav_parent_class)->finalize (object);
423 source_webdav_constructed (GObject *object)
426 ESourceExtension *this_extension;
427 ESourceExtension *other_extension;
428 const gchar *extension_name;
430 /* Chain up to parent's constructed() method. */
431 G_OBJECT_CLASS (e_source_webdav_parent_class)->constructed (object);
433 this_extension = E_SOURCE_EXTENSION (object);
434 source = e_source_extension_get_source (this_extension);
436 g_object_bind_property_full (
437 this_extension, "resource-path",
438 this_extension, "soup-uri",
439 G_BINDING_BIDIRECTIONAL |
440 G_BINDING_SYNC_CREATE,
441 source_webdav_path_to_soup_uri,
442 source_webdav_soup_uri_to_path,
443 NULL, (GDestroyNotify) NULL);
445 /* Bind to properties of other extensions for convenience. */
447 extension_name = E_SOURCE_EXTENSION_AUTHENTICATION;
448 other_extension = e_source_get_extension (source, extension_name);
450 g_object_bind_property_full (
451 other_extension, "host",
452 this_extension, "soup-uri",
453 G_BINDING_BIDIRECTIONAL |
454 G_BINDING_SYNC_CREATE,
455 source_webdav_host_to_soup_uri,
456 source_webdav_soup_uri_to_host,
457 NULL, (GDestroyNotify) NULL);
459 g_object_bind_property_full (
460 other_extension, "port",
461 this_extension, "soup-uri",
462 G_BINDING_BIDIRECTIONAL |
463 G_BINDING_SYNC_CREATE,
464 source_webdav_port_to_soup_uri,
465 source_webdav_soup_uri_to_port,
466 NULL, (GDestroyNotify) NULL);
468 g_object_bind_property_full (
469 other_extension, "user",
470 this_extension, "soup-uri",
471 G_BINDING_BIDIRECTIONAL |
472 G_BINDING_SYNC_CREATE,
473 source_webdav_user_to_soup_uri,
474 source_webdav_soup_uri_to_user,
475 NULL, (GDestroyNotify) NULL);
477 g_object_bind_property_full (
478 other_extension, "user",
479 other_extension, "method",
480 G_BINDING_SYNC_CREATE,
481 source_webdav_user_to_method,
483 NULL, (GDestroyNotify) NULL);
485 extension_name = E_SOURCE_EXTENSION_SECURITY;
486 other_extension = e_source_get_extension (source, extension_name);
488 g_object_bind_property_full (
489 other_extension, "secure",
490 this_extension, "soup-uri",
491 G_BINDING_BIDIRECTIONAL |
492 G_BINDING_SYNC_CREATE,
493 source_webdav_secure_to_soup_uri,
494 source_webdav_soup_uri_to_secure,
495 NULL, (GDestroyNotify) NULL);
499 e_source_webdav_class_init (ESourceWebdavClass *class)
501 GObjectClass *object_class;
502 ESourceExtensionClass *extension_class;
504 g_type_class_add_private (class, sizeof (ESourceWebdavPrivate));
506 object_class = G_OBJECT_CLASS (class);
507 object_class->set_property = source_webdav_set_property;
508 object_class->get_property = source_webdav_get_property;
509 object_class->finalize = source_webdav_finalize;
510 object_class->constructed = source_webdav_constructed;
512 extension_class = E_SOURCE_EXTENSION_CLASS (class);
513 extension_class->name = E_SOURCE_EXTENSION_WEBDAV_BACKEND;
515 g_object_class_install_property (
518 g_param_spec_boolean (
521 "Work around a bug in old Apache servers",
525 E_SOURCE_PARAM_SETTING));
527 g_object_class_install_property (
529 PROP_CALENDAR_AUTO_SCHEDULE,
530 g_param_spec_boolean (
531 "calendar-auto-schedule",
532 "Calendar Auto-Schedule",
533 "Whether the server handles meeting "
534 "invitations (CalDAV-only)",
538 E_SOURCE_PARAM_SETTING));
540 g_object_class_install_property (
543 g_param_spec_string (
546 "Display name of the WebDAV resource",
550 E_SOURCE_PARAM_SETTING));
552 g_object_class_install_property (
555 g_param_spec_string (
558 "The user's email address",
562 E_SOURCE_PARAM_SETTING));
564 g_object_class_install_property (
566 PROP_IGNORE_INVALID_CERT,
567 g_param_spec_boolean (
568 "ignore-invalid-cert",
569 "Ignore Invalid Cert",
570 "Ignore invalid SSL certificates",
574 E_SOURCE_PARAM_SETTING));
576 g_object_class_install_property (
579 g_param_spec_string (
582 "Absolute path to a WebDAV resource",
586 E_SOURCE_PARAM_SETTING));
588 g_object_class_install_property (
594 "WebDAV service as a SoupURI",
600 e_source_webdav_init (ESourceWebdav *extension)
602 extension->priv = E_SOURCE_WEBDAV_GET_PRIVATE (extension);
603 extension->priv->property_lock = g_mutex_new ();
605 /* Initialize this enough for SOUP_URI_IS_VALID() to pass. */
606 extension->priv->uri = soup_uri_new (NULL);
607 extension->priv->uri->scheme = SOUP_URI_SCHEME_HTTP;
608 extension->priv->uri->path = g_strdup ("");
612 * e_source_webdav_get_avoid_ifmatch:
613 * @extension: an #ESourceWebdav
615 * This setting works around a
616 * <ulink url="https://issues.apache.org/bugzilla/show_bug.cgi?id=38034">
617 * bug</ulink> in older Apache mod_dav versions.
621 * We may deprecate this once Apache 2.2.8 or newer becomes
622 * sufficiently ubiquitous, or we figure out a way to detect
623 * and work around the bug automatically.
627 * Returns: whether the WebDAV server is known to exhibit the bug
632 e_source_webdav_get_avoid_ifmatch (ESourceWebdav *extension)
634 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), FALSE);
636 return extension->priv->avoid_ifmatch;
640 * e_source_webdav_set_avoid_ifmatch:
641 * @extension: an #ESourceWebdav
642 * @avoid_ifmatch: whether the WebDAV server is known to exhibit the bug
644 * This setting works around a
645 * <ulink url="https://issues.apache.org/bugzilla/show_bug.cgi?id=38034">
646 * bug</ulink> in older Apache mod_dav versions.
650 * We may deprecate this once Apache 2.2.8 or newer becomes
651 * sufficiently ubiquitous, or we figure out a way to detect
652 * and work around the bug automatically.
659 e_source_webdav_set_avoid_ifmatch (ESourceWebdav *extension,
660 gboolean avoid_ifmatch)
662 g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
664 extension->priv->avoid_ifmatch = avoid_ifmatch;
666 g_object_notify (G_OBJECT (extension), "avoid-ifmatch");
670 * e_source_webdav_get_calendar_auto_schedule:
671 * @extension: an #ESourceWebdav
678 e_source_webdav_get_calendar_auto_schedule (ESourceWebdav *extension)
680 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), FALSE);
682 return extension->priv->calendar_auto_schedule;
686 * e_source_webdav_set_calendar_auto_schedule:
687 * @extension: an #ESourceWebdav
688 * @calendar_auto_schedule: whether the server supports the
689 * "calendar-auto-schedule" feature of CalDAV
696 e_source_webdav_set_calendar_auto_schedule (ESourceWebdav *extension,
697 gboolean calendar_auto_schedule)
699 g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
701 extension->priv->calendar_auto_schedule = calendar_auto_schedule;
703 g_object_notify (G_OBJECT (extension), "calendar-auto-schedule");
707 * e_source_webdav_get_display_name:
708 * @extension: an #ESourceWebdav
710 * Returns the last known display name of a WebDAV resource, which may
711 * differ from the #ESource:display-name property of the #ESource to which
712 * @extension belongs.
714 * Returns: the display name of the WebDAV resource
719 e_source_webdav_get_display_name (ESourceWebdav *extension)
721 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
723 return extension->priv->display_name;
727 * e_source_webdav_dup_display_name:
728 * @extension: an #ESourceWebdav
730 * Thread-safe variation of e_source_webdav_get_display_name().
731 * Use this function when accessing @extension from multiple threads.
733 * The returned string should be freed with g_free() when no longer needed.
735 * Returns: a newly-allocated copy of #ESourceWebdav:display-name
740 e_source_webdav_dup_display_name (ESourceWebdav *extension)
742 const gchar *protected;
745 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
747 g_mutex_lock (extension->priv->property_lock);
749 protected = e_source_webdav_get_display_name (extension);
750 duplicate = g_strdup (protected);
752 g_mutex_unlock (extension->priv->property_lock);
758 * e_source_webdav_set_display_name:
759 * @extension: an #ESourceWebdav
760 * @display_name: (allow-none): the display name of the WebDAV resource,
763 * Updates the last known display name of a WebDAV resource, which may
764 * differ from the #ESource:display-name property of the #ESource to which
765 * @extension belongs.
767 * The internal copy of @display_name is automatically stripped of leading
768 * and trailing whitespace. If the resulting string is empty, %NULL is set
774 e_source_webdav_set_display_name (ESourceWebdav *extension,
775 const gchar *display_name)
777 g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
779 g_mutex_lock (extension->priv->property_lock);
781 g_free (extension->priv->display_name);
782 extension->priv->display_name = e_util_strdup_strip (display_name);
784 g_mutex_unlock (extension->priv->property_lock);
786 g_object_notify (G_OBJECT (extension), "display-name");
790 * e_source_webdav_get_email_address:
791 * @extension: an #ESourceWebdav
793 * Returns the user's email address which can be passed to a CalDAV server
794 * if the user wishes to receive scheduling messages.
796 * Returns: the user's email address
801 e_source_webdav_get_email_address (ESourceWebdav *extension)
803 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
805 return extension->priv->email_address;
809 * e_source_webdav_dup_email_address:
810 * @extension: an #ESourceWebdav
812 * Thread-safe variation of e_source_webdav_get_email_address().
813 * Use this function when accessing @extension from multiple threads.
815 * The returned string should be freed with g_free() when no longer needed.
817 * Returns: the newly-allocated copy of #ESourceWebdav:email-address
822 e_source_webdav_dup_email_address (ESourceWebdav *extension)
824 const gchar *protected;
827 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
829 g_mutex_lock (extension->priv->property_lock);
831 protected = e_source_webdav_get_email_address (extension);
832 duplicate = g_strdup (protected);
834 g_mutex_unlock (extension->priv->property_lock);
840 * e_source_webdav_set_email_address:
841 * @extension: an #ESourceWebdav
842 * @email_address: (allow-none): the user's email address, or %NULL
844 * Sets the user's email address which can be passed to a CalDAV server if
845 * the user wishes to receive scheduling messages.
847 * The internal copy of @email_address is automatically stripped of leading
848 * and trailing whitespace. If the resulting string is empty, %NULL is set
854 e_source_webdav_set_email_address (ESourceWebdav *extension,
855 const gchar *email_address)
857 g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
859 g_mutex_lock (extension->priv->property_lock);
861 g_free (extension->priv->email_address);
862 extension->priv->email_address = e_util_strdup_strip (email_address);
864 g_mutex_unlock (extension->priv->property_lock);
866 g_object_notify (G_OBJECT (extension), "email-address");
870 * e_source_webdav_get_ignore_invalid_cert:
871 * @extension: an #ESourceWebdav
873 * Returns %TRUE if invalid SSL certificates should be ignored.
875 * This option allows SSL certificates to be accepted even if they have
876 * signed by an unrecognized Certificate Authority.
878 * Returns: whether invalid SSL certificates should be ignored
883 e_source_webdav_get_ignore_invalid_cert (ESourceWebdav *extension)
885 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), FALSE);
887 return extension->priv->ignore_invalid_cert;
891 * e_source_webdav_set_ignore_invalid_cert:
892 * @extension: an #ESourceWebdav
893 * @ignore_invalid_cert: whether invalid SSL certificates should be ignored
895 * Sets whether invalid SSL certificates should be ignored.
897 * This option allows SSL certificates to be accepted even if they have
898 * signed by an unrecognized Certificate Authority.
903 e_source_webdav_set_ignore_invalid_cert (ESourceWebdav *extension,
904 gboolean ignore_invalid_cert)
906 g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
908 extension->priv->ignore_invalid_cert = ignore_invalid_cert;
910 g_object_notify (G_OBJECT (extension), "ignore-invalid-cert");
914 * e_source_webdav_get_resource_path:
915 * @extension: an #ESourceWebdav
917 * Returns the absolute path to a resource on a WebDAV server.
919 * Returns: the absolute path to a WebDAV resource
924 e_source_webdav_get_resource_path (ESourceWebdav *extension)
926 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
928 return extension->priv->resource_path;
932 * e_source_webdav_dup_resource_path:
933 * @extension: an #ESourceWebdav
935 * Thread-safe variation of e_source_webdav_get_resource_path().
936 * Use this function when accessing @extension from multiple threads.
938 * The returned string should be freed with g_free() when no longer needed.
940 * Returns: the newly-allocated copy of #ESourceWebdav:resource-path
945 e_source_webdav_dup_resource_path (ESourceWebdav *extension)
947 const gchar *protected;
950 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
952 g_mutex_lock (extension->priv->property_lock);
954 protected = e_source_webdav_get_resource_path (extension);
955 duplicate = g_strdup (protected);
957 g_mutex_unlock (extension->priv->property_lock);
963 * e_source_webdav_set_resource_path:
964 * @extension: an #ESourceWebdav
965 * @resource_path: (allow-none): the absolute path to a WebDAV resource,
968 * Sets the absolute path to a resource on a WebDAV server.
970 * The internal copy of @resource_path is automatically stripped of leading
971 * and trailing whitespace. If the resulting string is empty, %NULL is set
977 e_source_webdav_set_resource_path (ESourceWebdav *extension,
978 const gchar *resource_path)
980 g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
982 g_mutex_lock (extension->priv->property_lock);
984 g_free (extension->priv->resource_path);
985 extension->priv->resource_path = e_util_strdup_strip (resource_path);
987 g_mutex_unlock (extension->priv->property_lock);
989 g_object_notify (G_OBJECT (extension), "resource-path");
993 * e_source_webdav_dup_soup_uri:
994 * @extension: an #ESourceWebdav
996 * This is a convenience function which returns a newly-allocated
997 * #SoupURI, its contents assembled from the #ESourceAuthentication
998 * extension, the #ESourceSecurity extension, and @extension itself.
999 * Free the returned #SoupURI with soup_uri_free().
1001 * Returns: (transfer full): a newly-allocated #SoupURI
1006 e_source_webdav_dup_soup_uri (ESourceWebdav *extension)
1010 g_return_val_if_fail (E_IS_SOURCE_WEBDAV (extension), NULL);
1012 g_mutex_lock (extension->priv->property_lock);
1014 duplicate = soup_uri_copy (extension->priv->uri);
1016 g_mutex_unlock (extension->priv->property_lock);
1022 * e_source_webdav_set_soup_uri:
1023 * @extension: an #ESourceWebdav
1026 * This is a convenience function which propagates the components of
1027 * @uri to the #ESourceAuthentication extension, the #ESourceSecurity
1028 * extension, and @extension itself. (The "query" and "fragment"
1029 * components of @uri are ignored.)
1034 e_source_webdav_set_soup_uri (ESourceWebdav *extension,
1037 g_return_if_fail (E_IS_SOURCE_WEBDAV (extension));
1038 g_return_if_fail (SOUP_URI_IS_VALID (uri));
1040 g_mutex_lock (extension->priv->property_lock);
1042 soup_uri_free (extension->priv->uri);
1043 extension->priv->uri = soup_uri_copy (uri);
1045 g_mutex_unlock (extension->priv->property_lock);
1047 g_object_notify (G_OBJECT (extension), "soup-uri");