From 3720675bc9a6c8790b0e64a0b330d9550f24d41c Mon Sep 17 00:00:00 2001 From: Huang Peng Date: Mon, 4 Aug 2008 09:15:47 +0800 Subject: [PATCH] Use getlogin to get login user name. --- gtk2/ibusimclient.c | 2 +- qt4/ibus-client.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gtk2/ibusimclient.c b/gtk2/ibusimclient.c index 32fc55e..25b0686 100644 --- a/gtk2/ibusimclient.c +++ b/gtk2/ibusimclient.c @@ -219,7 +219,7 @@ _ibus_im_client_ibus_open (IBusIMClient *client) else { host = id = ""; } - ibus_addr = g_strdup_printf ("unix:path=/tmp/ibus-%s/ibus-%s-%s", g_get_user_name (), host, id); + ibus_addr = g_strdup_printf ("unix:path=/tmp/ibus-%s/ibus-%s-%s", getlogin (), host, id); g_free (display); } diff --git a/qt4/ibus-client.cpp b/qt4/ibus-client.cpp index c765961..43ca50a 100644 --- a/qt4/ibus-client.cpp +++ b/qt4/ibus-client.cpp @@ -339,8 +339,7 @@ IBusClient::connectToBus () session = getenv ("DISPLAY"); session.replace (":", "-"); - address = QString("unix:path=/tmp/ibus-%1/ibus-%2").arg (getenv ("USER"), session); - + address = QString("unix:path=/tmp/ibus-%1/ibus-%2").arg (getlogin(), session); connection = new QDBusConnection ( QDBusConnection::connectToBus ( address, -- 2.7.4