summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
Unidiff
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.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
index dad09db..d47bc0b 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp
@@ -93,38 +93,42 @@ void AddressBookPluginWidget::getAddress() {
93 layoutTodo = new QVBoxLayout( this ); 93 layoutTodo = new QVBoxLayout( this );
94 } 94 }
95 95
96 if ( ! addressLabel ) { 96 if ( ! addressLabel ) {
97 addressLabel = new OClickableLabel( this ); 97 addressLabel = new OClickableLabel( this );
98 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) ); 98 connect( addressLabel, SIGNAL( clicked() ), this, SLOT( startAddressBook() ) );
99 layoutTodo->addWidget( addressLabel ); 99 layoutTodo->addWidget( addressLabel );
100 } 100 }
101 101
102 QString output; 102 QString output;
103 103
104 // Check whether the database provide the search option.. 104 // Check whether the database provide the search option..
105 if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){ 105 if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
106 // Libopie seems to be old.. 106 // Libopie seems to be old..
107 output = QObject::tr( "Database does not provide this search query ! Please upgrade libOpie !<br>" ); 107 output = QObject::tr( "Database does not provide this search query ! Please upgrade libOpie !<br>" );
108 addressLabel->setText( output ); 108 addressLabel->setText( output );
109 return; 109 return;
110 } 110 }
111 111
112 // Define the query for birthdays and start search.. 112 // Define the query for birthdays and start search..
113 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead ); 113 QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead );
114 int ammount = 0; 114 int ammount = 0;
115 if ( m_showBirthdays ){ 115 if ( m_showBirthdays ){
116 qWarning("Searching from now (%s) until %s ! ", 116 qWarning("Searching from now (%s) until %s ! ",
117 QDate::currentDate().toString().latin1(), 117 QDate::currentDate().toString().latin1(),
118 lookAheadDate.toString().latin1() ); 118 lookAheadDate.toString().latin1() );
119 }
120
121 if ( m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){
122
119 123
120 OContact querybirthdays; 124 OContact querybirthdays;
121 querybirthdays.setBirthday( lookAheadDate ); 125 querybirthdays.setBirthday( lookAheadDate );
122 126
123 m_list = m_contactdb->queryByExample( querybirthdays, 127 m_list = m_contactdb->queryByExample( querybirthdays,
124 OContactAccess::DateDiff ); 128 OContactAccess::DateDiff );
125 if ( m_list.count() > 0 ){ 129 if ( m_list.count() > 0 ){
126 output = "<font color=" + m_headlineColor + ">" 130 output = "<font color=" + m_headlineColor + ">"
127 + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) 131 + QObject::tr( "Next birthdays in <b> %1 </b> days:" )
128 .arg( m_daysLookAhead ) 132 .arg( m_daysLookAhead )
129 + "</font> <br>"; 133 + "</font> <br>";
130 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 134 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {