Revision e0f69809
b/trunk/Pithos.Client.WPF/FileProperties/ContainerPropertiesViewModel.cs | ||
---|---|---|
45 | 45 |
using System.Collections.ObjectModel; |
46 | 46 |
using System.ComponentModel.Composition; |
47 | 47 |
using System.Diagnostics.Contracts; |
48 |
using System.IO; |
|
48 | 49 |
using System.Linq; |
49 | 50 |
using System.Net; |
50 | 51 |
using System.Text; |
... | ... | |
368 | 369 |
_policies.CollectionChanged += (sender, evt) => { PoliciesChanged = true; }; |
369 | 370 |
*/ |
370 | 371 |
|
372 |
var name = Path.GetFileName(localFolderName); |
|
373 |
DisplayName = String.Format("{0} Container Properties", name); |
|
374 |
|
|
371 | 375 |
Shell = shell; |
372 | 376 |
ContainerName = localFolderName; |
373 | 377 |
container.ContinueWith(t =>{ |
b/trunk/Pithos.Client.WPF/FileProperties/FilePropertiesViewModel.cs | ||
---|---|---|
352 | 352 |
|
353 | 353 |
Shell = shell; |
354 | 354 |
LocalFileName = localFileName; |
355 |
|
|
356 |
var name=Path.GetFileName(localFileName); |
|
357 |
DisplayName = String.Format("{0} File Properties", name); |
|
358 |
|
|
355 | 359 |
pithosFile.ContinueWith(t => |
356 | 360 |
{ |
357 | 361 |
if (t.IsFaulted) |
b/trunk/Pithos.Core/Agents/FileAgent.cs | ||
---|---|---|
292 | 292 |
|
293 | 293 |
private bool Ignore(string filePath) |
294 | 294 |
{ |
295 |
//Ignore all first-level directories and files (ie at the container folders level) |
|
296 |
if (FoundBelowRoot(filePath, RootPath,1)) |
|
295 |
if (IgnorePaths(filePath)) return true; |
|
296 |
|
|
297 |
|
|
298 |
//If selective sync is enabled, propagate folder events |
|
299 |
if (Selectives.IsSelectiveEnabled(AccountInfo.AccountKey) && Directory.Exists(filePath)) |
|
300 |
return false; |
|
301 |
//Ignore if selective synchronization is defined, |
|
302 |
//And the target file is not below any of the selective paths |
|
303 |
return !Selectives.IsSelected(AccountInfo, filePath); |
|
304 |
} |
|
305 |
|
|
306 |
private bool IgnorePaths(string filePath) |
|
307 |
{ |
|
308 |
//Ignore all first-level directories and files (ie at the container folders level) |
|
309 |
if (FoundBelowRoot(filePath, RootPath, 1)) |
|
297 | 310 |
return true; |
298 | 311 |
|
299 | 312 |
//Ignore first-level items under the "others" folder (ie at the accounts folders level). |
300 | 313 |
var othersPath = Path.Combine(RootPath, FolderConstants.OthersFolder); |
301 |
if (FoundBelowRoot(filePath, othersPath,1)) |
|
314 |
if (FoundBelowRoot(filePath, othersPath, 1))
|
|
302 | 315 |
return true; |
303 | 316 |
|
304 | 317 |
//Ignore second-level (container) folders under the "others" folder (ie at the container folders level). |
305 |
if (FoundBelowRoot(filePath, othersPath,2)) |
|
306 |
return true;
|
|
318 |
if (FoundBelowRoot(filePath, othersPath, 2))
|
|
319 |
return true; |
|
307 | 320 |
|
308 | 321 |
|
309 | 322 |
//Ignore anything happening in the cache path |
... | ... | |
311 | 324 |
return true; |
312 | 325 |
if (_ignoreFiles.ContainsKey(filePath.ToLower())) |
313 | 326 |
return true; |
314 |
|
|
315 |
//Ignore if selective synchronization is defined, |
|
316 |
//And the target file is not below any of the selective paths |
|
317 |
return !Selectives.IsSelected(AccountInfo, filePath); |
|
327 |
return false; |
|
318 | 328 |
} |
319 | 329 |
|
320 | 330 |
/* private static bool FoundInRoot(string filePath, string rootPath) |
... | ... | |
398 | 408 |
{ |
399 | 409 |
var oldFullPath = e.OldFullPath; |
400 | 410 |
var fullPath = e.FullPath; |
401 |
if (Ignore(oldFullPath) || Ignore(fullPath)) |
|
411 |
|
|
412 |
//If the source path is one of the ignored folders, ignore |
|
413 |
if (IgnorePaths(oldFullPath)) |
|
414 |
return; |
|
415 |
|
|
416 |
//Ignore takes into account Selective Sync |
|
417 |
if (Ignore(fullPath)) |
|
402 | 418 |
return; |
403 | 419 |
|
404 | 420 |
_eventIdleBatch.Post(e); |
b/trunk/Pithos.Core/Agents/PollAgent.cs | ||
---|---|---|
119 | 119 |
_syncEvent.Set(); |
120 | 120 |
} |
121 | 121 |
|
122 |
|
|
122 | 123 |
/// <summary> |
123 | 124 |
/// Remote files are polled periodically. Any changes are processed |
124 | 125 |
/// </summary> |
... | ... | |
130 | 131 |
Log.DebugFormat("Polling changes after [{0}]",since); |
131 | 132 |
|
132 | 133 |
Debug.Assert(Thread.CurrentThread.IsBackground, "Polling Ended up in the main thread!"); |
133 |
|
|
134 |
|
|
135 |
GC.Collect(); |
|
134 | 136 |
|
135 | 137 |
using (ThreadContext.Stacks["Retrieve Remote"].Push("All accounts")) |
136 | 138 |
{ |
Also available in: Unified diff