From 93d9c21716b8e3060cddd28979a7bf9e9be9a70e Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 30 Apr 2010 00:51:27 +0100 Subject: [PATCH] fix warning --- src/SparklePony.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/SparklePony.cs b/src/SparklePony.cs index 9689da67..21e5d49a 100644 --- a/src/SparklePony.cs +++ b/src/SparklePony.cs @@ -41,6 +41,8 @@ using System.Text.RegularExpressions; public class SparklePony { + public static SparklePonyUI SparklePonyUI; + public static void Main (string [] args) { // Check if git is installed @@ -74,7 +76,7 @@ public class SparklePony { } Gtk.Application.Init (); - SparklePonyUI SparklePonyUI = new SparklePonyUI (HideUI); + SparklePonyUI = new SparklePonyUI (HideUI); SparklePonyUI.StartMonitoring (); Gtk.Application.Run (); } @@ -434,43 +436,43 @@ public class Repository { foreach (string Line in Regex.Split (Output, "\n")) { if (Line.IndexOf ("new file:") > -1 && !DoneAddCommit) { + DoneAddCommit = true; if (FilesAdded > 1) return "In '" + Name + "', " + UserName + " added '" + Line.Replace ("#\tnew file:", "").Trim () + "' and " + (FilesAdded - 1) + " more."; else return "In '" + Name + "', " + UserName + " added '" + Line.Replace ("#\tnew file:", "").Trim () + "'."; - DoneAddCommit = true; } if (Line.IndexOf ("modified:") > -1 && !DoneEditCommit) { + DoneEditCommit = true; if (FilesEdited > 1) return "In '" + Name + "', " + UserName + " edited '" + Line.Replace ("#\tmodified:", "").Trim () + "' and " + (FilesEdited - 1) + " more."; else return "In '" + Name + "', " + UserName + " edited '" + Line.Replace ("#\tmodified:", "").Trim () + "'."; - DoneEditCommit = true; } if (Line.IndexOf ("renamed:") > -1 && !DoneRenameCommit) { + DoneDeleteCommit = true; if (FilesRenamed > 1) return "In '" + Name + "', " + UserName + " renamed '" + Line.Replace ("#\trenamed:", "").Trim ().Replace (" -> ", "' to '") + "' and " + (FilesDeleted - 1) + " more."; else return "In '" + Name + "', " + UserName + " renamed '" + Line.Replace ("#\trenamed:", "").Trim ().Replace (" -> ", "' to '") + "'."; - DoneDeleteCommit = true; } if (Line.IndexOf ("deleted:") > -1 && !DoneDeleteCommit) { + DoneDeleteCommit = true; if (FilesDeleted > 1) return "In '" + Name + "', " + UserName + " deleted '" + Line.Replace ("#\tdeleted:", "").Trim () + "' and " + (FilesDeleted - 1) + " more."; else return "In '" + Name + "', " + UserName + " deleted '" + Line.Replace ("#\tdeleted:", "").Trim () + "'."; - DoneDeleteCommit = true; } } @@ -643,7 +645,7 @@ public class SparklePonyWindow : Window { Process.StartInfo.FileName = "git"; Process.StartInfo.Arguments = "log --pretty=oneline -20"; - Process.StartInfo.WorkingDirectory = Repositories [0].RepoPath; + Process.StartInfo.WorkingDirectory = Repositories [1].RepoPath; Process.Start(); string Output = Process.StandardOutput.ReadToEnd().Trim ();