summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abview.cpp
Side-by-side diff
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
@@ -48,12 +48,13 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ):
m_contactdb ( 0l ),
m_storedDB ( 0l ),
m_viewStack( 0l ),
m_abTable( 0l ),
m_orderedFields( ordered )
{
+ qWarning("AbView::c'tor");
// Load default database and handle syncing myself.. !
m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ),
mCat.load( categoryFileName() );
// Create Layout and put WidgetStack into it.
QVBoxLayout *vb = new QVBoxLayout( this );
@@ -94,34 +95,34 @@ AbView::~AbView()
}
}
void AbView::setView( Views view )
{
- // qWarning("AbView::setView( Views view )");
+ qWarning("AbView::setView( Views view )");
m_curr_View = view;
load();
}
void AbView::addEntry( const OContact &newContact )
{
- // qWarning("abview:AddContact");
+ qWarning("abview:AddContact");
m_contactdb->add ( newContact );
load();
}
void AbView::removeEntry( const int UID )
{
- // qWarning("abview:RemoveContact");
+ qWarning("abview:RemoveContact");
m_contactdb->remove( UID );
load();
}
void AbView::replaceEntry( const OContact &contact )
{
- // qWarning("abview:ReplaceContact");
+ qWarning("abview:ReplaceContact");
m_contactdb->replace( contact );
load();
}
OContact AbView::currentEntry()
@@ -146,47 +147,48 @@ bool AbView::save()
return m_contactdb->save();
}
void AbView::load()
{
- // qWarning("abView:Load data");
+ qWarning("abView:Load data");
// Letter Search is stopped at this place
emit signalClearLetterPicker();
if ( m_inPersonal )
// VCard Backend does not sort..
m_list = m_contactdb->allRecords();
else{
m_list = m_contactdb->sorted( true, 0, 0, 0 );
+ if ( m_curr_category != -1 )
clearForCategory();
}
qWarning ("Number of contacts: %d", m_list.count());
updateView( true );
}
void AbView::reload()
{
- // qWarning( "void AbView::reload()" );
+ qWarning( "void AbView::reload()" );
m_contactdb->reload();
load();
}
void AbView::clear()
{
// :SX
}
void AbView::setShowByCategory( const QString& cat )
{
- // qWarning("AbView::setShowCategory( const QString& cat )");
+ qWarning("AbView::setShowCategory( const QString& cat )");
int intCat = 0;
// All (cat == NULL) will be stored as -1
if ( cat.isNull() )
intCat = -1;
@@ -204,17 +206,16 @@ void AbView::setShowByCategory( const QString& cat )
}
}
void AbView::setShowToView( Views view )
{
- // qWarning("void AbView::setShowToView( View %d )", view);
-
- // qWarning ("Change the View (Category is: %d)", m_curr_category);
+ qWarning("void AbView::setShowToView( View %d )", view);
if ( m_curr_View != view ){
+ qWarning ("Change the View (Category is: %d)", m_curr_category);
m_prev_View = m_curr_View;
m_curr_View = view;
updateView();
}
@@ -247,12 +248,13 @@ void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode )
default:
qWarning( "Unknown Searchmode for AbView::setShowByLetter ! -> %d", mode );
qWarning( "I will ignore it.." );
return;
}
m_list = m_contactdb->queryByExample( query, OContactAccess::WildCards | OContactAccess::IgnoreCase );
+ if ( m_curr_category != -1 )
clearForCategory();
m_curr_Contact = 0;
}
updateView( true );
}
@@ -271,13 +273,13 @@ QString AbView::showCategory() const
{
return mCat.label( "Contacts", m_curr_category );
}
void AbView::showPersonal( bool personal )
{
- // qWarning ("void AbView::showPersonal( %d )", personal);
+ qWarning ("void AbView::showPersonal( %d )", personal);
if ( personal ){
if ( m_inPersonal )
return;
@@ -359,12 +361,13 @@ void AbView::slotDoFind( const QString &str, bool caseSensitive, bool useRegExp,
return;
}
// Now remove all contacts with wrong category (if any selected)
// This algorithm is a litte bit ineffective, but
// we will not have a lot of matching entries..
+ if ( m_curr_category != -1 )
clearForCategory();
// Now show all found entries
updateView( true );
}