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;
// Check wheter a "/" or ":" is used to separate the
// repo name from the domain.
int SlashPos = RepoRemoteUrl.LastIndexOf ("/");
int ColumnPos = RepoRemoteUrl.LastIndexOf (":");
// Check wheter a "/" or ":" is used to separate the
// repo name from the domain.
string RepoName;
if (SlashPos > ColumnPos)
RepoName = RepoRemoteUrl.Substring (SlashPos + 1);
@ -145,15 +144,20 @@ namespace SparkleShare {
SparkleHelpers.CombineMore (RepoRemoteUrl, RepoName).Substring (2);
SparkleBubble SparkleBubble =
new SparkleBubble (_("Syncing ") + RepoName + "",
new SparkleBubble (_("Syncing folder ") + RepoName + "",
_("SparkleShare will notify you when this is done."));
SparkleBubble.IconName = "folder-sparkleshare";
Hide ();
Process.WaitForExit ();
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
Process.Exited += delegate {
@ -165,7 +169,7 @@ namespace SparkleShare {
);
SparkleBubble =
new SparkleBubble ("Successfully added the folder" +
new SparkleBubble ("Successfully synced the folder" +
" " + RepoName + "",
"Now make great stuff happen!");
@ -177,7 +181,6 @@ namespace SparkleShare {
SparklePaths.SparklePath, RepoName);
Process.Start();
} );
Destroy ();
};

View file

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