diff options
Diffstat (limited to 'kresources/birthdays')
-rw-r--r-- | kresources/birthdays/kabc.desktop | 1 | ||||
-rw-r--r-- | kresources/birthdays/resourcekabc.cpp | 60 | ||||
-rw-r--r-- | kresources/birthdays/resourcekabc.h | 10 |
3 files changed, 51 insertions, 20 deletions
diff --git a/kresources/birthdays/kabc.desktop b/kresources/birthdays/kabc.desktop index aec8d565c..cea676fa6 100644 --- a/kresources/birthdays/kabc.desktop +++ b/kresources/birthdays/kabc.desktop @@ -28,7 +28,6 @@ Name[hu]=Születésnapok a KAddressBookból Name[is]=Afmælisdagar úr KAddressBook Name[it]=Compleanni da KAddessBook Name[ja]=アドレス帳の誕生日 -Name[ka]=დაბადების დღეები KDE წიგნაკიდან Name[kk]=KAddressBook-тағы туған күндер Name[km]=ថ្ងៃខួបកំណើតពី KAddressBook Name[lt]=Gimtadieniai iš KAddressBook diff --git a/kresources/birthdays/resourcekabc.cpp b/kresources/birthdays/resourcekabc.cpp index dc902c5bf..65830782e 100644 --- a/kresources/birthdays/resourcekabc.cpp +++ b/kresources/birthdays/resourcekabc.cpp @@ -46,6 +46,8 @@ #include "libkcal/filestorage.h" #include "libkcal/alarm.h" +#include <libemailfunctions/email.h> + #include <kresources/configwidget.h> #include "resourcekabcconfig.h" @@ -70,6 +72,8 @@ ResourceKABC::ResourceKABC( const KConfig* config ) { if ( config ) { readConfig( config ); + } else { + setResourceName( i18n( "Birthdays" ) ); } init(); @@ -227,7 +231,8 @@ bool ResourceKABC::doLoad() bool found = false; for ( addrIt = anniversaries.begin(); addrIt != anniversaries.end(); ++addrIt ) { if ( name == (*addrIt).realName() ) { - TQDateTime spouseAnniversary = TQDate::fromString( (*addrIt).custom( "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate ); + TQDate spouseAnniversary = + TQDate::fromString( (*addrIt).custom( "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate ); if ( anniversary == spouseAnniversary ) { found = true; break; @@ -255,22 +260,30 @@ bool ResourceKABC::doLoad() TQString spouseName = (*addrIt).custom( "KADDRESSBOOK", "X-SpousesName" ); TQString name_2,email_2,uid_2; if ( !spouseName.isEmpty() ) { - //TODO: find a KABC:Addressee of the spouse - // Probably easiest would be to use a TQMap (as the spouse's entry was already searched above! + TQString tname, temail; + KPIM::getNameAndMail( spouseName, tname, temail ); + tname = KPIM::quoteNameIfNecessary( tname ); + if ( ( tname[0] == '"' ) && ( tname[tname.length() - 1] == '"' ) ) { + tname.remove( 0, 1 ); + tname.truncate( tname.length() - 1 ); + } KABC::Addressee spouse; - spouse.setNameFromString( spouseName ); + spouse.setNameFromString( tname ); + name_2 = spouse.nickName(); uid_2 = spouse.uid(); email_2 = spouse.fullEmail(); - name_2 = spouse.nickName(); - if ( name_2.isEmpty() ) - name_2 = spouse.givenName(); - summary = i18n("insert names of both spouses", "%1's & %2's anniversary").arg( name_1 ).arg( name_2 ); + if ( name_2.isEmpty() ) { + name_2 = spouse.realName(); + } + summary = i18n("insert names of both spouses", + "%1's & %2's anniversary").arg( name_1 ).arg( name_2 ); } else { - summary = i18n("only one spouse in addressbook, insert the name", "%1's anniversary").arg( name_1 ); + summary = i18n("only one spouse in addressbook, insert the name", + "%1's anniversary").arg( name_1 ); } Event *ev = new Event(); - ev->setUid( uid_1+"_KABC_Anniversary" ); + ev->setUid( uid_1+"_KABC_Anniversary" ); ev->setDtStart(anniversary); ev->setDtEnd(anniversary); @@ -378,12 +391,17 @@ KABC::Lock *ResourceKABC::lock() } -bool ResourceKABC::addEvent(Event*) +bool ResourceKABC::addEvent( Event * ) +{ + return false; +} + +bool ResourceKABC::addEvent( Event *, const TQString & ) { return false; } -bool ResourceKABC::deleteEvent(Event*) +bool ResourceKABC::deleteEvent( Event * ) { return false; } @@ -417,12 +435,17 @@ Event::List ResourceKABC::rawEvents( EventSortField sortField, SortDirection sor return mCalendar.rawEvents( sortField, sortDirection ); } -bool ResourceKABC::addTodo(Todo*) +bool ResourceKABC::addTodo( Todo * ) { return false; } -bool ResourceKABC::deleteTodo(Todo*) +bool ResourceKABC::addTodo( Todo *, const TQString & ) +{ + return false; +} + +bool ResourceKABC::deleteTodo( Todo * ) { return false; } @@ -444,12 +467,17 @@ Todo::List ResourceKABC::rawTodosForDate( const TQDate &date ) } -bool ResourceKABC::addJournal(Journal*) +bool ResourceKABC::addJournal( Journal * ) +{ + return false; +} + +bool ResourceKABC::addJournal( Journal *, const TQString & ) { return false; } -bool ResourceKABC::deleteJournal(Journal*) +bool ResourceKABC::deleteJournal( Journal * ) { return false; } diff --git a/kresources/birthdays/resourcekabc.h b/kresources/birthdays/resourcekabc.h index eebe087e9..9dedd0ab6 100644 --- a/kresources/birthdays/resourcekabc.h +++ b/kresources/birthdays/resourcekabc.h @@ -76,7 +76,8 @@ class KDE_EXPORT ResourceKABC : public ResourceCalendar KABC::Lock *lock(); /** Add Event to calendar. */ - bool addEvent(Event *anEvent); + KDE_DEPRECATED bool addEvent(Event *event); + bool addEvent( Event *event, const TQString &subresource ); /** deletes an event from this calendar. */ bool deleteEvent(Event *); @@ -107,7 +108,8 @@ class KDE_EXPORT ResourceKABC : public ResourceCalendar /** Add a todo to the todolist. */ - bool addTodo( Todo *todo ); + KDE_DEPRECATED bool addTodo( Todo *todo ); + bool addTodo( Todo *todo, const TQString &subresource ); /** Remove a todo from the todolist. */ @@ -126,7 +128,9 @@ class KDE_EXPORT ResourceKABC : public ResourceCalendar */ Todo::List rawTodosForDate( const TQDate &date ); /** Add a Journal entry to calendar */ - virtual bool addJournal(Journal *); + KDE_DEPRECATED bool addJournal( Journal *journal ); + bool addJournal( Journal *journal, const TQString &subresource ); + /** Remove journal from the calendar. */ bool deleteJournal( Journal * ); /** Return Journal with given UID */ |