Skip to content

Commit

Permalink
fix #1385
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Aug 1, 2024
1 parent 0e118d6 commit 2b4e042
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/Objects/Source.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
15 changes: 9 additions & 6 deletions core/Services/CalDAV/Providers/Nextcloud.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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");
}

Expand Down
4 changes: 3 additions & 1 deletion src/Widgets/SourceRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2b4e042

Please sign in to comment.