-rw-r--r-- | core/pim/addressbook/abview.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 34035fd..8a2db96 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -128,69 +128,79 @@ void AbView::replaceEntry( const Opie::OPimContact &contact ) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | Opie::OPimContact AbView::currentEntry() | 130 | Opie::OPimContact AbView::currentEntry() |
131 | { | 131 | { |
132 | Opie::OPimContact currentContact; | 132 | Opie::OPimContact currentContact; |
133 | 133 | ||
134 | switch ( (int) m_curr_View ) { | 134 | switch ( (int) m_curr_View ) { |
135 | case TableView: | 135 | case TableView: |
136 | currentContact = m_abTable -> currentEntry(); | 136 | currentContact = m_abTable -> currentEntry(); |
137 | break; | 137 | break; |
138 | case CardView: | 138 | case CardView: |
139 | currentContact = m_ablabel -> currentEntry(); | 139 | currentContact = m_ablabel -> currentEntry(); |
140 | break; | 140 | break; |
141 | } | 141 | } |
142 | m_curr_Contact = currentContact.uid(); | 142 | m_curr_Contact = currentContact.uid(); |
143 | return currentContact; | 143 | return currentContact; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool AbView::save() | 146 | bool AbView::save() |
147 | { | 147 | { |
148 | //odebug << "AbView::Save data" << oendl; | 148 | //odebug << "AbView::Save data" << oendl; |
149 | 149 | ||
150 | return m_contactdb->save(); | 150 | return m_contactdb->save(); |
151 | } | 151 | } |
152 | 152 | ||
153 | void AbView::load() | 153 | void AbView::load() |
154 | { | 154 | { |
155 | odebug << "AbView::Load data" << oendl; | 155 | odebug << "AbView::Load data" << oendl; |
156 | 156 | ||
157 | // Letter Search is stopped at this place | 157 | // Letter Search is stopped at this place |
158 | emit signalClearLetterPicker(); | 158 | emit signalClearLetterPicker(); |
159 | 159 | ||
160 | m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, | 160 | odebug << "selected Category: " << m_curr_category << oendl; |
161 | Opie::OPimContactAccess::FilterCategory, m_curr_category ); | 161 | |
162 | 162 | if ( m_curr_category == -1 ) { | |
163 | // if ( m_curr_category != -1 ) | 163 | // Show just unfiled contacts |
164 | // clearForCategory(); | 164 | m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, |
165 | Opie::OPimContactAccess::DoNotShowWithCategory, 0 ); | ||
166 | } elseif ( m_curr_category == 0 ){ | ||
167 | // Just show all contacts | ||
168 | m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, | ||
169 | Opie::OPimBase::FilterOff, 0 ); | ||
170 | } else { | ||
171 | // Show contacts with given categories | ||
172 | m_list = m_contactdb->sorted( true, Opie::OPimContactAccess::SortFileAsName, | ||
173 | Opie::OPimBase::FilterCategory, m_curr_category ); | ||
174 | } | ||
165 | 175 | ||
166 | odebug << "Number of contacts: " << m_list.count() << oendl; | 176 | odebug << "Number of contacts: " << m_list.count() << oendl; |
167 | 177 | ||
168 | updateView( true ); | 178 | updateView( true ); |
169 | 179 | ||
170 | } | 180 | } |
171 | 181 | ||
172 | void AbView::reload() | 182 | void AbView::reload() |
173 | { | 183 | { |
174 | odebug << "AbView::::reload()" << oendl; | 184 | odebug << "AbView::::reload()" << oendl; |
175 | 185 | ||
176 | m_contactdb->reload(); | 186 | m_contactdb->reload(); |
177 | load(); | 187 | load(); |
178 | } | 188 | } |
179 | 189 | ||
180 | void AbView::clear() | 190 | void AbView::clear() |
181 | { | 191 | { |
182 | // :SX | 192 | // :SX |
183 | } | 193 | } |
184 | 194 | ||
185 | void AbView::setShowByCategory( const QString& cat ) | 195 | void AbView::setShowByCategory( const QString& cat ) |
186 | { | 196 | { |
187 | odebug << "AbView::setShowCategory( const QString& cat )" << oendl; | 197 | odebug << "AbView::setShowCategory( const QString& cat )" << oendl; |
188 | 198 | ||
189 | int intCat = 0; | 199 | int intCat = 0; |
190 | 200 | ||
191 | // Unfiled will be stored as -1 | 201 | // Unfiled will be stored as -1 |
192 | if ( cat == tr( "Unfiled" ) ) | 202 | if ( cat == tr( "Unfiled" ) ) |
193 | intCat = -1; | 203 | intCat = -1; |
194 | else if ( cat.isNull() ) | 204 | else if ( cat.isNull() ) |
195 | intCat = 0; | 205 | intCat = 0; |
196 | else | 206 | else |