-rw-r--r-- | noncore/net/opieirc/ircserver.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/noncore/net/opieirc/ircserver.cpp b/noncore/net/opieirc/ircserver.cpp index 7e7e412..abb770b 100644 --- a/noncore/net/opieirc/ircserver.cpp +++ b/noncore/net/opieirc/ircserver.cpp | |||
@@ -1,8 +1,13 @@ | |||
1 | #include <qpe/global.h> | ||
2 | #include <qpe/contact.h> | ||
3 | |||
4 | #include <qobject.h> | ||
5 | #include <qfile.h> | ||
6 | |||
1 | #include "ircserver.h" | 7 | #include "ircserver.h" |
2 | #include "ircversion.h" | 8 | #include "ircversion.h" |
3 | 9 | ||
4 | #include <qobject.h> | ||
5 | 10 | ||
6 | IRCServer::IRCServer() { | 11 | IRCServer::IRCServer() { |
7 | m_port = 6667; | 12 | m_port = 6667; |
8 | } | 13 | } |
@@ -72,10 +77,18 @@ QString IRCServer::nick() { | |||
72 | 77 | ||
73 | QString IRCServer::realname() { | 78 | QString IRCServer::realname() { |
74 | if(!m_realname.isEmpty()) | 79 | if(!m_realname.isEmpty()) |
75 | return m_realname; | 80 | return m_realname; |
76 | 81 | // Try to fetch realname from addressbook | |
77 | return QString(QObject::tr("Using")) + " " + QString(APP_VERSION); | 82 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); |
83 | if ( QFile::exists( file ) ) { | ||
84 | Contact cont = Contact::readVCard( file )[0]; | ||
85 | QString realName = cont.fullName(); | ||
86 | if(!realName.isEmpty()) | ||
87 | return realName; | ||
88 | } | ||
89 | |||
90 | return QString(APP_VERSION + QObject::tr(" User")); | ||
78 | } | 91 | } |
79 | 92 | ||
80 | QString IRCServer::channels() { | 93 | QString IRCServer::channels() { |
81 | return m_channels; | 94 | return m_channels; |