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.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index df7c5e1..5662af2 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -102,58 +102,58 @@ void AddressBookPluginWidget::getAddress() {
if ( m_showBirthdays ){
owarn << "Searching from now (" << QDate::currentDate().toString() << ") until "
<< lookAheadDate.toString() << " ! " << oendl;
- }
-
- if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDiff ) ){
-
-
- Opie::OPimContact querybirthdays;
- querybirthdays.setBirthday( lookAheadDate );
- m_list = m_contactdb->queryByExample( querybirthdays,
- 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>";
- 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();
- destdate.setYMD( QDate::currentDate().year(),
- destdate.month(), destdate.day() );
- if ( QDate::currentDate().daysTo(destdate) < 0 )
- destdate.setYMD( QDate::currentDate().year()+1,
+ if ( m_contactdb->hasQuerySettings( Opie::OPimContactAccess::DateDiff ) ){
+
+
+ Opie::OPimContact querybirthdays;
+ querybirthdays.setBirthday( lookAheadDate );
+
+ m_list = m_contactdb->queryByExample( querybirthdays,
+ 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>";
+ 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();
+ destdate.setYMD( QDate::currentDate().year(),
destdate.month(), destdate.day() );
-
-
- if ( QDate::currentDate().daysTo(destdate) < m_urgentDays )
- output += "<font color=" + m_urgentColor + "><b>-"
- + (*m_it).fullName()
- + " ("
- + QString::number(QDate::currentDate()
- .daysTo(destdate))
- + " Days) </b></font><br>";
-
- else
- output += "<font color=" + m_entryColor + "><b>-"
- + (*m_it).fullName()
- + " ("
- + QString::number(QDate::currentDate()
- .daysTo(destdate))
- + " Days) </b></font><br>";
+ if ( QDate::currentDate().daysTo(destdate) < 0 )
+ destdate.setYMD( QDate::currentDate().year()+1,
+ destdate.month(), destdate.day() );
+
+
+ if ( QDate::currentDate().daysTo(destdate) < m_urgentDays )
+ output += "<font color=" + m_urgentColor + "><b>-"
+ + (*m_it).fullName()
+ + " ("
+ + QString::number(QDate::currentDate()
+ .daysTo(destdate))
+ + " Days) </b></font><br>";
+
+ else
+ output += "<font color=" + m_entryColor + "><b>-"
+ + (*m_it).fullName()
+ + " ("
+ + QString::number(QDate::currentDate()
+ .daysTo(destdate))
+ + " Days) </b></font><br>";
+ }
}
+ } else {
+ output = "<font color=" + m_headlineColor + ">"
+ + QObject::tr( "No birthdays in <b> %1 </b> days!" )
+ .arg( m_daysLookAhead )
+ + "</font> <br>";
}
- } else {
- output = "<font color=" + m_headlineColor + ">"
- + QObject::tr( "No birthdays in <b> %1 </b> days!" )
- .arg( m_daysLookAhead )
- + "</font> <br>";
}
- }
+ }
if ( m_showAnniversaries ){
// Define the query for anniversaries and start search..