From 0402a1d719196c3e6a5250d5c94ca8218aff90e7 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 7 Oct 2010 20:40:23 +0100 Subject: [PATCH] [log] update when pushing has finished and fetch/push on a reconnect --- SparkleLib/SparkleRepo.cs | 9 +++++++-- SparkleShare/SparkleLog.cs | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index fed2dd4b..fd714ec7 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -328,6 +328,13 @@ namespace SparkleLib { // Stop polling when the connection to the irc channel is succesful Listener.Client.OnConnected += delegate { + // Check for changes manually one more time + CheckForRemoteChanges (); + + // Push changes that were made since the last disconnect + if (_HasUnsyncedChanges) + Push (); + SparkleHelpers.DebugInfo ("Irc", "[" + Name + "] Connected. Now listening..."); RemoteTimer.Stop (); @@ -398,8 +405,6 @@ namespace SparkleLib { LocalTimer.Start (); - CheckForRemoteChanges (); - // Add everything that changed // since SparkleShare was stopped AddCommitAndPush (); diff --git a/SparkleShare/SparkleLog.cs b/SparkleShare/SparkleLog.cs index 9d257fcc..c005dcf9 100644 --- a/SparkleShare/SparkleLog.cs +++ b/SparkleShare/SparkleLog.cs @@ -149,7 +149,7 @@ namespace SparkleShare { // Remove the eventhooks repo.NewCommit -= UpdateEventLog; - repo.PushingStarted -= UpdateEventLog; + repo.PushingFinished -= UpdateEventLog; } @@ -192,7 +192,7 @@ namespace SparkleShare { repo.NewCommit += UpdateEventLog; // Update the log when changes are being sent - repo.PushingStarted += UpdateEventLog; + repo.PushingFinished += UpdateEventLog; break;