summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-09-09 18:57:57 (UTC)
committer ulf69 <ulf69>2004-09-09 18:57:57 (UTC)
commit880518b6f1d4b06e3df45224c244d9c62f6fb7a9 (patch) (side-by-side diff)
tree2b0b5a0c7e40481c31f29ff2bd98aa6abb4c6c90
parent72860f2b84ba97de9223238d9fb97edc0804cc68 (diff)
downloadkdepimpi-880518b6f1d4b06e3df45224c244d9c62f6fb7a9.zip
kdepimpi-880518b6f1d4b06e3df45224c244d9c62f6fb7a9.tar.gz
kdepimpi-880518b6f1d4b06e3df45224c244d9c62f6fb7a9.tar.bz2
added sip type to phonnumbers
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/addressee.cpp4
-rw-r--r--kabc/addressee.h5
-rw-r--r--kabc/field.cpp8
-rw-r--r--kabc/phonenumber.cpp4
-rw-r--r--kabc/phonenumber.h3
-rw-r--r--kabc/vcard21parser.cpp5
-rw-r--r--kabc/vcard21parser.h1
-rw-r--r--kabc/vcardformatimpl.cpp2
-rw-r--r--kabc/vcardparser/vcardtool.cpp1
9 files changed, 29 insertions, 4 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index d484073..6b282e2 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -482,2 +482,6 @@ QString Addressee::pagerLabel()
+QString Addressee::sipLabel()
+{
+ return i18n("SIP");
+}
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 393d1cc..27782f9 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -335,2 +335,7 @@ class Addressee
/**
+ Return translated label for sip field.
+ */
+ static QString sipLabel();
+
+ /**
Return translated label for email field.
diff --git a/kabc/field.cpp b/kabc/field.cpp
index e27970e..d95cd19 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -86,3 +86,4 @@ class Field::FieldImpl
Url,
- Resource
+ Resource,
+ Sip
};
@@ -196,2 +197,4 @@ QString Field::label()
return Addressee::resourceLabel();
+ case FieldImpl::Sip:
+ return Addressee::sipLabel();
case FieldImpl::CustomField:
@@ -292,2 +295,4 @@ QString Field::value( const KABC::Addressee &a )
return a.phoneNumber( PhoneNumber::Pager ).number();
+ case FieldImpl::Sip:
+ return a.phoneNumber( PhoneNumber::Sip ).number();
case FieldImpl::HomeAddressStreet:
@@ -420,2 +425,3 @@ Field::List Field::allFields()
createField( FieldImpl::Resource );
+ createField( FieldImpl::Sip );
}
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 4ad608d..7aeb2ee 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -127,3 +127,3 @@ PhoneNumber::TypeList PhoneNumber::typeList()
list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video
- << Bbs << Modem << Car << Isdn << Pcs << Pager;
+ << Bbs << Modem << Car << Isdn << Pcs << Pager << Sip;
@@ -173,2 +173,4 @@ QString PhoneNumber::typeLabel( int type )
typeString += i18n("Pager");
+ else if ((type & Sip) == Sip)
+ typeString += i18n("SIP");
diff --git a/kabc/phonenumber.h b/kabc/phonenumber.h
index 6a9c8cb..1df344f 100644
--- a/kabc/phonenumber.h
+++ b/kabc/phonenumber.h
@@ -66,2 +66,3 @@ class PhoneNumber
@li @p Pager - Pager
+ @li @p SIP - VoIP
*/
@@ -69,3 +70,3 @@ class PhoneNumber
Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024,
- Isdn = 2048, Pcs = 4096, Pager = 8192 };
+ Isdn = 2048, Pcs = 4096, Pager = 8192, Sip = 16384 };
diff --git a/kabc/vcard21parser.cpp b/kabc/vcard21parser.cpp
index b02aac4..277de22 100644
--- a/kabc/vcard21parser.cpp
+++ b/kabc/vcard21parser.cpp
@@ -172,3 +172,4 @@ bool VCardLineX::isValid() const
qualifiers.contains(VCARD_TEL_VIDEO) ||
- qualifiers.contains(VCARD_TEL_PCS)
+ qualifiers.contains(VCARD_TEL_PCS) ||
+ qualifiers.contains(VCARD_TEL_SIP)
) )
@@ -303,2 +304,4 @@ KABC::Addressee VCard21Parser::readFromString( const QString &data)
type |= PhoneNumber::Pcs;
+ if ( (*i).qualifiers.contains( VCARD_TEL_SIP ) )
+ type |= PhoneNumber::Sip;
}
diff --git a/kabc/vcard21parser.h b/kabc/vcard21parser.h
index 24b0eb2..77e69b6 100644
--- a/kabc/vcard21parser.h
+++ b/kabc/vcard21parser.h
@@ -94,2 +94,3 @@ $Id$
#define VCARD_TEL_PCS "pcs"
+#define VCARD_TEL_SIP "sip"
#define VCARD_EMAIL "email"
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index bffaa64..2d6eb3d 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -593,2 +593,3 @@ void VCardFormatImpl::addTelephoneValue( VCard *v, const PhoneNumber &p )
if( p.type() & PhoneNumber::Pager ) params.append( new Param( "TYPE", "pager" ) );
+ if( p.type() & PhoneNumber::Sip ) params.append( new Param( "TYPE", "sip" ) );
cl.setParamList( params );
@@ -625,2 +626,3 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl )
else if ( tmpStr == "pager" ) type |= PhoneNumber::Pager;
+ else if ( tmpStr == "sip" ) type |= PhoneNumber::Sip;
}
diff --git a/kabc/vcardparser/vcardtool.cpp b/kabc/vcardparser/vcardtool.cpp
index 71f29d7..3fb212e 100644
--- a/kabc/vcardparser/vcardtool.cpp
+++ b/kabc/vcardparser/vcardtool.cpp
@@ -59,2 +59,3 @@ VCardTool::VCardTool()
mPhoneTypeMap.insert( "PAGER", PhoneNumber::Pager );
+ mPhoneTypeMap.insert( "SIP", PhoneNumber::Sip );
}