diff --git a/core/Objects/Source.vala b/core/Objects/Source.vala index f51003e78..a62ca34fc 100644 --- a/core/Objects/Source.vala +++ b/core/Objects/Source.vala @@ -60,7 +60,7 @@ public class Objects.Source : Objects.BaseObject { } if (source_type == SourceType.CALDAV) { - _subheader_text = _("CalDAV - ") + caldav_data.caldav_type.title (); + _subheader_text = caldav_data.caldav_type.title (); return _subheader_text; } diff --git a/core/Services/CalDAV/Providers/Nextcloud.vala b/core/Services/CalDAV/Providers/Nextcloud.vala index c3d1ba140..117d95ec7 100644 --- a/core/Services/CalDAV/Providers/Nextcloud.vala +++ b/core/Services/CalDAV/Providers/Nextcloud.vala @@ -278,6 +278,9 @@ public class Services.CalDAV.Providers.Nextcloud : Services.CalDAV.Providers.Bas try { var _uri = GLib.Uri.parse (url, GLib.UriFlags.NONE); server_url = "%s://%s".printf (_uri.get_scheme (), _uri.get_host ()); + if (_uri.get_port () > 0) { + server_url = "%s://%s:%d".printf (_uri.get_scheme (), _uri.get_host (), _uri.get_port ()); + } } catch (Error e) { debug (e.message); } @@ -293,21 +296,21 @@ public class Services.CalDAV.Providers.Nextcloud : Services.CalDAV.Providers.Bas if (doc.get_elements_by_tag_name ("d:displayname").length > 0) { source.caldav_data.user_displayname = doc.get_elements_by_tag_name ("d:displayname").get_element (0).text_content; } - + if (doc.get_elements_by_tag_name ("s:email-address").length > 0) { source.caldav_data.user_email = doc.get_elements_by_tag_name ("s:email-address").get_element (0).text_content; } - - if (source.caldav_data.user_email != "") { + + if (source.caldav_data.user_email != null && source.caldav_data.user_email != "") { source.display_name = source.caldav_data.user_email; return; } - - if (source.caldav_data.user_displayname != "") { + + if (source.caldav_data.user_displayname != null && source.caldav_data.user_displayname != "") { source.display_name = source.caldav_data.user_displayname; return; } - + source.display_name = _("Nextcloud"); } diff --git a/src/Widgets/SourceRow.vala b/src/Widgets/SourceRow.vala index 0c6dbb81c..03fb5910b 100644 --- a/src/Widgets/SourceRow.vala +++ b/src/Widgets/SourceRow.vala @@ -39,7 +39,9 @@ public class Widgets.SourceRow : Gtk.ListBoxRow { active = source.is_visible }; - var header_label = new Gtk.Label (source.display_name); + var header_label = new Gtk.Label (source.display_name) { + halign = Gtk.Align.START + }; var subheader_label = new Gtk.Label (source.subheader_text) { halign = Gtk.Align.START,