-rw-r--r-- | libkcal/person.cpp | 8 | ||||
-rw-r--r-- | libkcal/person.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libkcal/person.cpp b/libkcal/person.cpp index aca28c2..858805d 100644 --- a/libkcal/person.cpp +++ b/libkcal/person.cpp | |||
@@ -49,7 +49,13 @@ bool KCal::operator==( const Person& p1, const Person& p2 ) | |||
49 | p1.email() == p2.email() ); | 49 | p1.email() == p2.email() ); |
50 | } | 50 | } |
51 | 51 | ||
52 | 52 | QString Person::realName() const | |
53 | { | ||
54 | int ccc = mName.find (','); | ||
55 | if ( ccc < 0 ) | ||
56 | return mName; | ||
57 | return mName.mid( ccc+1 ).stripWhiteSpace() + " " + mName.left( ccc ).stripWhiteSpace(); | ||
58 | } | ||
53 | QString Person::fullName() const | 59 | QString Person::fullName() const |
54 | { | 60 | { |
55 | if( mName.isEmpty() ) { | 61 | if( mName.isEmpty() ) { |
diff --git a/libkcal/person.h b/libkcal/person.h index c46c5f0..3cec153 100644 --- a/libkcal/person.h +++ b/libkcal/person.h | |||
@@ -35,6 +35,7 @@ class Person | |||
35 | 35 | ||
36 | void setName(const QString &); | 36 | void setName(const QString &); |
37 | QString name() const { return mName; } | 37 | QString name() const { return mName; } |
38 | QString realName() const; | ||
38 | 39 | ||
39 | void setEmail(const QString &); | 40 | void setEmail(const QString &); |
40 | QString email() const { return mEmail; } | 41 | QString email() const { return mEmail; } |