Re: gnome-pim sync w/ monthly recurrences



On Mon, Jun 26, 2000 at 08:00:36PM +0930, Robert Mibus wrote:
> this patch is very small, & fixes the maths problem when syncing a monthly
> recurring event (eg. 3rd tues) from the pilot to gncal.

and now the other way 'round, too.
ive attached two diffs, one if youve applied my last patch, and the other
contains both.

> can someone please commit this to cvs? (or forward it to someone who can?)
and this one too, please.

mibus

-- 
Robert Mibus <mibus@bigpond.com>
It's a bug, Jim, but not as we know it.
--- calendar-conduit.c.patch1	Sat Jul  1 00:03:53 2000
+++ calendar-conduit.c	Sat Jul  1 00:01:41 2000
@@ -1006,10 +1006,12 @@
 			local->a->repeatType = repeatWeekly;
 			break;
 		case RECUR_MONTHLY_BY_POS:
-			local->a->repeatType = repeatMonthlyByDate;
+			local->a->repeatType = repeatMonthlyByDay;
+			local->a->repeatDay = (local->ical->recur->u.month_pos - 1) * 7;
+			local->a->repeatDay += local->ical->recur->weekday;
 			break;
 		case RECUR_MONTHLY_BY_DAY:
-			local->a->repeatType = repeatMonthlyByDay;
+			local->a->repeatType = repeatMonthlyByDate;
 			break;
 		case RECUR_YEARLY_BY_MONTH:
 			local->a->repeatType = repeatYearly;
@@ -1240,13 +1242,13 @@
 				return 1; }
 			break;
 		case RECUR_MONTHLY_BY_POS:
-			if (a.repeatType != repeatMonthlyByDate) {
-				LOG("failed a.repeatType == repeatMonthlyByDate");
+			if (a.repeatType != repeatMonthlyByDay) {
+				LOG("failed a.repeatType == repeatMonthlyByDay");
 				return 1; }
 			break;
 		case RECUR_MONTHLY_BY_DAY:
-			if (a.repeatType != repeatMonthlyByDay) {
-				LOG("failed a.repeatType == repeatMonthlyByDay");
+			if (a.repeatType != repeatMonthlyByDate) {
+				LOG("failed a.repeatType == repeatMonthlyByDate");
 				return 1; }
 			break;
 		case RECUR_YEARLY_BY_MONTH:
--- calendar-conduit.c.orig	Tue Mar 14 18:09:27 2000
+++ calendar-conduit.c	Sat Jul  1 00:01:41 2000
@@ -447,8 +447,8 @@
 		
 		case repeatMonthlyByDay:
 			obj->recur->type = RECUR_MONTHLY_BY_POS;
-			obj->recur->u.month_pos = a.repeatFrequency;
-			obj->recur->weekday = (a.repeatDay / 7);
+			obj->recur->u.month_pos = (a.repeatDay / 7) + 1;
+			obj->recur->weekday = (a.repeatDay % 7);
 			break;
 			
 		case repeatYearly:
@@ -1006,10 +1006,12 @@
 			local->a->repeatType = repeatWeekly;
 			break;
 		case RECUR_MONTHLY_BY_POS:
-			local->a->repeatType = repeatMonthlyByDate;
+			local->a->repeatType = repeatMonthlyByDay;
+			local->a->repeatDay = (local->ical->recur->u.month_pos - 1) * 7;
+			local->a->repeatDay += local->ical->recur->weekday;
 			break;
 		case RECUR_MONTHLY_BY_DAY:
-			local->a->repeatType = repeatMonthlyByDay;
+			local->a->repeatType = repeatMonthlyByDate;
 			break;
 		case RECUR_YEARLY_BY_MONTH:
 			local->a->repeatType = repeatYearly;
@@ -1240,13 +1242,13 @@
 				return 1; }
 			break;
 		case RECUR_MONTHLY_BY_POS:
-			if (a.repeatType != repeatMonthlyByDate) {
-				LOG("failed a.repeatType == repeatMonthlyByDate");
+			if (a.repeatType != repeatMonthlyByDay) {
+				LOG("failed a.repeatType == repeatMonthlyByDay");
 				return 1; }
 			break;
 		case RECUR_MONTHLY_BY_DAY:
-			if (a.repeatType != repeatMonthlyByDay) {
-				LOG("failed a.repeatType == repeatMonthlyByDay");
+			if (a.repeatType != repeatMonthlyByDate) {
+				LOG("failed a.repeatType == repeatMonthlyByDate");
 				return 1; }
 			break;
 		case RECUR_YEARLY_BY_MONTH:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]