summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore 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
@@ -479,8 +479,12 @@ QString Addressee::pagerLabel()
{
return i18n("Pager");
}
+QString Addressee::sipLabel()
+{
+ return i18n("SIP");
+}
QString Addressee::emailLabel()
{
return i18n("Email Address");
diff --git a/kabc/addressee.h b/kabc/addressee.h
index 393d1cc..27782f9 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -332,8 +332,13 @@ class Addressee
*/
static QString pagerLabel();
/**
+ Return translated label for sip field.
+ */
+ static QString sipLabel();
+
+ /**
Return translated label for email field.
*/
static QString emailLabel();
diff --git a/kabc/field.cpp b/kabc/field.cpp
index e27970e..d95cd19 100644
--- a/kabc/field.cpp
+++ b/kabc/field.cpp
@@ -83,9 +83,10 @@ class Field::FieldImpl
Role,
Organization,
Note,
Url,
- Resource
+ Resource,
+ Sip
};
int fieldId() { return mFieldId; }
int category() { return mCategory; }
@@ -193,8 +194,10 @@ QString Field::label()
case FieldImpl::Url:
return Addressee::urlLabel();
case FieldImpl::Resource:
return Addressee::resourceLabel();
+ case FieldImpl::Sip:
+ return Addressee::sipLabel();
case FieldImpl::CustomField:
return mImpl->label();
default:
return i18n("Unknown Field");
@@ -289,8 +292,10 @@ QString Field::value( const KABC::Addressee &a )
case FieldImpl::Isdn:
return a.phoneNumber( PhoneNumber::Isdn ).number();
case FieldImpl::Pager:
return a.phoneNumber( PhoneNumber::Pager ).number();
+ case FieldImpl::Sip:
+ return a.phoneNumber( PhoneNumber::Sip ).number();
case FieldImpl::HomeAddressStreet:
return a.address( Address::Home ).street();
case FieldImpl::HomeAddressLocality:
return a.address( Address::Home ).locality();
@@ -417,8 +422,9 @@ Field::List Field::allFields()
createField( FieldImpl::Organization, Organization );
createField( FieldImpl::Note );
createField( FieldImpl::Url );
createField( FieldImpl::Resource );
+ createField( FieldImpl::Sip );
}
return mAllFields;
}
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 4ad608d..7aeb2ee 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -124,9 +124,9 @@ PhoneNumber::TypeList PhoneNumber::typeList()
{
TypeList list;
list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video
- << Bbs << Modem << Car << Isdn << Pcs << Pager;
+ << Bbs << Modem << Car << Isdn << Pcs << Pager << Sip;
return list;
}
@@ -170,8 +170,10 @@ QString PhoneNumber::typeLabel( int type )
else if ((type & Pcs) == Pcs)
typeString += i18n("PCS");
else if ((type & Pager) == Pager)
typeString += i18n("Pager");
+ else if ((type & Sip) == Sip)
+ typeString += i18n("SIP");
// add the prefered flag
if (!typeString.isEmpty())
typeString += " ";
diff --git a/kabc/phonenumber.h b/kabc/phonenumber.h
index 6a9c8cb..1df344f 100644
--- a/kabc/phonenumber.h
+++ b/kabc/phonenumber.h
@@ -63,12 +63,13 @@ class PhoneNumber
@li @p Car - Car phone
@li @p Isdn - ISDN connection
@li @p Pcs - Personal Communication Service
@li @p Pager - Pager
+ @li @p SIP - VoIP
*/
enum Types { Home = 1, Work = 2, Msg = 4, Pref = 8, Voice = 16, Fax = 32,
Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024,
- Isdn = 2048, Pcs = 4096, Pager = 8192 };
+ Isdn = 2048, Pcs = 4096, Pager = 8192, Sip = 16384 };
/**
Create an empty phone number object.
*/
diff --git a/kabc/vcard21parser.cpp b/kabc/vcard21parser.cpp
index b02aac4..277de22 100644
--- a/kabc/vcard21parser.cpp
+++ b/kabc/vcard21parser.cpp
@@ -169,9 +169,10 @@ bool VCardLineX::isValid() const
qualifiers.contains(VCARD_TEL_MODEM) ||
qualifiers.contains(VCARD_TEL_CAR) ||
qualifiers.contains(VCARD_TEL_ISDN) ||
qualifiers.contains(VCARD_TEL_VIDEO) ||
- qualifiers.contains(VCARD_TEL_PCS)
+ qualifiers.contains(VCARD_TEL_PCS) ||
+ qualifiers.contains(VCARD_TEL_SIP)
) )
return true;
if ( name == VCARD_TZ )
return true;
@@ -300,8 +301,10 @@ KABC::Addressee VCard21Parser::readFromString( const QString &data)
if ( (*i).qualifiers.contains( VCARD_TEL_VIDEO ) )
type |= PhoneNumber::Video;
if ( (*i).qualifiers.contains( VCARD_TEL_PCS ) )
type |= PhoneNumber::Pcs;
+ if ( (*i).qualifiers.contains( VCARD_TEL_SIP ) )
+ type |= PhoneNumber::Sip;
}
addressee.insertPhoneNumber( PhoneNumber( (*i).parameters[ 0 ], type ) );
}
}
diff --git a/kabc/vcard21parser.h b/kabc/vcard21parser.h
index 24b0eb2..77e69b6 100644
--- a/kabc/vcard21parser.h
+++ b/kabc/vcard21parser.h
@@ -91,8 +91,9 @@ $Id$
#define VCARD_TEL_CAR "car"
#define VCARD_TEL_ISDN "isdn"
#define VCARD_TEL_VIDEO "video"
#define VCARD_TEL_PCS "pcs"
+#define VCARD_TEL_SIP "sip"
#define VCARD_EMAIL "email"
// types
#define VCARD_EMAIL_PREF "pref"
#define VCARD_EMAIL_INTERNET "internet"
diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp
index bffaa64..2d6eb3d 100644
--- a/kabc/vcardformatimpl.cpp
+++ b/kabc/vcardformatimpl.cpp
@@ -590,8 +590,9 @@ void VCardFormatImpl::addTelephoneValue( VCard *v, const PhoneNumber &p )
if( p.type() & PhoneNumber::Car ) params.append( new Param( "TYPE", "car" ) );
if( p.type() & PhoneNumber::Isdn ) params.append( new Param( "TYPE", "isdn" ) );
if( p.type() & PhoneNumber::Pcs ) params.append( new Param( "TYPE", "pcs" ) );
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 );
v->add(cl);
}
@@ -622,8 +623,9 @@ PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl )
else if ( tmpStr == "car" ) type |= PhoneNumber::Car;
else if ( tmpStr == "isdn" ) type |= PhoneNumber::Isdn;
else if ( tmpStr == "pcs" ) type |= PhoneNumber::Pcs;
else if ( tmpStr == "pager" ) type |= PhoneNumber::Pager;
+ else if ( tmpStr == "sip" ) type |= PhoneNumber::Sip;
}
}
p.setType( type );
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
@@ -56,8 +56,9 @@ VCardTool::VCardTool()
mPhoneTypeMap.insert( "CAR", PhoneNumber::Car );
mPhoneTypeMap.insert( "ISDN", PhoneNumber::Isdn );
mPhoneTypeMap.insert( "PCS", PhoneNumber::Pcs );
mPhoneTypeMap.insert( "PAGER", PhoneNumber::Pager );
+ mPhoneTypeMap.insert( "SIP", PhoneNumber::Sip );
}
VCardTool::~VCardTool()
{