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.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp
index 8d61582..aa242b7 100644
--- a/core/pim/addressbook/abview.cpp
+++ b/core/pim/addressbook/abview.cpp
@@ -7,29 +7,29 @@
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**
**********************************************************************/
#include "abview.h"
-#include <qlayout.h>
+#include <opie2/ocontactaccessbackend_vcard.h>
#include <qpe/global.h>
-#include <opie/ocontactaccessbackend_vcard.h>
+#include <qlayout.h>
#include <assert.h>
// Is defined in LibQPE
extern QString categoryFileName();
QString addressbookPersonalVCardName()
{
QString filename = Global::applicationFileName("addressbook",
"businesscard.vcf");
return filename;
@@ -44,25 +44,25 @@ AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ):
m_curr_category( -1 ),
m_curr_View( TableView ),
m_prev_View( TableView ),
m_curr_Contact ( 0 ),
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 );
+ m_contactdb = new Opie::OPimContactAccess ( "addressbook", 0l, 0l, false );
m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available
mCat.load( categoryFileName() );
// Create Layout and put WidgetStack into it.
QVBoxLayout *vb = new QVBoxLayout( this );
m_viewStack = new QWidgetStack( this );
vb->addWidget( m_viewStack );
// Creat TableView
QVBox* tableBox = new QVBox( m_viewStack );
m_abTable = new AbTable( m_orderedFields, tableBox, "table" );
m_abTable->setCurrentCell( 0, 0 );
@@ -95,49 +95,49 @@ AbView::~AbView()
delete m_storedDB;
}
}
void AbView::setView( Views view )
{
qWarning("AbView::setView( Views view )");
m_curr_View = view;
load();
}
-void AbView::addEntry( const OContact &newContact )
+void AbView::addEntry( const Opie::OPimContact &newContact )
{
qWarning("abview:AddContact");
m_contactdb->add ( newContact );
load();
}
void AbView::removeEntry( const int UID )
{
qWarning("abview:RemoveContact");
m_contactdb->remove( UID );
load();
}
-void AbView::replaceEntry( const OContact &contact )
+void AbView::replaceEntry( const Opie::OPimContact &contact )
{
qWarning("abview:ReplaceContact");
m_contactdb->replace( contact );
load();
}
-OContact AbView::currentEntry()
+Opie::OPimContact AbView::currentEntry()
{
- OContact currentContact;
+ Opie::OPimContact currentContact;
switch ( (int) m_curr_View ) {
case TableView:
currentContact = m_abTable -> currentEntry();
break;
case CardView:
currentContact = m_ablabel -> currentEntry();
break;
}
m_curr_Contact = currentContact.uid();
return currentContact;
}
@@ -219,48 +219,48 @@ void AbView::setShowToView( Views view )
updateView();
}
}
void AbView::setShowByLetter( char c, AbConfig::LPSearchMode mode )
{
qWarning("void AbView::setShowByLetter( %c, %d )", c, mode );
assert( mode < AbConfig::LASTELEMENT );
- OContact query;
+ Opie::OPimContact query;
if ( c == 0 ){
load();
return;
}else{
// If the current Backend is unable to solve the query, we will
// ignore the request ..
- if ( ! m_contactdb->hasQuerySettings( OContactAccess::WildCards | OContactAccess::IgnoreCase ) ){
+ if ( ! m_contactdb->hasQuerySettings( Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase ) ){
return;
}
switch( mode ){
case AbConfig::LastName:
query.setLastName( QString("%1*").arg(c) );
break;
case AbConfig::FileAs:
query.setFileAs( QString("%1*").arg(c) );
break;
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 );
+ m_list = m_contactdb->queryByExample( query, Opie::OPimContactAccess::WildCards | Opie::OPimContactAccess::IgnoreCase );
if ( m_curr_category != -1 )
clearForCategory();
m_curr_Contact = 0;
}
updateView( true );
}
void AbView::setListOrder( const QValueList<int>& ordered )
{
m_orderedFields = ordered;
if ( m_abTable ){
m_abTable->setOrderedList( ordered );
@@ -280,27 +280,27 @@ void AbView::showPersonal( bool personal )
qWarning ("void AbView::showPersonal( %d )", personal);
if ( personal ){
if ( m_inPersonal )
return;
// Now switch to vCard Backend and load data.
// The current default backend will be stored
// to avoid unneeded load/stores.
m_storedDB = m_contactdb;
- OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
+ Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
addressbookPersonalVCardName() );
- m_contactdb = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
+ m_contactdb = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
m_inPersonal = true;
m_curr_View = CardView;
}else{
if ( !m_inPersonal )
return;
// Remove vCard Backend and restore default
m_contactdb->save();
delete m_contactdb;
@@ -392,42 +392,42 @@ void AbView::slotSwitch(){
qWarning("Switching to TableView");
m_curr_View = TableView;
break;
}
updateView();
}
// END: Slots
void AbView::clearForCategory()
{
- OContactAccess::List::Iterator it;
+ Opie::OPimContactAccess::List::Iterator it;
// Now remove all contacts with wrong category if any category selected
- OContactAccess::List allList = m_list;
+ Opie::OPimContactAccess::List allList = m_list;
if ( m_curr_category != -1 ){
for ( it = allList.begin(); it != allList.end(); ++it ){
if ( !contactCompare( *it, m_curr_category ) ){
// qWarning("Removing %d", (*it).uid());
m_list.remove( (*it).uid() );
}
}
}
}
-bool AbView::contactCompare( const OContact &cnt, int category )
+bool AbView::contactCompare( const Opie::OPimContact &cnt, int category )
{
- // qWarning ("bool AbView::contactCompare( const OContact &cnt, %d )", category);
+ // qWarning ("bool AbView::contactCompare( const Opie::OPimContact &cnt, %d )", category);
bool returnMe;
QArray<int> cats;
cats = cnt.categories();
// qWarning ("Number of categories: %d", cats.count() );
returnMe = false;
if ( cats.count() == 0 && category == 0 )
// Contacts with no category will just shown on "All" and "Unfiled"
returnMe = true;
else {