get the user's real name from the system

This commit is contained in:
Hylke Bons 2010-06-02 00:51:43 +02:00
parent f4bbe80f79
commit 80bbffa205
2 changed files with 6 additions and 3 deletions

View file

@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
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";

View file

@ -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;
}