summaryrefslogtreecommitdiff
authorskyhusker <skyhusker>2005-01-26 22:40:43 (UTC)
committer skyhusker <skyhusker>2005-01-26 22:40:43 (UTC)
commitcbaf2c1c6eb42bc8a283a40fe922603a44c29304 (patch) (unidiff)
treeb17000c5fb5b88a45b3fc7eed88726cac35e0193
parent1752010f14bb7806bae6f83b349c9896a3005c75 (diff)
downloadopie-cbaf2c1c6eb42bc8a283a40fe922603a44c29304.zip
opie-cbaf2c1c6eb42bc8a283a40fe922603a44c29304.tar.gz
opie-cbaf2c1c6eb42bc8a283a40fe922603a44c29304.tar.bz2
Changed default realname, now is fetched from device owner name
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircserver.cpp19
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
6IRCServer::IRCServer() { 11IRCServer::IRCServer() {
7 m_port = 6667; 12 m_port = 6667;
8} 13}
9 14
10/* Setter implementations */ 15/* Setter implementations */
11 16
12void IRCServer::setHostname(QString hostname) { 17void IRCServer::setHostname(QString hostname) {
13 m_hostname = hostname; 18 m_hostname = hostname;
14} 19}
15 20
16void IRCServer::setName(QString name) { 21void IRCServer::setName(QString name) {
17 m_name = name; 22 m_name = name;
18} 23}
19 24
20void IRCServer::setPort(int port) { 25void IRCServer::setPort(int port) {
21 m_port = port; 26 m_port = port;
22} 27}
23 28
24void IRCServer::setUsername(QString username) { 29void IRCServer::setUsername(QString username) {
25 m_username = username; 30 m_username = username;
26} 31}
27 32
28void IRCServer::setPassword(QString password) { 33void IRCServer::setPassword(QString password) {
29 m_password = password; 34 m_password = password;
30} 35}
31 36
32void IRCServer::setNick(QString nick) { 37void IRCServer::setNick(QString nick) {
33 m_nick = nick; 38 m_nick = nick;
34} 39}
35 40
36void IRCServer::setRealname(QString realname) { 41void IRCServer::setRealname(QString realname) {
37 m_realname = realname; 42 m_realname = realname;
38} 43}
39 44
40void IRCServer::setChannels(QString channels) { 45void IRCServer::setChannels(QString channels) {
41 m_channels = channels; 46 m_channels = channels;
42} 47}
43 48
44/* Getter implementations */ 49/* Getter implementations */
45 50
46QString IRCServer::hostname() { 51QString IRCServer::hostname() {
47 return m_hostname; 52 return m_hostname;
48} 53}
49 54
50QString IRCServer::name() { 55QString IRCServer::name() {
51 return m_name; 56 return m_name;
52} 57}
53 58
54unsigned short int IRCServer::port() { 59unsigned 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
61QString IRCServer::username() { 66QString IRCServer::username() {
62 return m_username; 67 return m_username;
63} 68}
64 69
65QString IRCServer::password() { 70QString IRCServer::password() {
66 return m_password; 71 return m_password;
67} 72}
68 73
69QString IRCServer::nick() { 74QString IRCServer::nick() {
70 return m_nick; 75 return m_nick;
71} 76}
72 77
73QString IRCServer::realname() { 78QString 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
80QString IRCServer::channels() { 93QString IRCServer::channels() {
81 return m_channels; 94 return m_channels;
82} 95}
83 96