Diffstat (limited to 'core/pim/today/plugins/addressbook/addresspluginwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/today/plugins/addressbook/addresspluginwidget.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp index 498de28..dad09db 100644 --- a/core/pim/today/plugins/addressbook/addresspluginwidget.cpp +++ b/core/pim/today/plugins/addressbook/addresspluginwidget.cpp | |||
@@ -61,12 +61,16 @@ void AddressBookPluginWidget::refresh( const OContactAccess* ) | |||
61 | { | 61 | { |
62 | qWarning(" AddressBookPluginWidget::Database was changed externally ! "); | 62 | qWarning(" AddressBookPluginWidget::Database was changed externally ! "); |
63 | m_contactdb->reload(); | 63 | m_contactdb->reload(); |
64 | getAddress(); | 64 | getAddress(); |
65 | } | 65 | } |
66 | 66 | ||
67 | void AddressBookPluginWidget::reinitialize() { | ||
68 | readConfig(); | ||
69 | getAddress(); | ||
70 | } | ||
67 | 71 | ||
68 | void AddressBookPluginWidget::readConfig() { | 72 | void AddressBookPluginWidget::readConfig() { |
69 | Config cfg( "todayaddressplugin" ); | 73 | Config cfg( "todayaddressplugin" ); |
70 | cfg.setGroup( "config" ); | 74 | cfg.setGroup( "config" ); |
71 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); | 75 | m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); |
72 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); | 76 | m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); |
@@ -95,16 +99,13 @@ void AddressBookPluginWidget::getAddress() { | |||
95 | layoutTodo->addWidget( addressLabel ); | 99 | layoutTodo->addWidget( addressLabel ); |
96 | } | 100 | } |
97 | 101 | ||
98 | QString output; | 102 | QString output; |
99 | 103 | ||
100 | // Check whether the database provide the search option.. | 104 | // Check whether the database provide the search option.. |
101 | // The following if-statement was replaced due to a bug in some | 105 | if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){ |
102 | // implementations of libopie. The replacement should work everywhere..(eilers) | ||
103 | // if ( !m_contactdb->hasQuerySettings( OContactAccess::DateDiff ) ){ | ||
104 | if ( !( m_contactdb->querySettings() & OContactAccess::DateDiff ) ){ | ||
105 | // Libopie seems to be old.. | 106 | // Libopie seems to be old.. |
106 | 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>" ); |
107 | addressLabel->setText( output ); | 108 | addressLabel->setText( output ); |
108 | return; | 109 | return; |
109 | } | 110 | } |
110 | 111 | ||
@@ -112,16 +113,16 @@ void AddressBookPluginWidget::getAddress() { | |||
112 | QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead ); | 113 | QDate lookAheadDate = QDate::currentDate().addDays( m_daysLookAhead ); |
113 | int ammount = 0; | 114 | int ammount = 0; |
114 | if ( m_showBirthdays ){ | 115 | if ( m_showBirthdays ){ |
115 | qWarning("Searching from now (%s) until %s ! ", | 116 | qWarning("Searching from now (%s) until %s ! ", |
116 | QDate::currentDate().toString().latin1(), | 117 | QDate::currentDate().toString().latin1(), |
117 | lookAheadDate.toString().latin1() ); | 118 | lookAheadDate.toString().latin1() ); |
119 | |||
118 | OContact querybirthdays; | 120 | OContact querybirthdays; |
119 | querybirthdays.setBirthday( lookAheadDate ); | 121 | querybirthdays.setBirthday( lookAheadDate ); |
120 | 122 | ||
121 | |||
122 | m_list = m_contactdb->queryByExample( querybirthdays, | 123 | m_list = m_contactdb->queryByExample( querybirthdays, |
123 | OContactAccess::DateDiff ); | 124 | OContactAccess::DateDiff ); |
124 | if ( m_list.count() > 0 ){ | 125 | if ( m_list.count() > 0 ){ |
125 | output = "<font color=" + m_headlineColor + ">" | 126 | output = "<font color=" + m_headlineColor + ">" |
126 | + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) | 127 | + QObject::tr( "Next birthdays in <b> %1 </b> days:" ) |
127 | .arg( m_daysLookAhead ) | 128 | .arg( m_daysLookAhead ) |