Skip to content

Commit

Permalink
Merge branch 'bugfix/issue-1999/misleading-delete' into release
Browse files Browse the repository at this point in the history
Closes #1999
  • Loading branch information
phw198 committed Nov 3, 2024
2 parents 652c275 + 4a757ff commit 3481c81
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/OutlookGoogleCalendarSync/Google/GoogleCalendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1596,14 +1596,6 @@ public void IdentifyEventDifferences(
}
}

if (profile.DisableDelete) {
if (google.Count > 0) {
Forms.Main.Instance.Console.Update(google.Count + " Google items would have been deleted, but you have deletions disabled.", Console.Markup.warning);
for (int g = 0; g < google.Count; g++)
Forms.Main.Instance.Console.Update(GetEventSummary(google[g], out String anonSummary), anonSummary, verbose: true);
}
google = new List<Event>();
}
if (profile.SyncDirection.Id == Sync.Direction.Bidirectional.Id) {
//Don't recreate any items that have been deleted in Google
for (int o = outlook.Count - 1; o >= 0; o--) {
Expand All @@ -1617,6 +1609,14 @@ public void IdentifyEventDifferences(
google.Remove(google[g]);
}
}
if (profile.DisableDelete) {
if (google.Count > 0) {
Forms.Main.Instance.Console.Update(google.Count + " Google items would have been deleted, but you have deletions disabled.", Console.Markup.warning);
for (int g = 0; g < google.Count; g++)
Forms.Main.Instance.Console.Update(GetEventSummary(google[g], out String anonSummary), anonSummary, verbose: true);
}
google = new List<Event>();
}
if (Settings.Instance.CreateCSVFiles) {
ExportToCSV("Events for deletion in Google", "google_delete.csv", google);
Outlook.Calendar.ExportToCSV("Appointments for creation in Google", "google_create.csv", outlook);
Expand Down
16 changes: 8 additions & 8 deletions src/OutlookGoogleCalendarSync/Outlook/OutlookCalendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1612,14 +1612,6 @@ public static void IdentifyEventDifferences(
}
}

if (profile.DisableDelete) {
if (outlook.Count > 0) {
Forms.Main.Instance.Console.Update(outlook.Count + " Outlook items would have been deleted, but you have deletions disabled.", Console.Markup.warning);
for (int o = 0; o < outlook.Count; o++)
Forms.Main.Instance.Console.Update(GetEventSummary(outlook[o], out String anonSummary), anonSummary, verbose: true);
}
outlook = new List<AppointmentItem>();
}
if (profile.SyncDirection.Id == Sync.Direction.Bidirectional.Id) {
//Don't recreate any items that have been deleted in Outlook
for (int g = google.Count - 1; g >= 0; g--) {
Expand All @@ -1633,6 +1625,14 @@ public static void IdentifyEventDifferences(
outlook.Remove(outlook[o]);
}
}
if (profile.DisableDelete) {
if (outlook.Count > 0) {
Forms.Main.Instance.Console.Update(outlook.Count + " Outlook items would have been deleted, but you have deletions disabled.", Console.Markup.warning);
for (int o = 0; o < outlook.Count; o++)
Forms.Main.Instance.Console.Update(GetEventSummary(outlook[o], out String anonSummary), anonSummary, verbose: true);
}
outlook = new List<AppointmentItem>();
}
if (Settings.Instance.CreateCSVFiles) {
ExportToCSV("Appointments for deletion in Outlook", "outlook_delete.csv", outlook);
Ogcs.Google.Calendar.ExportToCSV("Events for creation in Outlook", "outlook_create.csv", google);
Expand Down

0 comments on commit 3481c81

Please sign in to comment.