- vcard30 patch (kde#115219,rh#253496) - -devel: restore awol Requires (< f8 only) (#253801) - License: LGPLv2
64 lines
3.1 KiB
Diff
64 lines
3.1 KiB
Diff
diff -up kdelibs-3.5.7/kabc/vcardtool.cpp.kde#115219 kdelibs-3.5.7/kabc/vcardtool.cpp
|
|
--- kdelibs-3.5.7/kabc/vcardtool.cpp.kde#115219 2006-03-17 04:19:10.000000000 -0600
|
|
+++ kdelibs-3.5.7/kabc/vcardtool.cpp 2007-08-22 08:27:19.000000000 -0500
|
|
@@ -242,8 +242,12 @@ QString VCardTool::createVCards( Address
|
|
card.addLine( noteLine );
|
|
|
|
// ORG
|
|
- VCardLine orgLine( "ORG", (*addrIt).organization() );
|
|
- if ( version == VCard::v2_1 && needsEncoding( (*addrIt).organization() ) ) {
|
|
+ QStringList organization;
|
|
+ organization.append( ( *addrIt ).organization().replace( ';', "\\;" ) );
|
|
+ if ( !( *addrIt ).department().isEmpty() )
|
|
+ organization.append( ( *addrIt ).department().replace( ';', "\\;" ) );
|
|
+ VCardLine orgLine( "ORG", organization.join( ";" ) );
|
|
+ if ( version == VCard::v2_1 && needsEncoding( organization.join( ";" ) ) ) {
|
|
orgLine.addParameter( "charset", "UTF-8" );
|
|
orgLine.addParameter( "encoding", "QUOTED-PRINTABLE" );
|
|
}
|
|
@@ -506,8 +510,13 @@ Addressee::List VCardTool::parseVCards(
|
|
addr.setNote( (*lineIt).value().asString() );
|
|
|
|
// ORGANIZATION
|
|
- else if ( identifier == "org" )
|
|
- addr.setOrganization( (*lineIt).value().asString() );
|
|
+ else if ( identifier == "org" ) {
|
|
+ const QStringList orgParts = splitString( semicolonSep, (*lineIt).value().toString() );
|
|
+ if ( orgParts.count() > 0 )
|
|
+ addr.setOrganization( orgParts[ 0 ] );
|
|
+ if ( orgParts.count() > 1 )
|
|
+ addr.setDepartment( orgParts[ 1 ] );
|
|
+ }
|
|
|
|
// PHOTO
|
|
else if ( identifier == "photo" )
|
|
diff -up kdelibs-3.5.7/kabc/ldifconverter.cpp.kde#115219 kdelibs-3.5.7/kabc/ldifconverter.cpp
|
|
--- kdelibs-3.5.7/kabc/ldifconverter.cpp.kde#115219 2005-10-10 10:05:53.000000000 -0500
|
|
+++ kdelibs-3.5.7/kabc/ldifconverter.cpp 2007-08-22 08:24:25.000000000 -0500
|
|
@@ -141,7 +141,13 @@ bool LDIFConverter::addresseeToLDIF( con
|
|
ldif_out( t, "o", addr.organization() );
|
|
ldif_out( t, "organization", addr.organization() );
|
|
ldif_out( t, "organizationname", addr.organization() );
|
|
- ldif_out( t, "department", addr.custom("KADDRESSBOOK", "X-Department") );
|
|
+
|
|
+ // Compatibility with older kabc versions.
|
|
+ if ( !addr.department().isEmpty() )
|
|
+ ldif_out( t, "department", addr.department() );
|
|
+ else
|
|
+ ldif_out( t, "department", addr.custom("KADDRESSBOOK", "X-Department") );
|
|
+
|
|
ldif_out( t, "workurl", addr.url().prettyURL() );
|
|
ldif_out( t, "homeurl", addr.url().prettyURL() );
|
|
ldif_out( t, "description", addr.note() );
|
|
diff -up kdelibs-3.5.7/kabc/scripts/entrylist.kde#115219 kdelibs-3.5.7/kabc/scripts/entrylist
|
|
--- kdelibs-3.5.7/kabc/scripts/entrylist.kde#115219 2007-05-14 02:52:37.000000000 -0500
|
|
+++ kdelibs-3.5.7/kabc/scripts/entrylist 2007-08-22 08:25:05.000000000 -0500
|
|
@@ -63,6 +63,7 @@ ALE,geographic position,,Geo,geo,,.asStr
|
|
ALFE,title,person,QString,title,Organization
|
|
ALFE,role,person in organization,QString,role,Organization
|
|
ALFE,organization,,QString,organization,Organization
|
|
+ALFE,department,,QString,department,Organization
|
|
|
|
ALFE,note,,QString,note
|
|
|