summaryrefslogtreecommitdiffabout
path: root/kabc/vcardparser/vcardtool.cpp
Unidiff
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
@@ -369,3 +369,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
369 Address address; 369 Address address;
370 const QStringList addrParts = splitString( semicolonSep, (*lineIt).value().asString() ); 370 const QStringList addrParts = splitString( semicolonSep, (*lineIt).valueString() );
371 if ( addrParts.count() > 0 ) 371 if ( addrParts.count() > 0 )
@@ -401,3 +401,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
401 else if ( identifier == "bday" ) 401 else if ( identifier == "bday" )
402 addr.setBirthday( parseDateTime( (*lineIt).value().asString() ) ); 402 addr.setBirthday( parseDateTime( (*lineIt).valueString() ) );
403 403
@@ -405,3 +405,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
405 else if ( identifier == "categories" ) { 405 else if ( identifier == "categories" ) {
406 const QStringList categories = splitString( commaSep, (*lineIt).value().asString() ); 406 const QStringList categories = splitString( commaSep, (*lineIt).valueString() );
407 addr.setCategories( categories ); 407 addr.setCategories( categories );
@@ -416,3 +416,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
416 const QStringList types = (*lineIt).parameters( "type" ); 416 const QStringList types = (*lineIt).parameters( "type" );
417 addr.insertEmail( (*lineIt).value().asString(), types.findIndex( "PREF" ) != -1 ); 417 addr.insertEmail( (*lineIt).valueString(), types.findIndex( "PREF" ) != -1 );
418 } 418 }
@@ -421,3 +421,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
421 else if ( identifier == "fn" ) 421 else if ( identifier == "fn" )
422 addr.setFormattedName( (*lineIt).value().asString() ); 422 addr.setFormattedName( (*lineIt).valueString() );
423 423
@@ -427,3 +427,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
427 427
428 const QStringList geoParts = QStringList::split( ';', (*lineIt).value().asString(), true ); 428 const QStringList geoParts = QStringList::split( ';', (*lineIt).valueString(), true );
429 geo.setLatitude( geoParts[ 0 ].toFloat() ); 429 geo.setLatitude( geoParts[ 0 ].toFloat() );
@@ -451,3 +451,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
451 if ( (*it).type() == type ) { 451 if ( (*it).type() == type ) {
452 (*it).setLabel( (*lineIt).value().asString() ); 452 (*it).setLabel( (*lineIt).valueString() );
453 addr.insertAddress( *it ); 453 addr.insertAddress( *it );
@@ -460,3 +460,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
460 KABC::Address address( type ); 460 KABC::Address address( type );
461 address.setLabel( (*lineIt).value().asString() ); 461 address.setLabel( (*lineIt).valueString() );
462 addr.insertAddress( address ); 462 addr.insertAddress( address );
@@ -471,3 +471,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
471 else if ( identifier == "mailer" ) 471 else if ( identifier == "mailer" )
472 addr.setMailer( (*lineIt).value().asString() ); 472 addr.setMailer( (*lineIt).valueString() );
473 473
@@ -475,3 +475,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
475 else if ( identifier == "n" ) { 475 else if ( identifier == "n" ) {
476 const QStringList nameParts = splitString( semicolonSep, (*lineIt).value().asString() ); 476 const QStringList nameParts = splitString( semicolonSep, (*lineIt).valueString() );
477 if ( nameParts.count() > 0 ) 477 if ( nameParts.count() > 0 )
@@ -490,3 +490,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
490 else if ( identifier == "name" ) 490 else if ( identifier == "name" )
491 addr.setName( (*lineIt).value().asString() ); 491 addr.setName( (*lineIt).valueString() );
492 492
@@ -494,3 +494,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
494 else if ( identifier == "nickname" ) 494 else if ( identifier == "nickname" )
495 addr.setNickName( (*lineIt).value().asString() ); 495 addr.setNickName( (*lineIt).valueString() );
496 496
@@ -498,3 +498,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
498 else if ( identifier == "note" ) 498 else if ( identifier == "note" )
499 addr.setNote( (*lineIt).value().asString() ); 499 addr.setNote( (*lineIt).valueString() );
500 500
@@ -502,3 +502,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
502 else if ( identifier == "org" ) 502 else if ( identifier == "org" )
503 addr.setOrganization( (*lineIt).value().asString() ); 503 addr.setOrganization( (*lineIt).valueString() );
504 504
@@ -510,3 +510,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
510 else if ( identifier == "prodid" ) 510 else if ( identifier == "prodid" )
511 addr.setProductId( (*lineIt).value().asString() ); 511 addr.setProductId( (*lineIt).valueString() );
512 512
@@ -514,3 +514,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
514 else if ( identifier == "rev" ) 514 else if ( identifier == "rev" )
515 addr.setRevision( parseDateTime( (*lineIt).value().asString() ) ); 515 addr.setRevision( parseDateTime( (*lineIt).valueString() ) );
516 516
@@ -518,3 +518,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
518 else if ( identifier == "role" ) 518 else if ( identifier == "role" )
519 addr.setRole( (*lineIt).value().asString() ); 519 addr.setRole( (*lineIt).valueString() );
520 520
@@ -522,3 +522,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
522 else if ( identifier == "sort-string" ) 522 else if ( identifier == "sort-string" )
523 addr.setSortString( (*lineIt).value().asString() ); 523 addr.setSortString( (*lineIt).valueString() );
524 524
@@ -531,3 +531,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
531 PhoneNumber phone; 531 PhoneNumber phone;
532 phone.setNumber( (*lineIt).value().asString() ); 532 phone.setNumber( (*lineIt).valueString() );
533 533
@@ -546,3 +546,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
546 else if ( identifier == "title" ) 546 else if ( identifier == "title" )
547 addr.setTitle( (*lineIt).value().asString() ); 547 addr.setTitle( (*lineIt).valueString() );
548 548
@@ -551,3 +551,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
551 TimeZone tz; 551 TimeZone tz;
552 const QString date = (*lineIt).value().asString(); 552 const QString date = (*lineIt).valueString();
553 553
@@ -564,3 +564,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
564 else if ( identifier == "uid" ) 564 else if ( identifier == "uid" )
565 addr.setUid( (*lineIt).value().asString() ); 565 addr.setUid( (*lineIt).valueString() );
566 566
@@ -568,3 +568,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
568 else if ( identifier == "url" ) 568 else if ( identifier == "url" )
569 addr.setUrl( KURL( (*lineIt).value().asString() ) ); 569 addr.setUrl( KURL( (*lineIt).valueString() ) );
570 570
@@ -574,3 +574,3 @@ Addressee::List VCardTool::parseVCards( const QString& vcard )
574 int dash = key.find( "-" ); 574 int dash = key.find( "-" );
575 addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).value().asString() ); 575 addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).valueString() );
576 } 576 }
@@ -638,3 +638,3 @@ Picture VCardTool::parsePicture( const VCardLine &line )
638 if ( line.parameter( "value" ).lower() == "uri" ) 638 if ( line.parameter( "value" ).lower() == "uri" )
639 pic.setUrl( line.value().asString() ); 639 pic.setUrl( line.valueString() );
640 } 640 }
@@ -657,3 +657,3 @@ VCardLine VCardTool::createPicture( const QString &identifier, const Picture &pi
657 s << pic.data(); 657 s << pic.data();
658 line.setValue( input ); 658 line.setValueBytes( input );
659 line.addParameter( "encoding", "b" ); 659 line.addParameter( "encoding", "b" );
@@ -663,3 +663,3 @@ VCardLine VCardTool::createPicture( const QString &identifier, const Picture &pi
663 QByteArray ba; 663 QByteArray ba;
664 line.setValue( pic.url() ); 664 line.setValueString( pic.url() );
665 line.addParameter( "value", "URI" ); 665 line.addParameter( "value", "URI" );
@@ -679,3 +679,3 @@ Sound VCardTool::parseSound( const VCardLine &line )
679 if ( line.parameter( "value" ).lower() == "uri" ) 679 if ( line.parameter( "value" ).lower() == "uri" )
680 snd.setUrl( line.value().asString() ); 680 snd.setUrl( line.valueString() );
681 } 681 }
@@ -696,3 +696,3 @@ VCardLine VCardTool::createSound( const Sound &snd )
696 if ( !snd.data().isEmpty() ) { 696 if ( !snd.data().isEmpty() ) {
697 line.setValue( snd.data() ); 697 line.setValueBytes( snd.data() );
698 line.addParameter( "encoding", "b" ); 698 line.addParameter( "encoding", "b" );
@@ -701,3 +701,3 @@ VCardLine VCardTool::createSound( const Sound &snd )
701 } else if ( !snd.url().isEmpty() ) { 701 } else if ( !snd.url().isEmpty() ) {
702 line.setValue( snd.url() ); 702 line.setValueString( snd.url() );
703 line.addParameter( "value", "URI" ); 703 line.addParameter( "value", "URI" );
@@ -716,3 +716,3 @@ Key VCardTool::parseKey( const VCardLine &line )
716 else 716 else
717 key.setTextData( line.value().asString() ); 717 key.setTextData( line.valueString() );
718 718
@@ -738,3 +738,3 @@ VCardLine VCardTool::createKey( const Key &key )
738 if ( !key.binaryData().isEmpty() ) { 738 if ( !key.binaryData().isEmpty() ) {
739 line.setValue( key.binaryData() ); 739 line.setValueBytes( key.binaryData() );
740 line.addParameter( "encoding", "b" ); 740 line.addParameter( "encoding", "b" );
@@ -742,3 +742,3 @@ VCardLine VCardTool::createKey( const Key &key )
742 } else if ( !key.textData().isEmpty() ) 742 } else if ( !key.textData().isEmpty() )
743 line.setValue( key.textData() ); 743 line.setValueString( key.textData() );
744 744
@@ -758,7 +758,7 @@ Secrecy VCardTool::parseSecrecy( const VCardLine &line )
758 758
759 if ( line.value().asString().lower() == "public" ) 759 if ( line.valueString().lower() == "public" )
760 secrecy.setType( Secrecy::Public ); 760 secrecy.setType( Secrecy::Public );
761 if ( line.value().asString().lower() == "private" ) 761 if ( line.valueString().lower() == "private" )
762 secrecy.setType( Secrecy::Private ); 762 secrecy.setType( Secrecy::Private );
763 if ( line.value().asString().lower() == "confidential" ) 763 if ( line.valueString().lower() == "confidential" )
764 secrecy.setType( Secrecy::Confidential ); 764 secrecy.setType( Secrecy::Confidential );
@@ -775,7 +775,7 @@ VCardLine VCardTool::createSecrecy( const Secrecy &secrecy )
775 if ( type == Secrecy::Public ) 775 if ( type == Secrecy::Public )
776 line.setValue( "PUBLIC" ); 776 line.setValueString( "PUBLIC" );
777 else if ( type == Secrecy::Private ) 777 else if ( type == Secrecy::Private )
778 line.setValue( "PRIVATE" ); 778 line.setValueString( "PRIVATE" );
779 else if ( type == Secrecy::Confidential ) 779 else if ( type == Secrecy::Confidential )
780 line.setValue( "CONFIDENTIAL" ); 780 line.setValueString( "CONFIDENTIAL" );
781 781
@@ -791,5 +791,5 @@ Agent VCardTool::parseAgent( const VCardLine &line )
791 if ( line.parameter( "value" ).lower() == "uri" ) 791 if ( line.parameter( "value" ).lower() == "uri" )
792 agent.setUrl( line.value().asString() ); 792 agent.setUrl( line.valueString() );
793 } else { 793 } else {
794 QString str = line.value().asString(); 794 QString str = line.valueString();
795 str.replace( QRegExp("\\\\n"), "\r\n" ); 795 str.replace( QRegExp("\\\\n"), "\r\n" );
@@ -825,6 +825,6 @@ VCardLine VCardTool::createAgent( VCard::Version version, const Agent &agent )
825 str.replace( QRegExp(","), "\\," ); 825 str.replace( QRegExp(","), "\\," );
826 line.setValue( str ); 826 line.setValueString( str );
827 } 827 }
828 } else if ( !agent.url().isEmpty() ) { 828 } else if ( !agent.url().isEmpty() ) {
829 line.setValue( agent.url() ); 829 line.setValueString( agent.url() );
830 line.addParameter( "value", "URI" ); 830 line.addParameter( "value", "URI" );