From 80bbffa205a81e5331528311701e232abdb53fa7 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 2 Jun 2010 00:51:43 +0200 Subject: [PATCH] get the user's real name from the system --- SparkleShare/SparkleRepo.cs | 7 +++++-- SparkleShare/SparkleUI.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SparkleShare/SparkleRepo.cs b/SparkleShare/SparkleRepo.cs index eff05f4c..5c9e3997 100644 --- a/SparkleShare/SparkleRepo.cs +++ b/SparkleShare/SparkleRepo.cs @@ -15,6 +15,7 @@ // along with this program. If not, see . using Gtk; +using Mono.Unix; using SparkleShare; using System; using System.Diagnostics; @@ -54,10 +55,12 @@ namespace SparkleShare { // Get user.name, example: "User Name" UserName = "Anonymous"; + UnixUserInfo UnixUserInfo = + new UnixUserInfo (UnixEnvironment.UserName); + UserName = UnixUserInfo.RealName; Process.StartInfo.FileName = "git"; - Process.StartInfo.Arguments = "config --get user.name"; + Process.StartInfo.Arguments = "config user.name " + UserName; Process.Start (); - UserName = Process.StandardOutput.ReadToEnd ().Trim (); // Get user.email, example: "user@github.com" UserEmail = "not.set@git-scm.com"; diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index d3b732da..0589c52d 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -98,7 +98,7 @@ namespace SparkleShare { Process.StartInfo.FileName = "gvfs-set-attribute"; Process.StartInfo.Arguments = Folder + " metadata::emblems [synced]"; - Console.WriteLine (Process.StartInfo.FileName + " " + Process.StartInfo.Arguments); +// Console.WriteLine (Process.StartInfo.FileName + " " + Process.StartInfo.Arguments); Process.Start (); break; }