code cleanup

This commit is contained in:
Hylke Bons 2010-05-27 11:14:56 +02:00
parent c0450a5112
commit 33331fe998
2 changed files with 24 additions and 18 deletions

View file

@ -121,12 +121,11 @@ namespace SparkleShare {
string RepoRemoteUrl = RemoteUrlCombo.Entry.Text; string RepoRemoteUrl = RemoteUrlCombo.Entry.Text;
// Check wheter a "/" or ":" is used to separate the
// repo name from the domain.
int SlashPos = RepoRemoteUrl.LastIndexOf ("/"); int SlashPos = RepoRemoteUrl.LastIndexOf ("/");
int ColumnPos = RepoRemoteUrl.LastIndexOf (":"); int ColumnPos = RepoRemoteUrl.LastIndexOf (":");
// Check wheter a "/" or ":" is used to separate the
// repo name from the domain.
string RepoName; string RepoName;
if (SlashPos > ColumnPos) if (SlashPos > ColumnPos)
RepoName = RepoRemoteUrl.Substring (SlashPos + 1); RepoName = RepoRemoteUrl.Substring (SlashPos + 1);
@ -145,15 +144,20 @@ namespace SparkleShare {
SparkleHelpers.CombineMore (RepoRemoteUrl, RepoName).Substring (2); SparkleHelpers.CombineMore (RepoRemoteUrl, RepoName).Substring (2);
SparkleBubble SparkleBubble = SparkleBubble SparkleBubble =
new SparkleBubble (_("Syncing ") + RepoName + "", new SparkleBubble (_("Syncing folder ") + RepoName + "",
_("SparkleShare will notify you when this is done.")); _("SparkleShare will notify you when this is done."));
SparkleBubble.IconName = "folder-sparkleshare"; SparkleBubble.IconName = "folder-sparkleshare";
Hide (); Hide ();
Process.WaitForExit ();
Process.Start (); Process.Start ();
string Output = Process.StandardOutput.ReadToEnd ();
if (Output.Contains ("fatal")) {
Console.WriteLine ("SOMETHING WENT WRONG!!!");
}
// Move the folder to the SparkleShare folder when done cloning // Move the folder to the SparkleShare folder when done cloning
Process.Exited += delegate { Process.Exited += delegate {
@ -165,7 +169,7 @@ namespace SparkleShare {
); );
SparkleBubble = SparkleBubble =
new SparkleBubble ("Successfully added the folder" + new SparkleBubble ("Successfully synced the folder" +
" " + RepoName + "", " " + RepoName + "",
"Now make great stuff happen!"); "Now make great stuff happen!");
@ -177,7 +181,6 @@ namespace SparkleShare {
SparklePaths.SparklePath, RepoName); SparklePaths.SparklePath, RepoName);
Process.Start(); Process.Start();
} ); } );
Destroy (); Destroy ();
}; };

View file

@ -297,17 +297,20 @@ namespace SparkleShare {
// Get the last committer e-mail // Get the last committer e-mail
Process.StartInfo.Arguments = "log --format=\"%ae\" -1"; Process.StartInfo.Arguments = "log --format=\"%ae\" -1";
Process.Start(); Process.Start();
string LastCommitEmail = Process.StandardOutput.ReadToEnd().Trim (); string LastCommitEmail =
Process.StandardOutput.ReadToEnd ().Trim ();
// Get the last commit message // Get the last commit message
Process.StartInfo.Arguments = "log --format=\"%s\" -1"; Process.StartInfo.Arguments = "log --format=\"%s\" -1";
Process.Start(); Process.Start();
string LastCommitMessage = Process.StandardOutput.ReadToEnd().Trim (); string LastCommitMessage =
Process.StandardOutput.ReadToEnd ().Trim ();
// Get the last commiter // Get the last commiter
Process.StartInfo.Arguments = "log --format=\"%an\" -1"; Process.StartInfo.Arguments = "log --format=\"%an\" -1";
Process.Start(); Process.Start();
string LastCommitUserName = Process.StandardOutput.ReadToEnd().Trim (); string LastCommitUserName =
Process.StandardOutput.ReadToEnd ().Trim ();
string NotifySettingFile = string NotifySettingFile =
SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath, SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath,