summaryrefslogtreecommitdiffabout
path: root/kabc/vcardparser/vcardtool.cpp
Side-by-side diff
Diffstat (limited to 'kabc/vcardparser/vcardtool.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/vcardparser/vcardtool.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/kabc/vcardparser/vcardtool.cpp b/kabc/vcardparser/vcardtool.cpp
index 0cf72c0..c3d92b6 100644
--- a/kabc/vcardparser/vcardtool.cpp
+++ b/kabc/vcardparser/vcardtool.cpp
@@ -368,5 +368,5 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
if ( identifier == "adr" ) {
Address address;
- const QStringList addrParts = splitString( semicolonSep, (*lineIt).value().asString() );
+ const QStringList addrParts = splitString( semicolonSep, (*lineIt).valueString() );
if ( addrParts.count() > 0 )
address.setPostOfficeBox( addrParts[ 0 ] );
@@ -400,9 +400,9 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
// BDAY
else if ( identifier == "bday" )
- addr.setBirthday( parseDateTime( (*lineIt).value().asString() ) );
+ addr.setBirthday( parseDateTime( (*lineIt).valueString() ) );
// CATEGORIES
else if ( identifier == "categories" ) {
- const QStringList categories = splitString( commaSep, (*lineIt).value().asString() );
+ const QStringList categories = splitString( commaSep, (*lineIt).valueString() );
addr.setCategories( categories );
}
@@ -415,10 +415,10 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
else if ( identifier == "email" ) {
const QStringList types = (*lineIt).parameters( "type" );
- addr.insertEmail( (*lineIt).value().asString(), types.findIndex( "PREF" ) != -1 );
+ addr.insertEmail( (*lineIt).valueString(), types.findIndex( "PREF" ) != -1 );
}
// FN
else if ( identifier == "fn" )
- addr.setFormattedName( (*lineIt).value().asString() );
+ addr.setFormattedName( (*lineIt).valueString() );
// GEO
@@ -426,5 +426,5 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
Geo geo;
- const QStringList geoParts = QStringList::split( ';', (*lineIt).value().asString(), true );
+ const QStringList geoParts = QStringList::split( ';', (*lineIt).valueString(), true );
geo.setLatitude( geoParts[ 0 ].toFloat() );
geo.setLongitude( geoParts[ 1 ].toFloat() );
@@ -450,5 +450,5 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
for ( it = addressList.begin(); it != addressList.end(); ++it ) {
if ( (*it).type() == type ) {
- (*it).setLabel( (*lineIt).value().asString() );
+ (*it).setLabel( (*lineIt).valueString() );
addr.insertAddress( *it );
available = true;
@@ -459,5 +459,5 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
if ( !available ) { // a standalone LABEL tag
KABC::Address address( type );
- address.setLabel( (*lineIt).value().asString() );
+ address.setLabel( (*lineIt).valueString() );
addr.insertAddress( address );
}
@@ -470,9 +470,9 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
// MAILER
else if ( identifier == "mailer" )
- addr.setMailer( (*lineIt).value().asString() );
+ addr.setMailer( (*lineIt).valueString() );
// N
else if ( identifier == "n" ) {
- const QStringList nameParts = splitString( semicolonSep, (*lineIt).value().asString() );
+ const QStringList nameParts = splitString( semicolonSep, (*lineIt).valueString() );
if ( nameParts.count() > 0 )
addr.setFamilyName( nameParts[ 0 ] );
@@ -489,17 +489,17 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
// NAME
else if ( identifier == "name" )
- addr.setName( (*lineIt).value().asString() );
+ addr.setName( (*lineIt).valueString() );
// NICKNAME
else if ( identifier == "nickname" )
- addr.setNickName( (*lineIt).value().asString() );
+ addr.setNickName( (*lineIt).valueString() );
// NOTE
else if ( identifier == "note" )
- addr.setNote( (*lineIt).value().asString() );
+ addr.setNote( (*lineIt).valueString() );
// ORGANIZATION
else if ( identifier == "org" )
- addr.setOrganization( (*lineIt).value().asString() );
+ addr.setOrganization( (*lineIt).valueString() );
// PHOTO
@@ -509,17 +509,17 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
// PROID
else if ( identifier == "prodid" )
- addr.setProductId( (*lineIt).value().asString() );
+ addr.setProductId( (*lineIt).valueString() );
// REV
else if ( identifier == "rev" )
- addr.setRevision( parseDateTime( (*lineIt).value().asString() ) );
+ addr.setRevision( parseDateTime( (*lineIt).valueString() ) );
// ROLE
else if ( identifier == "role" )
- addr.setRole( (*lineIt).value().asString() );
+ addr.setRole( (*lineIt).valueString() );
// SORT-STRING
else if ( identifier == "sort-string" )
- addr.setSortString( (*lineIt).value().asString() );
+ addr.setSortString( (*lineIt).valueString() );
// SOUND
@@ -530,5 +530,5 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
else if ( identifier == "tel" ) {
PhoneNumber phone;
- phone.setNumber( (*lineIt).value().asString() );
+ phone.setNumber( (*lineIt).valueString() );
int type = 0;
@@ -545,10 +545,10 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
// TITLE
else if ( identifier == "title" )
- addr.setTitle( (*lineIt).value().asString() );
+ addr.setTitle( (*lineIt).valueString() );
// TZ
else if ( identifier == "tz" ) {
TimeZone tz;
- const QString date = (*lineIt).value().asString();
+ const QString date = (*lineIt).valueString();
int hours = date.mid( 1, 2).toInt();
@@ -563,9 +563,9 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
// UID
else if ( identifier == "uid" )
- addr.setUid( (*lineIt).value().asString() );
+ addr.setUid( (*lineIt).valueString() );
// URL
else if ( identifier == "url" )
- addr.setUrl( KURL( (*lineIt).value().asString() ) );
+ addr.setUrl( KURL( (*lineIt).valueString() ) );
// X-
@@ -573,5 +573,5 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
const QString key = (*lineIt).identifier().mid( 2 );
int dash = key.find( "-" );
- addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).value().asString() );
+ addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).valueString() );
}
}
@@ -637,5 +637,5 @@ Picture VCardTool::parsePicture( const VCardLine &line )
} else if ( params.findIndex( "value" ) != -1 ) {
if ( line.parameter( "value" ).lower() == "uri" )
- pic.setUrl( line.value().asString() );
+ pic.setUrl( line.valueString() );
}
@@ -656,5 +656,5 @@ VCardLine VCardTool::createPicture( const QString &identifier, const Picture &pi
s.setVersion( 4 );
s << pic.data();
- line.setValue( input );
+ line.setValueBytes( input );
line.addParameter( "encoding", "b" );
line.addParameter( "type", "image/png" );
@@ -662,5 +662,5 @@ VCardLine VCardTool::createPicture( const QString &identifier, const Picture &pi
} else if ( !pic.url().isEmpty() ) {
QByteArray ba;
- line.setValue( pic.url() );
+ line.setValueString( pic.url() );
line.addParameter( "value", "URI" );
}
@@ -678,5 +678,5 @@ Sound VCardTool::parseSound( const VCardLine &line )
else if ( params.findIndex( "value" ) != -1 ) {
if ( line.parameter( "value" ).lower() == "uri" )
- snd.setUrl( line.value().asString() );
+ snd.setUrl( line.valueString() );
}
@@ -695,10 +695,10 @@ VCardLine VCardTool::createSound( const Sound &snd )
if ( snd.isIntern() ) {
if ( !snd.data().isEmpty() ) {
- line.setValue( snd.data() );
+ line.setValueBytes( snd.data() );
line.addParameter( "encoding", "b" );
// TODO: need to store sound type!!!
}
} else if ( !snd.url().isEmpty() ) {
- line.setValue( snd.url() );
+ line.setValueString( snd.url() );
line.addParameter( "value", "URI" );
}
@@ -715,5 +715,5 @@ Key VCardTool::parseKey( const VCardLine &line )
key.setBinaryData( line.valueBytes() );
else
- key.setTextData( line.value().asString() );
+ key.setTextData( line.valueString() );
if ( params.findIndex( "type" ) != -1 ) {
@@ -737,9 +737,9 @@ VCardLine VCardTool::createKey( const Key &key )
if ( key.isBinary() ) {
if ( !key.binaryData().isEmpty() ) {
- line.setValue( key.binaryData() );
+ line.setValueBytes( key.binaryData() );
line.addParameter( "encoding", "b" );
}
} else if ( !key.textData().isEmpty() )
- line.setValue( key.textData() );
+ line.setValueString( key.textData() );
if ( key.type() == Key::X509 )
@@ -757,9 +757,9 @@ Secrecy VCardTool::parseSecrecy( const VCardLine &line )
Secrecy secrecy;
- if ( line.value().asString().lower() == "public" )
+ if ( line.valueString().lower() == "public" )
secrecy.setType( Secrecy::Public );
- if ( line.value().asString().lower() == "private" )
+ if ( line.valueString().lower() == "private" )
secrecy.setType( Secrecy::Private );
- if ( line.value().asString().lower() == "confidential" )
+ if ( line.valueString().lower() == "confidential" )
secrecy.setType( Secrecy::Confidential );
@@ -774,9 +774,9 @@ VCardLine VCardTool::createSecrecy( const Secrecy &secrecy )
if ( type == Secrecy::Public )
- line.setValue( "PUBLIC" );
+ line.setValueString( "PUBLIC" );
else if ( type == Secrecy::Private )
- line.setValue( "PRIVATE" );
+ line.setValueString( "PRIVATE" );
else if ( type == Secrecy::Confidential )
- line.setValue( "CONFIDENTIAL" );
+ line.setValueString( "CONFIDENTIAL" );
return line;
@@ -790,7 +790,7 @@ Agent VCardTool::parseAgent( const VCardLine &line )
if ( params.findIndex( "value" ) != -1 ) {
if ( line.parameter( "value" ).lower() == "uri" )
- agent.setUrl( line.value().asString() );
+ agent.setUrl( line.valueString() );
} else {
- QString str = line.value().asString();
+ QString str = line.valueString();
str.replace( QRegExp("\\\\n"), "\r\n" );
str.replace( QRegExp("\\\\N"), "\r\n" );
@@ -824,8 +824,8 @@ VCardLine VCardTool::createAgent( VCard::Version version, const Agent &agent )
str.replace( QRegExp(":"), "\\:" );
str.replace( QRegExp(","), "\\," );
- line.setValue( str );
+ line.setValueString( str );
}
} else if ( !agent.url().isEmpty() ) {
- line.setValue( agent.url() );
+ line.setValueString( agent.url() );
line.addParameter( "value", "URI" );
}