[ekiga] Patch from Michael Rickmann fixing a user full name portability issue



commit f147b0693c08c71c611caffbfb5f1a1084f3cb21
Author: Julien Puydt <jpuydt noether localdomain>
Date:   Sun Apr 19 09:01:47 2009 +0200

    Patch from Michael Rickmann fixing a user full name portability issue
---
 src/gui/assistant.cpp |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/gui/assistant.cpp b/src/gui/assistant.cpp
index 7636386..4243c1c 100644
--- a/src/gui/assistant.cpp
+++ b/src/gui/assistant.cpp
@@ -53,8 +53,6 @@
 #include "audioinput-core.h"
 #include "audiooutput-core.h"
 #include <gdk/gdkkeysyms.h>
-#include <sys/types.h>  // for get user full name
-#include <pwd.h>  // for get user full name
 
 G_DEFINE_TYPE (EkigaAssistant, ekiga_assistant, GTK_TYPE_ASSISTANT);
 
@@ -388,25 +386,14 @@ create_personal_data_page (EkigaAssistant *assistant)
 static void
 prepare_personal_data_page (EkigaAssistant *assistant)
 {
-  gchar *full_name;
+  const gchar *full_name;
 
   full_name = gm_conf_get_string (PERSONAL_DATA_KEY "full_name");
 
-  if (!full_name || strlen (full_name) == 0) {
-    // set full_name if possible
-    struct passwd *pw = getpwuid (getuid ());
-    if (pw) {
-      // sometimes, the full name contains also office, room number etc.
-      // and we need to remove them (take until the first "," char)
-      gchar **entry = g_strsplit (pw->pw_gecos, ",", 2);
-      full_name = g_strdup (entry[0]);
-      g_strfreev (entry);
-    }
-  }
+  if (!full_name || strlen (full_name) == 0)
+    full_name = g_get_real_name ();
 
   gtk_entry_set_text (GTK_ENTRY (assistant->priv->name), full_name);
-
-  g_free (full_name);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]