projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c9c1b3
)
Get user name from getpwuid, fixes #546
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Sun, 15 Feb 2009 19:17:29 +0000
(20:17 +0100)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Sun, 15 Feb 2009 19:17:29 +0000
(20:17 +0100)
src/common/identity.cpp
patch
|
blob
|
history
diff --git
a/src/common/identity.cpp
b/src/common/identity.cpp
index
2652098
..
1978ebe
100644
(file)
--- a/
src/common/identity.cpp
+++ b/
src/common/identity.cpp
@@
-88,7
+88,10
@@
QString Identity::defaultNick() {
nick = shortUserName;
#elif defined(Q_OS_UNIX)
nick = shortUserName;
#elif defined(Q_OS_UNIX)
- QString userName = getlogin();
+ QString userName;
+ struct passwd *pwd = getpwuid(getuid());
+ if(pwd)
+ userName = pwd->pw_name;
if(!userName.isEmpty())
nick = userName;
if(!userName.isEmpty())
nick = userName;