fix portability issue in OnFileActivity

This commit is contained in:
wimh 2011-06-11 22:35:06 +02:00
parent 5501a448b5
commit b60a21731a
2 changed files with 4 additions and 14 deletions

View file

@ -299,7 +299,7 @@ namespace SparkleLib {
// Starts a timer when something changes // Starts a timer when something changes
public void OnFileActivity (object o, FileSystemEventArgs args) public void OnFileActivity (object o, FileSystemEventArgs args)
{ {
if (args.FullPath.Contains ("/.")) if (args.FullPath.Contains (Path.DirectorySeparatorChar + "."))
return; return;
WatcherChangeTypes wct = args.ChangeType; WatcherChangeTypes wct = args.ChangeType;

View file

@ -46,10 +46,11 @@ namespace SparkleShare {
+ System.Environment.ExpandEnvironmentVariables ("%PATH%"); + System.Environment.ExpandEnvironmentVariables ("%PATH%");
System.Environment.SetEnvironmentVariable ("PATH", newPath); System.Environment.SetEnvironmentVariable ("PATH", newPath);
System.Environment.SetEnvironmentVariable ("PLINK_PROTOCOL", "ssh"); System.Environment.SetEnvironmentVariable ("PLINK_PROTOCOL", "ssh");
System.Environment.SetEnvironmentVariable ("HOME", Environment.ExpandEnvironmentVariables ("%HOMEDRIVE%%HOMEPATH%"));
if (String.IsNullOrEmpty (System.Environment.GetEnvironmentVariable ("HOME")))
System.Environment.SetEnvironmentVariable ("HOME", Environment.ExpandEnvironmentVariables ("%HOMEDRIVE%%HOMEPATH%"));
StartSshAgent (); StartSshAgent ();
AddDefaultKey ();
base.Initialize (); base.Initialize ();
} }
@ -103,17 +104,6 @@ namespace SparkleShare {
process.Start(); process.Start();
} }
public void AddDefaultKey ()
{
/*Process process = new Process ();
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = "ssh-add";
process.StartInfo.Arguments = @"~/.ssh/id_rsa";
process.Start ();
process.WaitForExit ();*/
}
private void StartSshAgent () private void StartSshAgent ()
{ {
if (String.IsNullOrEmpty (System.Environment.GetEnvironmentVariable ("SSH_AUTH_SOCK"))) { if (String.IsNullOrEmpty (System.Environment.GetEnvironmentVariable ("SSH_AUTH_SOCK"))) {