summaryrefslogtreecommitdiff
authoralwin <alwin>2005-03-17 01:36:32 (UTC)
committer alwin <alwin>2005-03-17 01:36:32 (UTC)
commite9865193fc0acdb84e0317f1188a70ca6f546ade (patch) (side-by-side diff)
tree20f488006b89946512e6d064661687e21e456f5e
parent7a8d4feb0bb9009b0cd50e80f1d6f1d14ca966dc (diff)
downloadopie-e9865193fc0acdb84e0317f1188a70ca6f546ade.zip
opie-e9865193fc0acdb84e0317f1188a70ca6f546ade.tar.gz
opie-e9865193fc0acdb84e0317f1188a70ca6f546ade.tar.bz2
check anniversaries, too.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/holiday/birthday/birthday.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/core/pim/datebook/holiday/birthday/birthday.cpp b/core/pim/datebook/holiday/birthday/birthday.cpp
index a32e0ea..98e2d40 100644
--- a/core/pim/datebook/holiday/birthday/birthday.cpp
+++ b/core/pim/datebook/holiday/birthday/birthday.cpp
@@ -1,56 +1,71 @@
#include "birthday.h"
#include <opie2/ocontactaccess.h>
#include <qobject.h>
Birthday::Birthday()
:Opie::Datebook::HolidayPlugin()
{
m_contactdb = new Opie::OPimContactAccess("addressplugin");
/*
connect( m_contactdb, SIGNAL( signalChanged(const Opie::OPimContactAccess*) ),
this, SLOT( refresh(const Opie::OPimContactAccess*) ) );
*/
}
QString Birthday::description()
{
return QObject::tr("Birthdays","holidays");
}
QStringList Birthday::entries(const QDate&aDate)
{
QStringList ret;
if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDay ) ){
- Opie::OPimContact querybirthdays;
+ Opie::OPimContact querybirthdays,queryanniversary;
+ QString pre;
querybirthdays.setBirthday(aDate);
+ queryanniversary.setAnniversary(aDate);
m_list = m_contactdb->queryByExample( querybirthdays,Opie::OPimContactAccess::DateDay| Opie::OPimContactAccess::DateMonth);
if ( m_list.count() > 0 ){
- QString pre = QObject::tr("Birthday","holidays")+" ";
+ pre = QObject::tr("Birthday","holidays")+" ";
+ int z = 0;
+ for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
+ if (z) {
+ pre+=", ";
+ }
+ pre+=((*m_it).fullName());
+ ++z;
+ }
+ ret.append(pre);
+ }
+ m_list = m_contactdb->queryByExample( queryanniversary,Opie::OPimContactAccess::DateDay| Opie::OPimContactAccess::DateMonth);
+ if ( m_list.count() > 0 ){
+ pre = QObject::tr("Anniversary","holidays")+" ";
int z = 0;
for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
if (z) {
pre+=", ";
}
pre+=((*m_it).fullName());
++z;
}
ret.append(pre);
}
}
return ret;
}
QStringList Birthday::entries(unsigned year, unsigned month, unsigned day)
{
return entries(QDate(year,month,day));
}
QMap<QDate,QStringList> Birthday::entries(const QDate&,const QDate&)
{
QMap<QDate,QStringList> ret;
return ret;
}
EXPORT_HOLIDAY_PLUGIN(Birthday);