Fix incorrect check in Selective Sync that prevented folder changes to propagate...
authorpkanavos <pkanavos@gmail.com>
Tue, 15 May 2012 14:08:24 +0000 (17:08 +0300)
committerpkanavos <pkanavos@gmail.com>
Tue, 15 May 2012 14:08:24 +0000 (17:08 +0300)
trunk/Pithos.Client.WPF/FileProperties/ContainerPropertiesViewModel.cs
trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs
trunk/Pithos.Core/Agents/FileAgent.cs
trunk/Pithos.Core/Agents/PollAgent.cs

index 9eeb56b..8a7ffc5 100644 (file)
@@ -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 =>{                
index a954673..fb75da7 100644 (file)
@@ -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)
index 1d068a9..b64773a 100644 (file)
@@ -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);
         }
 
index e3ffd9e..a3ff53e 100644 (file)
@@ -119,6 +119,7 @@ namespace Pithos.Core.Agents
             _syncEvent.Set();\r
         }\r
 \r
+\r
         /// <summary>\r
         /// Remote files are polled periodically. Any changes are processed\r
         /// </summary>\r
@@ -130,7 +131,8 @@ namespace Pithos.Core.Agents
                 Log.DebugFormat("Polling changes after [{0}]",since);\r
 \r
             Debug.Assert(Thread.CurrentThread.IsBackground, "Polling Ended up in the main thread!");\r
-            \r
+\r
+            GC.Collect();\r
 \r
             using (ThreadContext.Stacks["Retrieve Remote"].Push("All accounts"))\r
             {\r