mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
[KOE-12] Added debug option to disable COM code, which is the one bit that might cause a crash.
This commit is contained in:
parent
7a885acb71
commit
08c771d762
@ -26,6 +26,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Acacia.DebugOptions;
|
||||
|
||||
namespace Acacia.Features.SharedFolders
|
||||
{
|
||||
@ -34,6 +35,19 @@ namespace Acacia.Features.SharedFolders
|
||||
:
|
||||
Feature, FeatureWithRibbon, FeatureWithContextMenu
|
||||
{
|
||||
#region Debug options
|
||||
|
||||
[AcaciaOption("Disables the update of the reminders query. If this is disabled, the reminders flag on " +
|
||||
"shared folders will be ignored.")]
|
||||
public bool Reminders
|
||||
{
|
||||
get { return GetOption(OPTION_REMINDERS); }
|
||||
set { SetOption(OPTION_REMINDERS, value); }
|
||||
}
|
||||
private static readonly BoolOption OPTION_REMINDERS = new BoolOption("Reminders", true);
|
||||
|
||||
#endregion
|
||||
|
||||
public override void Startup()
|
||||
{
|
||||
RegisterButton(this, "SharedFolders", true, ManageFolders, ZPushBehaviour.Disable);
|
||||
|
@ -62,6 +62,8 @@ namespace Acacia.Features.SharedFolders
|
||||
// Fetch the shares
|
||||
ICollection<SharedFolder> shares = _api.GetCurrentShares(cancel);
|
||||
|
||||
if (_feature.Reminders)
|
||||
{
|
||||
// Make sure reminders are disabled as soon as possible
|
||||
UpdateReminders(shares);
|
||||
|
||||
@ -71,6 +73,7 @@ namespace Acacia.Features.SharedFolders
|
||||
.Where(x => x.IsSynced && x.SyncType.IsAppointment() && x.FlagCalendarReminders)
|
||||
.Select(x => x.SyncId)
|
||||
);
|
||||
}
|
||||
|
||||
// Commit changes
|
||||
if (_query != null)
|
||||
@ -89,6 +92,8 @@ namespace Acacia.Features.SharedFolders
|
||||
#region Reminders
|
||||
|
||||
private void UpdateReminders(ICollection<SharedFolder> shares)
|
||||
{
|
||||
if (_feature.Reminders)
|
||||
{
|
||||
foreach (SharedFolder share in shares)
|
||||
{
|
||||
@ -99,10 +104,13 @@ namespace Acacia.Features.SharedFolders
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private RemindersQuery OpenQuery()
|
||||
{
|
||||
if (_query == null)
|
||||
{
|
||||
if (_feature.Reminders)
|
||||
{
|
||||
RemindersQuery query = new RemindersQuery(_feature, _account.Account.Store);
|
||||
if (query.Open())
|
||||
@ -114,6 +122,7 @@ namespace Acacia.Features.SharedFolders
|
||||
query.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
return _query;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user