summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/today/plugins/addressbook/addresspluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index 5662af2..75bf474 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -113,12 +113,17 @@ void AddressBookPluginWidget::getAddress() {
Opie::OPimContactAccess::DateDiff );
if ( m_list.count() > 0 ){
output = "<font color=" + m_headlineColor + ">"
+ QObject::tr( "Next birthdays in <b> %1 </b> days:" )
.arg( m_daysLookAhead )
+ "</font> <br>";
+
+ // Sort filtered results
+ m_list = m_contactdb->sorted( m_list, true, Opie::OPimContactAccess::SortBirthday,
+ Opie::OPimContactAccess::FilterOff, NULL );
+
for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
if ( ammount++ < m_maxLinesTask ){
// Now we want to calculate how many days
//until birthday. We have to set
// the correct year to calculate the day diff...
QDate destdate = (*m_it).birthday();
@@ -165,12 +170,17 @@ void AddressBookPluginWidget::getAddress() {
ammount = 0;
if ( m_list.count() > 0 ){
output += "<font color=" + m_headlineColor + ">"
+ QObject::tr( "Next anniversaries in <b> %1 </b> days:" )
.arg( m_daysLookAhead )
+ "</font> <br>";
+
+ // Sort filtered results
+ m_list = m_contactdb->sorted( m_list, true, Opie::OPimContactAccess::SortAnniversary,
+ Opie::OPimContactAccess::FilterOff, NULL );
+
for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
if ( ammount++ < m_maxLinesTask ){
// Now we want to calculate how many days until anniversary.
// We have to set the correct year to calculate the day diff...
QDate destdate = (*m_it).anniversary();
destdate.setYMD( QDate::currentDate().year(), destdate.month(),