author | skyhusker <skyhusker> | 2005-01-26 22:40:43 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-01-26 22:40:43 (UTC) |
commit | cbaf2c1c6eb42bc8a283a40fe922603a44c29304 (patch) (unidiff) | |
tree | b17000c5fb5b88a45b3fc7eed88726cac35e0193 | |
parent | 1752010f14bb7806bae6f83b349c9896a3005c75 (diff) | |
download | opie-cbaf2c1c6eb42bc8a283a40fe922603a44c29304.zip opie-cbaf2c1c6eb42bc8a283a40fe922603a44c29304.tar.gz opie-cbaf2c1c6eb42bc8a283a40fe922603a44c29304.tar.bz2 |
Changed default realname, now is fetched from device owner name
-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,83 +1,96 @@ | |||
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 | } |
9 | 14 | ||
10 | /* Setter implementations */ | 15 | /* Setter implementations */ |
11 | 16 | ||
12 | void IRCServer::setHostname(QString hostname) { | 17 | void IRCServer::setHostname(QString hostname) { |
13 | m_hostname = hostname; | 18 | m_hostname = hostname; |
14 | } | 19 | } |
15 | 20 | ||
16 | void IRCServer::setName(QString name) { | 21 | void IRCServer::setName(QString name) { |
17 | m_name = name; | 22 | m_name = name; |
18 | } | 23 | } |
19 | 24 | ||
20 | void IRCServer::setPort(int port) { | 25 | void IRCServer::setPort(int port) { |
21 | m_port = port; | 26 | m_port = port; |
22 | } | 27 | } |
23 | 28 | ||
24 | void IRCServer::setUsername(QString username) { | 29 | void IRCServer::setUsername(QString username) { |
25 | m_username = username; | 30 | m_username = username; |
26 | } | 31 | } |
27 | 32 | ||
28 | void IRCServer::setPassword(QString password) { | 33 | void IRCServer::setPassword(QString password) { |
29 | m_password = password; | 34 | m_password = password; |
30 | } | 35 | } |
31 | 36 | ||
32 | void IRCServer::setNick(QString nick) { | 37 | void IRCServer::setNick(QString nick) { |
33 | m_nick = nick; | 38 | m_nick = nick; |
34 | } | 39 | } |
35 | 40 | ||
36 | void IRCServer::setRealname(QString realname) { | 41 | void IRCServer::setRealname(QString realname) { |
37 | m_realname = realname; | 42 | m_realname = realname; |
38 | } | 43 | } |
39 | 44 | ||
40 | void IRCServer::setChannels(QString channels) { | 45 | void IRCServer::setChannels(QString channels) { |
41 | m_channels = channels; | 46 | m_channels = channels; |
42 | } | 47 | } |
43 | 48 | ||
44 | /* Getter implementations */ | 49 | /* Getter implementations */ |
45 | 50 | ||
46 | QString IRCServer::hostname() { | 51 | QString IRCServer::hostname() { |
47 | return m_hostname; | 52 | return m_hostname; |
48 | } | 53 | } |
49 | 54 | ||
50 | QString IRCServer::name() { | 55 | QString IRCServer::name() { |
51 | return m_name; | 56 | return m_name; |
52 | } | 57 | } |
53 | 58 | ||
54 | unsigned short int IRCServer::port() { | 59 | unsigned short int IRCServer::port() { |
55 | if(m_port) | 60 | if(m_port) |
56 | return m_port; | 61 | return m_port; |
57 | 62 | ||
58 | return 6667; | 63 | return 6667; |
59 | } | 64 | } |
60 | 65 | ||
61 | QString IRCServer::username() { | 66 | QString IRCServer::username() { |
62 | return m_username; | 67 | return m_username; |
63 | } | 68 | } |
64 | 69 | ||
65 | QString IRCServer::password() { | 70 | QString IRCServer::password() { |
66 | return m_password; | 71 | return m_password; |
67 | } | 72 | } |
68 | 73 | ||
69 | QString IRCServer::nick() { | 74 | QString IRCServer::nick() { |
70 | return m_nick; | 75 | return m_nick; |
71 | } | 76 | } |
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; |
82 | } | 95 | } |
83 | 96 | ||