[Ekiga-devel-list] Revision 7862 breaks Win32



Windows does not know getpwuid, getuid and the associated header file
entries as introduced by 7862. However, glib-2.0 contains the function
g_get_real_name which works for Windows. Eugen, would something like
attached patch work for Linux too?
Regards
Michael

diff -ur ekiga.orig/src/gui/assistant.cpp ekiga/src/gui/assistant.cpp
--- ekiga.orig/src/gui/assistant.cpp	2009-04-18 22:51:34.271766114 +0200
+++ ekiga/src/gui/assistant.cpp	2009-04-18 13:17:50.833171000 +0200
@@ -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 @@
 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]