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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using static Acacia.DebugOptions;
|
||||||
|
|
||||||
namespace Acacia.Features.SharedFolders
|
namespace Acacia.Features.SharedFolders
|
||||||
{
|
{
|
||||||
@ -34,6 +35,19 @@ namespace Acacia.Features.SharedFolders
|
|||||||
:
|
:
|
||||||
Feature, FeatureWithRibbon, FeatureWithContextMenu
|
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()
|
public override void Startup()
|
||||||
{
|
{
|
||||||
RegisterButton(this, "SharedFolders", true, ManageFolders, ZPushBehaviour.Disable);
|
RegisterButton(this, "SharedFolders", true, ManageFolders, ZPushBehaviour.Disable);
|
||||||
|
@ -62,6 +62,8 @@ namespace Acacia.Features.SharedFolders
|
|||||||
// Fetch the shares
|
// Fetch the shares
|
||||||
ICollection<SharedFolder> shares = _api.GetCurrentShares(cancel);
|
ICollection<SharedFolder> shares = _api.GetCurrentShares(cancel);
|
||||||
|
|
||||||
|
if (_feature.Reminders)
|
||||||
|
{
|
||||||
// Make sure reminders are disabled as soon as possible
|
// Make sure reminders are disabled as soon as possible
|
||||||
UpdateReminders(shares);
|
UpdateReminders(shares);
|
||||||
|
|
||||||
@ -71,6 +73,7 @@ namespace Acacia.Features.SharedFolders
|
|||||||
.Where(x => x.IsSynced && x.SyncType.IsAppointment() && x.FlagCalendarReminders)
|
.Where(x => x.IsSynced && x.SyncType.IsAppointment() && x.FlagCalendarReminders)
|
||||||
.Select(x => x.SyncId)
|
.Select(x => x.SyncId)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Commit changes
|
// Commit changes
|
||||||
if (_query != null)
|
if (_query != null)
|
||||||
@ -90,7 +93,9 @@ namespace Acacia.Features.SharedFolders
|
|||||||
|
|
||||||
private void UpdateReminders(ICollection<SharedFolder> shares)
|
private void UpdateReminders(ICollection<SharedFolder> shares)
|
||||||
{
|
{
|
||||||
foreach(SharedFolder share in shares)
|
if (_feature.Reminders)
|
||||||
|
{
|
||||||
|
foreach (SharedFolder share in shares)
|
||||||
{
|
{
|
||||||
Logger.Instance.Debug(this, "UpdateReminders: {0}", share);
|
Logger.Instance.Debug(this, "UpdateReminders: {0}", share);
|
||||||
if (share.IsSynced && share.SyncType.IsAppointment())
|
if (share.IsSynced && share.SyncType.IsAppointment())
|
||||||
@ -99,10 +104,13 @@ namespace Acacia.Features.SharedFolders
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private RemindersQuery OpenQuery()
|
private RemindersQuery OpenQuery()
|
||||||
{
|
{
|
||||||
if (_query == null)
|
if (_query == null)
|
||||||
|
{
|
||||||
|
if (_feature.Reminders)
|
||||||
{
|
{
|
||||||
RemindersQuery query = new RemindersQuery(_feature, _account.Account.Store);
|
RemindersQuery query = new RemindersQuery(_feature, _account.Account.Store);
|
||||||
if (query.Open())
|
if (query.Open())
|
||||||
@ -114,6 +122,7 @@ namespace Acacia.Features.SharedFolders
|
|||||||
query.Dispose();
|
query.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return _query;
|
return _query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user