diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2008-09-06 10:45:52 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-09-06 10:45:52 +0800 |
commit | 133bbf36741ab640cf0984d590671519b5914981 (patch) | |
tree | 770f64df92b6e0b935e9f7d012fb665297c345d8 /client/qt4 | |
parent | d96f994a9dbfee936f3a065b8611ec6d043f7be8 (diff) | |
download | ibus-133bbf36741ab640cf0984d590671519b5914981.tar.gz ibus-133bbf36741ab640cf0984d590671519b5914981.tar.xz ibus-133bbf36741ab640cf0984d590671519b5914981.zip |
Fix sudo problem.
Diffstat (limited to 'client/qt4')
-rw-r--r-- | client/qt4/ibus-client.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/qt4/ibus-client.cpp b/client/qt4/ibus-client.cpp index a56d909..2f75d5a 100644 --- a/client/qt4/ibus-client.cpp +++ b/client/qt4/ibus-client.cpp @@ -46,13 +46,15 @@ IBusClient::IBusClient () { username = getlogin (); if (username.isEmpty ()) + username = getenv ("SUDO_USER"); + if (username.isEmpty ()) + username = getenv ("USERNAME"); + if (username.isEmpty ()) username = getenv ("LOGNAME"); if (username.isEmpty ()) username = getenv ("USER"); if (username.isEmpty ()) username = getenv ("LNAME"); - if (username.isEmpty ()) - username = getenv ("USERNAME"); session = getenv ("DISPLAY"); if (session.indexOf (".") == -1) { |