author | ulf69 <ulf69> | 2004-06-30 22:07:56 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-06-30 22:07:56 (UTC) |
commit | 1b7b7755bfbedddc72293b784577ded4e684bd6f (patch) (unidiff) | |
tree | ff4eba9b8bb53401d2000d70e73a40f7c330d577 /kabc/addressee.cpp | |
parent | c6f3a3f49498dca52d10418d845f4a84c0c6d941 (diff) | |
download | kdepimpi-1b7b7755bfbedddc72293b784577ded4e684bd6f.zip kdepimpi-1b7b7755bfbedddc72293b784577ded4e684bd6f.tar.gz kdepimpi-1b7b7755bfbedddc72293b784577ded4e684bd6f.tar.bz2 |
added a new field of type Resource. This allowes us to display in KAddressbook for each
Addressbookentry its location
-rw-r--r-- | kabc/addressee.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 5cb194a..d484073 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -1486,48 +1486,54 @@ void Addressee::parseEmailAddress( const QString &rawEmail, QString &fullName, | |||
1486 | // Check that we do not have any extra characters on the end of the | 1486 | // Check that we do not have any extra characters on the end of the |
1487 | // strings | 1487 | // strings |
1488 | len = fullName.length(); | 1488 | len = fullName.length(); |
1489 | if (fullName[0]=='"' && fullName[len-1]=='"') | 1489 | if (fullName[0]=='"' && fullName[len-1]=='"') |
1490 | fullName = fullName.mid(1, len-2); | 1490 | fullName = fullName.mid(1, len-2); |
1491 | else if (fullName[0]=='<' && fullName[len-1]=='>') | 1491 | else if (fullName[0]=='<' && fullName[len-1]=='>') |
1492 | fullName = fullName.mid(1, len-2); | 1492 | fullName = fullName.mid(1, len-2); |
1493 | else if (fullName[0]=='(' && fullName[len-1]==')') | 1493 | else if (fullName[0]=='(' && fullName[len-1]==')') |
1494 | fullName = fullName.mid(1, len-2); | 1494 | fullName = fullName.mid(1, len-2); |
1495 | } | 1495 | } |
1496 | } | 1496 | } |
1497 | } | 1497 | } |
1498 | 1498 | ||
1499 | void Addressee::setResource( Resource *resource ) | 1499 | void Addressee::setResource( Resource *resource ) |
1500 | { | 1500 | { |
1501 | detach(); | 1501 | detach(); |
1502 | mData->resource = resource; | 1502 | mData->resource = resource; |
1503 | } | 1503 | } |
1504 | 1504 | ||
1505 | Resource *Addressee::resource() const | 1505 | Resource *Addressee::resource() const |
1506 | { | 1506 | { |
1507 | return mData->resource; | 1507 | return mData->resource; |
1508 | } | 1508 | } |
1509 | 1509 | ||
1510 | //US | ||
1511 | QString Addressee::resourceLabel() | ||
1512 | { | ||
1513 | return i18n("Resource"); | ||
1514 | } | ||
1515 | |||
1510 | void Addressee::setChanged( bool value ) | 1516 | void Addressee::setChanged( bool value ) |
1511 | { | 1517 | { |
1512 | detach(); | 1518 | detach(); |
1513 | mData->changed = value; | 1519 | mData->changed = value; |
1514 | } | 1520 | } |
1515 | 1521 | ||
1516 | bool Addressee::changed() const | 1522 | bool Addressee::changed() const |
1517 | { | 1523 | { |
1518 | return mData->changed; | 1524 | return mData->changed; |
1519 | } | 1525 | } |
1520 | 1526 | ||
1521 | QDataStream &KABC::operator<<( QDataStream &s, const Addressee &a ) | 1527 | QDataStream &KABC::operator<<( QDataStream &s, const Addressee &a ) |
1522 | { | 1528 | { |
1523 | if (!a.mData) return s; | 1529 | if (!a.mData) return s; |
1524 | 1530 | ||
1525 | s << a.uid(); | 1531 | s << a.uid(); |
1526 | 1532 | ||
1527 | s << a.mData->name; | 1533 | s << a.mData->name; |
1528 | s << a.mData->formattedName; | 1534 | s << a.mData->formattedName; |
1529 | s << a.mData->familyName; | 1535 | s << a.mData->familyName; |
1530 | s << a.mData->givenName; | 1536 | s << a.mData->givenName; |
1531 | s << a.mData->additionalName; | 1537 | s << a.mData->additionalName; |
1532 | s << a.mData->prefix; | 1538 | s << a.mData->prefix; |
1533 | s << a.mData->suffix; | 1539 | s << a.mData->suffix; |