While we're at it, fix typos like prefered occurences in variable names.
authorwwp <wwp@free.fr>
Sat, 22 Oct 2016 12:56:58 +0000 (14:56 +0200)
committerwwp <wwp@free.fr>
Sat, 22 Oct 2016 12:56:58 +0000 (14:56 +0200)
src/plugins/vcalendar/vcal_folder.c
src/plugins/vcalendar/vcal_manager.c
src/plugins/vcalendar/vcal_manager.h
src/plugins/vcalendar/vcalendar.c
src/textview.c

index 633830a..6ed463d 100644 (file)
@@ -746,7 +746,7 @@ GSList *vcal_get_events_list(FolderItem *item)
                event = vcal_manager_load_event(d);
                if (!event)
                        continue;
-               if (event->rec_occurence) {
+               if (event->rec_occurrence) {
                        vcal_manager_free_event(event);
                        claws_unlink(d);
                        continue;
@@ -804,7 +804,7 @@ GSList *vcal_get_events_list(FolderItem *item)
                                                                event->sequence, event->type);
                                        g_free(uid);
                                        vcal_manager_copy_attendees(event, nevent);
-                                       nevent->rec_occurence = TRUE;
+                                       nevent->rec_occurrence = TRUE;
                                        vcal_manager_save_event(nevent, FALSE);
                                        account = vcal_manager_get_account_from_event(event);
                                        status =
@@ -863,7 +863,7 @@ static gint vcal_get_num_list(Folder *folder, FolderItem *item,
                        continue;
                g_hash_table_insert(hash_uids, GINT_TO_POINTER(n_msg), g_strdup(event->uid));
                
-               if (event->rec_occurence) {
+               if (event->rec_occurrence) {
                        vcal_manager_free_event(event);
                        continue;
                }
index f800eeb..6732fd5 100644 (file)
@@ -822,7 +822,7 @@ VCalEvent * vcal_manager_new_event  (const gchar    *uid,
        event->method           = method;
        event->sequence         = sequence;
        event->type             = type;
-       event->rec_occurence            = FALSE;
+       event->rec_occurrence           = FALSE;
        while (strchr(event->summary, '\n'))
                *(strchr(event->summary, '\n')) = ' ';
 
@@ -938,8 +938,8 @@ void vcal_manager_save_event (VCalEvent *event, gboolean export_after)
        xml_tag_add_attr(tag, xml_attr_new("postponed", tmp));
        g_free(tmp);
        
-       tmp = g_strdup_printf("%d", event->rec_occurence);
-       xml_tag_add_attr(tag, xml_attr_new("rec_occurence", tmp));
+       tmp = g_strdup_printf("%d", event->rec_occurrence);
+       xml_tag_add_attr(tag, xml_attr_new("rec_occurrence", tmp));
        g_free(tmp);
        
        xmlnode = xml_node_new(tag, NULL);
@@ -1004,7 +1004,7 @@ static VCalEvent *event_get_from_xml (const gchar *uid, GNode *node)
        VCalEvent *event = NULL;
        enum icalproperty_method method = ICAL_METHOD_REQUEST;
        enum icalcomponent_kind type = ICAL_VEVENT_COMPONENT;
-       gint sequence = 0, rec_occurence = 0;
+       gint sequence = 0, rec_occurrence = 0;
        time_t postponed = (time_t)0;
        
        g_return_val_if_fail(node->data != NULL, NULL);
@@ -1048,8 +1048,8 @@ static VCalEvent *event_get_from_xml (const gchar *uid, GNode *node)
                        sequence = atoi(attr->value);
                if (!strcmp(attr->name, "postponed"))
                        postponed = atoi(attr->value);
-               if (!strcmp(attr->name, "rec_occurence"))
-                       rec_occurence = atoi(attr->value);
+               if (!strcmp(attr->name, "rec_occurrence"))
+                       rec_occurrence = atoi(attr->value);
        }
 
        event = vcal_manager_new_event(uid, org, orgname, location, summary, description, 
@@ -1057,7 +1057,7 @@ static VCalEvent *event_get_from_xml (const gchar *uid, GNode *node)
                                        sequence, type);
 
        event->postponed = postponed;
-       event->rec_occurence = rec_occurence;
+       event->rec_occurrence = rec_occurrence;
 
        g_free(org); 
        g_free(orgname); 
index 9a4b43f..92b9fac 100644 (file)
@@ -53,7 +53,7 @@ struct _VCalEvent
        gchar *url;
        enum icalcomponent_kind type;
        time_t postponed;
-       gboolean rec_occurence;
+       gboolean rec_occurrence;
 };
 
 typedef struct _Answer Answer;
index 576da83..7678ca4 100644 (file)
@@ -367,7 +367,7 @@ static void vcalviewer_answer_set_choices(VCalViewer *vcalviewer, VCalEvent *eve
        
        vcalviewer_show_unavailable(vcalviewer, FALSE);
 
-       if (method == ICAL_METHOD_REQUEST && event && !event->rec_occurence) {
+       if (method == ICAL_METHOD_REQUEST && event && !event->rec_occurrence) {
                PrefsAccount *account = vcal_manager_get_account_from_event(event);
                
                if (!account)
@@ -558,7 +558,7 @@ void vcalviewer_display_event (VCalViewer *vcalviewer, VCalEvent *event)
                        GTK_LABEL_SET_TEXT_TRIMMED(GTK_LABEL(vcalviewer->start), tmp);
                        gtk_label_set_use_markup(GTK_LABEL(vcalviewer->start), TRUE);
                        g_free(tmp);
-               } else if (event->rec_occurence) {
+               } else if (event->rec_occurrence) {
                        gchar *tmp = g_strdup_printf(g_strconcat("%s <span weight=\"bold\">",
                                                        _("(this event is part of a recurring event)"),
                                                        "</span>", NULL),
index b4c74c7..c35dbf9 100644 (file)
@@ -846,40 +846,40 @@ static void recursive_add_parts(TextView *textview, GNode *node)
                 return;
         }
         if (g_ascii_strcasecmp(mimeinfo->subtype, "alternative") == 0) {
-                GNode * prefered_body;
-                int prefered_score;
-                
+                GNode * preferred_body;
+                int preferred_score;
+
                 /*
                   text/plain : score 3
                   text/ *    : score 2
                   other      : score 1
                 */
-                prefered_body = NULL;
-                prefered_score = 0;
-                
+                preferred_body = NULL;
+                preferred_score = 0;
+
                 for (iter = g_node_first_child(node) ; iter != NULL ;
                      iter = g_node_next_sibling(iter)) {
                         int score;
                         MimeInfo * submime;
-                        
+
                         score = 1;
                         submime = (MimeInfo *) iter->data;
                         if (submime->type == MIMETYPE_TEXT)
                                 score = 2;
-                        
                         if (submime->subtype != NULL) {
                                 if (g_ascii_strcasecmp(submime->subtype, "plain") == 0)
                                         score = 3;
                         }
-                        
-                        if (score > prefered_score) {
-                                prefered_score = score;
-                                prefered_body = iter;
+
+                        if (score > preferred_score) {
+                                preferred_score = score;
+                                preferred_body = iter;
                         }
                 }
-                
-                if (prefered_body != NULL) {
-                        recursive_add_parts(textview, prefered_body);
+
+                if (preferred_body != NULL) {
+                        recursive_add_parts(textview, preferred_body);
                 }
         }
         else {