summaryrefslogtreecommitdiffstats
path: root/kresources/birthdays
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /kresources/birthdays
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/birthdays')
-rw-r--r--kresources/birthdays/kabc.desktop1
-rw-r--r--kresources/birthdays/resourcekabc.cpp60
-rw-r--r--kresources/birthdays/resourcekabc.h10
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 */