projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e5ced7
)
Use GECOS field for real name on Unix, fixes #517
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Wed, 11 Feb 2009 21:15:33 +0000
(22:15 +0100)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Wed, 11 Feb 2009 21:23:04 +0000
(22:23 +0100)
src/common/identity.cpp
patch
|
blob
|
history
diff --git
a/src/common/identity.cpp
b/src/common/identity.cpp
index
b8afedf
..
9359264
100644
(file)
--- a/
src/common/identity.cpp
+++ b/
src/common/identity.cpp
@@
-115,8
+115,20
@@
QString Identity::defaultNick() {
QString Identity::defaultRealName() {
QString generalDefault = tr("Quassel IRC User");
+
#ifdef Q_OS_MAC
return CFStringToQString(CSCopyUserName(false));
+
+#elif defined(Q_OS_UNIX)
+ QString realName;
+ struct passwd *pwd = getpwuid(getuid());
+ if(pwd)
+ realName = pwd->pw_gecos;
+ if(!realName.isEmpty())
+ return realName;
+ else
+ return generalDefault;
+
#elif defined(Q_OS_WIN32)
TCHAR infoBuf[128];
DWORD bufCharCount = 128;