Don't exclude all dotfiles, Fixes #495

This commit is contained in:
Hylke Bons 2011-12-29 12:44:18 +01:00
parent d6cbff51c2
commit 317c7842a7
3 changed files with 17 additions and 4 deletions

View file

@ -59,6 +59,16 @@ namespace SparkleLib {
} }
public override List<string> ExcludePaths {
get {
List<string> rules = new List<string> ();
rules.Add (Path.DirectorySeparatorChar + ".git");
return rules;
}
}
public override double Size { public override double Size {
get { get {
return CalculateSize ( return CalculateSize (

View file

@ -66,6 +66,7 @@ namespace SparkleLib {
public abstract bool SyncDown (); public abstract bool SyncDown ();
public abstract double CalculateSize (DirectoryInfo parent); public abstract double CalculateSize (DirectoryInfo parent);
public abstract bool HasUnsyncedChanges { get; set; } public abstract bool HasUnsyncedChanges { get; set; }
public abstract List<string> ExcludePaths { get; }
public abstract double Size { get; } public abstract double Size { get; }
public abstract double HistorySize { get; } public abstract double HistorySize { get; }
@ -342,9 +343,12 @@ namespace SparkleLib {
if (!this.watcher.EnableRaisingEvents) if (!this.watcher.EnableRaisingEvents)
return; return;
if (args.FullPath.Contains (Path.DirectorySeparatorChar + ".") && string relative_path = args.FullPath.Replace (LocalPath, "");
!args.FullPath.Contains (Path.DirectorySeparatorChar + ".notes"))
return; foreach (string exclude_path in ExcludePaths) {
if (relative_path.Contains (exclude_path))
return;
}
WatcherChangeTypes wct = args.ChangeType; WatcherChangeTypes wct = args.ChangeType;

View file

@ -51,7 +51,6 @@ namespace SparkleLib {
if (ChangeEvent != null) if (ChangeEvent != null)
ChangeEvent (args); ChangeEvent (args);
}; };
} }
} }
} }