-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 12f7c27..63ad0ed 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp | |||
@@ -121,65 +121,65 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | |||
121 | } | 121 | } |
122 | QString pattern = s.lower()+"*"; | 122 | QString pattern = s.lower()+"*"; |
123 | QRegExp re; | 123 | QRegExp re; |
124 | re.setWildcard(true); // most people understand these better. | 124 | re.setWildcard(true); // most people understand these better. |
125 | re.setCaseSensitive(false); | 125 | re.setCaseSensitive(false); |
126 | re.setPattern( pattern ); | 126 | re.setPattern( pattern ); |
127 | if (!re.isValid()) | 127 | if (!re.isValid()) |
128 | return; | 128 | return; |
129 | KABC::Addressee::List addresseeList = addressees(); | 129 | KABC::Addressee::List addresseeList = addressees(); |
130 | KABC::Addressee::List::Iterator it; | 130 | KABC::Addressee::List::Iterator it; |
131 | if ( field ) { | 131 | if ( field ) { |
132 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 132 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
133 | #if QT_VERSION >= 300 | 133 | #if QT_VERSION >= 300 |
134 | if (re.search(field->value( *it ).lower()) != -1) | 134 | if (re.search(field->value( *it ).lower()) != -1) |
135 | #else | 135 | #else |
136 | if (re.match(field->value( *it ).lower()) != -1) | 136 | if (re.match(field->value( *it ).lower()) != -1) |
137 | #endif | 137 | #endif |
138 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 138 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
139 | 139 | ||
140 | } | 140 | } |
141 | } else { | 141 | } else { |
142 | KABC::Field::List fieldList = fields(); | 142 | KABC::Field::List fieldList = fields(); |
143 | KABC::Field::List::ConstIterator fieldIt; | 143 | KABC::Field::List::ConstIterator fieldIt; |
144 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 144 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
145 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 145 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
146 | #if QT_VERSION >= 300 | 146 | #if QT_VERSION >= 300 |
147 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 147 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) |
148 | #else | 148 | #else |
149 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 149 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) |
150 | #endif | 150 | #endif |
151 | { | 151 | { |
152 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 152 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
153 | continue; | 153 | break; |
154 | } | 154 | } |
155 | } | 155 | } |
156 | } | 156 | } |
157 | } | 157 | } |
158 | // Sometimes the background pixmap gets messed up when we add lots | 158 | // Sometimes the background pixmap gets messed up when we add lots |
159 | // of items. | 159 | // of items. |
160 | mListView->repaint(); | 160 | mListView->repaint(); |
161 | emit selected(QString::null); | 161 | emit selected(QString::null); |
162 | 162 | ||
163 | } | 163 | } |
164 | void KAddressBookTableView::writeConfig(KConfig *config) | 164 | void KAddressBookTableView::writeConfig(KConfig *config) |
165 | { | 165 | { |
166 | KAddressBookView::writeConfig(config); | 166 | KAddressBookView::writeConfig(config); |
167 | 167 | ||
168 | mListView->saveLayout(config, config->group()); | 168 | mListView->saveLayout(config, config->group()); |
169 | } | 169 | } |
170 | 170 | ||
171 | void KAddressBookTableView::readConfig(KConfig *config) | 171 | void KAddressBookTableView::readConfig(KConfig *config) |
172 | { | 172 | { |
173 | KAddressBookView::readConfig( config ); | 173 | KAddressBookView::readConfig( config ); |
174 | // The config could have changed the fields, so we need to reconstruct | 174 | // The config could have changed the fields, so we need to reconstruct |
175 | // the listview. | 175 | // the listview. |
176 | reconstructListView(); | 176 | reconstructListView(); |
177 | 177 | ||
178 | // costum colors? | 178 | // costum colors? |
179 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) | 179 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) |
180 | { | 180 | { |
181 | QPalette p( mListView->palette() ); | 181 | QPalette p( mListView->palette() ); |
182 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); | 182 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); |
183 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); | 183 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); |
184 | c = p.color(QPalette::Normal, QColorGroup::Text ); | 184 | c = p.color(QPalette::Normal, QColorGroup::Text ); |
185 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); | 185 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); |