make home dir fetching less platform dependant

This commit is contained in:
Hylke Bons 2010-06-04 20:58:07 +02:00
parent 80bbffa205
commit 6acced712e
3 changed files with 8 additions and 3 deletions

View file

@ -140,6 +140,8 @@ namespace SparkleShare {
Process.StartInfo.RedirectStandardOutput = true;
Process.StartInfo.UseShellExecute = false;
Console.WriteLine ("[Git][" + RepoName + "] Cloning repository...");
// Clone into the system's temporary folder
Process.StartInfo.FileName = "git";
Process.StartInfo.WorkingDirectory = SparklePaths.SparkleTmpPath;
@ -150,7 +152,6 @@ namespace SparkleShare {
Process.Start ();
string Output = Process.StandardOutput.ReadToEnd ();
Console.WriteLine ("[Git][" + RepoName + "] Cloning repository...");
// Move the folder to the SparkleShare folder when done cloning
Process.Exited += delegate {

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using Mono.Unix;
using System;
using System.IO;
@ -23,8 +24,9 @@ namespace SparkleShare {
public static string SparkleTmpPath = "/tmp/sparkleshare";
public static string HomePath =
Environment.GetEnvironmentVariable ("HOME");
private static UnixUserInfo UnixUserInfo =
new UnixUserInfo (UnixEnvironment.UserName);
public static string HomePath = UnixUserInfo.HomeDirectory;
public static string SparklePath = Path.Combine (HomePath ,"SparkleShare");

View file

@ -191,6 +191,7 @@ namespace SparkleShare {
// Stages the made changes
public void Add () {
BufferTimer.Stop ();
FetchTimer.Stop ();
Console.WriteLine ("[Git][" + Name + "] Staging changes...");
Process.StartInfo.Arguments = "add --all";
Process.Start ();
@ -198,6 +199,7 @@ namespace SparkleShare {
Console.WriteLine ("[Git][" + Name + "] Changes staged.");
// SparkleUI.NotificationIcon.SetSyncingState ();
// SparkleUI.NotificationIcon.SetIdleState ();
FetchTimer.Start ();
}
// Commits the made changes