summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/abview.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp
index 477f85b..6cbd556 100644
--- a/core/pim/addressbook/abview.cpp
+++ b/core/pim/addressbook/abview.cpp
@@ -51,6 +51,7 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ):
51 m_abTable( 0l ), 51 m_abTable( 0l ),
52 m_orderedFields( ordered ) 52 m_orderedFields( ordered )
53{ 53{
54 qWarning("AbView::c'tor");
54 // Load default database and handle syncing myself.. ! 55 // Load default database and handle syncing myself.. !
55 m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ), 56 m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ),
56 mCat.load( categoryFileName() ); 57 mCat.load( categoryFileName() );
@@ -97,28 +98,28 @@ AbView::~AbView()
97 98
98void AbView::setView( Views view ) 99void AbView::setView( Views view )
99{ 100{
100 //qWarning("AbView::setView( Views view )"); 101 qWarning("AbView::setView( Views view )");
101 m_curr_View = view; 102 m_curr_View = view;
102 load(); 103 load();
103} 104}
104 105
105void AbView::addEntry( const OContact &newContact ) 106void AbView::addEntry( const OContact &newContact )
106{ 107{
107 //qWarning("abview:AddContact"); 108 qWarning("abview:AddContact");
108 m_contactdb->add ( newContact ); 109 m_contactdb->add ( newContact );
109 load(); 110 load();
110 111
111} 112}
112void AbView::removeEntry( const int UID ) 113void AbView::removeEntry( const int UID )
113{ 114{
114 //qWarning("abview:RemoveContact"); 115 qWarning("abview:RemoveContact");
115 m_contactdb->remove( UID ); 116 m_contactdb->remove( UID );
116 load(); 117 load();
117} 118}
118 119
119void AbView::replaceEntry( const OContact &contact ) 120void AbView::replaceEntry( const OContact &contact )
120{ 121{
121 //qWarning("abview:ReplaceContact"); 122 qWarning("abview:ReplaceContact");
122 m_contactdb->replace( contact ); 123 m_contactdb->replace( contact );
123 load(); 124 load();
124 125
@@ -149,7 +150,7 @@ bool AbView::save()
149 150
150void AbView::load() 151void AbView::load()
151{ 152{
152 //qWarning("abView:Load data"); 153 qWarning("abView:Load data");
153 154
154 // Letter Search is stopped at this place 155 // Letter Search is stopped at this place
155 emit signalClearLetterPicker(); 156 emit signalClearLetterPicker();
@@ -159,6 +160,7 @@ void AbView::load()
159 m_list = m_contactdb->allRecords(); 160 m_list = m_contactdb->allRecords();
160 else{ 161 else{
161 m_list = m_contactdb->sorted( true, 0, 0, 0 ); 162 m_list = m_contactdb->sorted( true, 0, 0, 0 );
163 if ( m_curr_category != -1 )
162 clearForCategory(); 164 clearForCategory();
163 } 165 }
164 166
@@ -170,7 +172,7 @@ void AbView::load()
170 172
171void AbView::reload() 173void AbView::reload()
172{ 174{
173 //qWarning( "void AbView::reload()" ); 175 qWarning( "void AbView::reload()" );
174 176
175 m_contactdb->reload(); 177 m_contactdb->reload();
176 load(); 178 load();
@@ -183,7 +185,7 @@ void AbView::clear()
183 185
184void AbView::setShowByCategory( const QString& cat ) 186void AbView::setShowByCategory( const QString& cat )
185{ 187{
186 //qWarning("AbView::setShowCategory( const QString& cat )"); 188 qWarning("AbView::setShowCategory( const QString& cat )");
187 189
188 int intCat = 0; 190 int intCat = 0;
189 191
@@ -207,11 +209,10 @@ void AbView::setShowByCategory( const QString& cat )
207 209
208void AbView::setShowToView( Views view ) 210void AbView::setShowToView( Views view )
209{ 211{
210 //qWarning("void AbView::setShowToView( View %d )", view); 212 qWarning("void AbView::setShowToView( View %d )", view);
211
212 //qWarning ("Change the View (Category is: %d)", m_curr_category);
213 213
214 if ( m_curr_View != view ){ 214 if ( m_curr_View != view ){
215 qWarning ("Change the View (Category is: %d)", m_curr_category);
215 m_prev_View = m_curr_View; 216 m_prev_View = m_curr_View;
216 m_curr_View = view; 217 m_curr_View = view;
217 218
@@ -250,6 +251,7 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode )
250 return; 251 return;
251 } 252 }
252 m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase ); 253 m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase );
254 if ( m_curr_category != -1 )
253 clearForCategory(); 255 clearForCategory();
254 m_curr_Contact = 0; 256 m_curr_Contact = 0;
255 } 257 }
@@ -274,7 +276,7 @@ QString AbView::showCategory() const
274 276
275void AbView::showPersonal( bool personal ) 277void AbView::showPersonal( bool personal )
276{ 278{
277 //qWarning ("void AbView::showPersonal( %d )", personal); 279 qWarning ("void AbView::showPersonal( %d )", personal);
278 280
279 if ( personal ){ 281 if ( personal ){
280 282
@@ -362,6 +364,7 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp,
362 // Now remove all contacts with wrong category (if any selected) 364 // Now remove all contacts with wrong category (if any selected)
363 // This algorithm is a litte bit ineffective, but 365 // This algorithm is a litte bit ineffective, but
364 // we will not have a lot of matching entries.. 366 // we will not have a lot of matching entries..
367 if ( m_curr_category != -1 )
365 clearForCategory(); 368 clearForCategory();
366 369
367 // Now show all found entries 370 // Now show all found entries