From 4671d60635fd4da7bcad87ca46c0181c16d33f36 Mon Sep 17 00:00:00 2001 From: pkanavos Date: Tue, 15 May 2012 17:08:24 +0300 Subject: [PATCH 1/1] Fix incorrect check in Selective Sync that prevented folder changes to propagate to the server, when the parent folder was unselected --- .../FileProperties/ContainerPropertiesViewModel.cs | 4 ++++ .../Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs | 4 ++++ trunk/Pithos.Core/Agents/FileAgent.cs | 7 +++++-- trunk/Pithos.Core/Agents/PollAgent.cs | 4 +++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/trunk/Pithos.Client.WPF/FileProperties/ContainerPropertiesViewModel.cs b/trunk/Pithos.Client.WPF/FileProperties/ContainerPropertiesViewModel.cs index 9eeb56b..8a7ffc5 100644 --- a/trunk/Pithos.Client.WPF/FileProperties/ContainerPropertiesViewModel.cs +++ b/trunk/Pithos.Client.WPF/FileProperties/ContainerPropertiesViewModel.cs @@ -45,6 +45,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.Composition; using System.Diagnostics.Contracts; +using System.IO; using System.Linq; using System.Net; using System.Text; @@ -368,6 +369,9 @@ namespace Pithos.Client.WPF.FileProperties _policies.CollectionChanged += (sender, evt) => { PoliciesChanged = true; }; */ + var name = Path.GetFileName(localFolderName); + DisplayName = String.Format("{0} Container Properties", name); + Shell = shell; ContainerName = localFolderName; container.ContinueWith(t =>{ diff --git a/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs b/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs index a954673..fb75da7 100644 --- a/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs +++ b/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs @@ -352,6 +352,10 @@ namespace Pithos.Client.WPF Shell = shell; LocalFileName = localFileName; + + var name=Path.GetFileName(localFileName); + DisplayName = String.Format("{0} File Properties", name); + pithosFile.ContinueWith(t => { if (t.IsFaulted) diff --git a/trunk/Pithos.Core/Agents/FileAgent.cs b/trunk/Pithos.Core/Agents/FileAgent.cs index 1d068a9..b64773a 100644 --- a/trunk/Pithos.Core/Agents/FileAgent.cs +++ b/trunk/Pithos.Core/Agents/FileAgent.cs @@ -311,9 +311,12 @@ namespace Pithos.Core.Agents return true; if (_ignoreFiles.ContainsKey(filePath.ToLower())) return true; - + + //If selective sync is enabled, propagate folder events + if (Selectives.IsSelectiveEnabled(AccountInfo.AccountKey) && Directory.Exists(filePath)) + return false; //Ignore if selective synchronization is defined, - //And the target file is not below any of the selective paths + //And the target file is not below any of the selective paths return !Selectives.IsSelected(AccountInfo, filePath); } diff --git a/trunk/Pithos.Core/Agents/PollAgent.cs b/trunk/Pithos.Core/Agents/PollAgent.cs index e3ffd9e..a3ff53e 100644 --- a/trunk/Pithos.Core/Agents/PollAgent.cs +++ b/trunk/Pithos.Core/Agents/PollAgent.cs @@ -119,6 +119,7 @@ namespace Pithos.Core.Agents _syncEvent.Set(); } + /// /// Remote files are polled periodically. Any changes are processed /// @@ -130,7 +131,8 @@ namespace Pithos.Core.Agents Log.DebugFormat("Polling changes after [{0}]",since); Debug.Assert(Thread.CurrentThread.IsBackground, "Polling Ended up in the main thread!"); - + + GC.Collect(); using (ThreadContext.Stacks["Retrieve Remote"].Push("All accounts")) { -- 1.7.10.4