mac watcher: stop some unnecessary triggers from taking place. fixes some double syncs.
This commit is contained in:
parent
3fccef5a6d
commit
c671b5f4ae
|
@ -56,11 +56,10 @@ namespace SparkleShare {
|
|||
base.Initialize ();
|
||||
|
||||
SparkleRepoBase.UseCustomWatcher = true;
|
||||
this.watcher = new SparkleMacWatcher (Program.Controller.FoldersPath);
|
||||
|
||||
this.watcher.Changed += delegate (string path) {
|
||||
FileSystemEventArgs fse_args = new FileSystemEventArgs (WatcherChangeTypes.Changed,
|
||||
Path.Combine (SparkleConfig.DefaultConfig.FoldersPath, path), Path.GetFileName (path));
|
||||
|
||||
FileSystemEventArgs fse_args = new FileSystemEventArgs (WatcherChangeTypes.Changed, path, "Unknown_File");
|
||||
FileActivityTask [] tasks = new FileActivityTask [Repositories.Length];
|
||||
|
||||
// FIXME: There are cases where the wrong repo is triggered, so
|
||||
|
@ -114,8 +113,6 @@ namespace SparkleShare {
|
|||
|
||||
public override bool CreateSparkleShareFolder ()
|
||||
{
|
||||
this.watcher = new SparkleMacWatcher (Program.Controller.FoldersPath);
|
||||
|
||||
if (!Directory.Exists (Program.Controller.FoldersPath)) {
|
||||
Directory.CreateDirectory (Program.Controller.FoldersPath);
|
||||
|
||||
|
|
|
@ -154,7 +154,9 @@ namespace SparkleShare {
|
|||
string path = paths [0];
|
||||
path = path.Substring (Path.Length);
|
||||
path = path.Trim ("/".ToCharArray ());
|
||||
handler (path);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace (path))
|
||||
handler (path);
|
||||
}
|
||||
|
||||
GC.KeepAlive (this);
|
||||
|
|
Loading…
Reference in a new issue