summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 8a5f9d5..9ae66d1 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -20,16 +20,16 @@
#define QTOPIA_INTERNAL_FD
// #include "addresssettings.h"
#include "addressbook.h"
-#include <opie/ofileselector.h>
-#include <opie/ofiledialog.h>
-#include <opie/ocontact.h>
-#include <opie/ocontactaccessbackend_vcard.h>
+#include <opie2/ofileselector.h>
+#include <opie2/ofiledialog.h>
+#include <opie2/opimcontact.h>
+#include <opie2/ocontactaccessbackend_vcard.h>
#include <qpe/resource.h>
#include <qpe/ir.h>
#include <qpe/qpemessagebox.h>
#include <qmenubar.h>
// #include <qtoolbar.h>
@@ -314,29 +314,29 @@ void AddressbookWindow::slotSetFont( int size )
}
}
void AddressbookWindow::importvCard() {
- QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this );
+ QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/");//,"", "*", this );
if(!str.isEmpty() ){
setDocument((const QString&) str );
}
}
void AddressbookWindow::exportvCard()
{
qWarning(" void AddressbookWindow::exportvCard()");
- QString filename = OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this );
+ QString filename = Opie::Ui::OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this );
if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){
qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 );
- OContact curCont = m_abView->currentEntry();
+ Opie::OPimContact curCont = m_abView->currentEntry();
if ( !curCont.isEmpty() ){
- OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
+ Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
filename );
- OContactAccess* access = new OContactAccess ( "addressbook_exp", QString::null , vcard_backend, true );
+ Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook_exp", QString::null , vcard_backend, true );
if ( access ){
access->add( curCont );
access->save();
}
delete access;
}else
@@ -368,26 +368,26 @@ void AddressbookWindow::setDocument( const QString &filename )
qWarning("NO clicked");
return;
break;
}
}
- OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
+ Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
filename );
- OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
- OContactAccess::List allList = access->allRecords();
+ Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
+ Opie::OPimContactAccess::List allList = access->allRecords();
qWarning( "Found number of contacts in File: %d", allList.count() );
if ( !allList.count() ) {
QMessageBox::information( this, "Import VCard",
"It was impossible to import\nthe VCard.\n"
"The VCard may be corrupted!" );
}
bool doAsk = true;
- OContactAccess::List::Iterator it;
+ Opie::OPimContactAccess::List::Iterator it;
for ( it = allList.begin(); it != allList.end(); ++it ){
qWarning("Adding Contact from: %s", (*it).fullName().latin1() );
if ( doAsk ){
switch( QMessageBox::information( this, tr ( "Add Contact?" ),
tr( "Do you really want add contact for \n%1?" )
.arg( (*it).fullName().latin1() ),
@@ -430,19 +430,19 @@ AddressbookWindow::~AddressbookWindow()
m_config.setToolBarDock( dock );
m_config.save();
}
void AddressbookWindow::slotUpdateToolbar()
{
- OContact ce = m_abView->currentEntry();
+ Opie::OPimContact ce = m_abView->currentEntry();
actionMail->setEnabled( !ce.defaultEmail().isEmpty() );
}
void AddressbookWindow::slotListNew()
{
- OContact cnt;
+ Opie::OPimContact cnt;
if( !syncing ) {
editEntry( NewEntry );
} else {
QMessageBox::warning(this, tr("Contacts"),
tr("Can not edit data, currently syncing"));
}
@@ -455,13 +455,13 @@ void AddressbookWindow::slotListNew()
// //:SX showView();
// }
void AddressbookWindow::slotListDelete()
{
if(!syncing) {
- OContact tmpEntry = m_abView ->currentEntry();
+ Opie::OPimContact tmpEntry = m_abView ->currentEntry();
// get a name, do the best we can...
QString strName = tmpEntry.fullName();
if ( strName.isEmpty() ) {
strName = tmpEntry.company();
if ( strName.isEmpty() )
@@ -522,13 +522,13 @@ void AddressbookWindow::slotViewEdit()
}
void AddressbookWindow::writeMail()
{
- OContact c = m_abView -> currentEntry();
+ Opie::OPimContact c = m_abView -> currentEntry();
QString name = c.fileAs();
QString email = c.defaultEmail();
// I prefer the OPIE-Environment variable before the
// QPE-one..
QString basepath = QString::fromLatin1( getenv("OPIEDIR") );
@@ -562,32 +562,32 @@ void AddressbookWindow::writeMail()
static const char * beamfile = "/tmp/obex/contact.vcf";
void AddressbookWindow::slotBeam()
{
QString beamFilename;
- OContact c;
+ Opie::OPimContact c;
if ( actionPersonal->isOn() ) {
beamFilename = addressbookPersonalVCardName();
if ( !QFile::exists( beamFilename ) )
return; // can't beam a non-existent file
- OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
+ Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
beamFilename );
- OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
- OContactAccess::List allList = access->allRecords();
- OContactAccess::List::Iterator it = allList.begin(); // Just take first
+ Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
+ Opie::OPimContactAccess::List allList = access->allRecords();
+ Opie::OPimContactAccess::List::Iterator it = allList.begin(); // Just take first
c = *it;
delete access;
} else {
unlink( beamfile ); // delete if exists
mkdir("/tmp/obex/", 0755);
c = m_abView -> currentEntry();
- OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null,
+ Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
beamfile );
- OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true );
+ Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
access->add( c );
access->save();
delete access;
beamFilename = beamfile;
}
@@ -649,13 +649,13 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
close();
} else if ( msg == "addContact(QString,QString)" ) {
QDataStream stream(data,IO_ReadOnly);
QString name, email;
stream >> name >> email;
- OContact cnt;
+ Opie::OPimContact cnt;
QString fn, mn, ln;
parseName( name, &fn, &mn, &ln );
// qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() );
cnt.setFirstName( fn );
cnt.setMiddleName( mn );
cnt.setLastName( ln );
@@ -719,13 +719,13 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
QPEApplication::setKeepRunning();
}
void AddressbookWindow::editEntry( EntryMode entryMode )
{
- OContact entry;
+ Opie::OPimContact entry;
if ( !abEditor ) {
abEditor = new ContactEditor( entry, this, "editor" );
}
if ( entryMode == EditEntry )
abEditor->setEntry( m_abView -> currentEntry() );
else if ( entryMode == NewEntry )
@@ -735,18 +735,18 @@ void AddressbookWindow::editEntry( EntryMode entryMode )
// fix the foxus...
abEditor->setNameFocus();
if ( QPEApplication::execDialog( abEditor ) ) {
setFocus();
if ( entryMode == NewEntry ) {
- OContact insertEntry = abEditor->entry();
+ Opie::OPimContact insertEntry = abEditor->entry();
insertEntry.assignUid();
m_abView -> addEntry( insertEntry );
m_abView -> setCurrentUid( insertEntry.uid() );
} else {
- OContact replEntry = abEditor->entry();
+ Opie::OPimContact replEntry = abEditor->entry();
if ( !replEntry.isValidUid() )
replEntry.assignUid();
m_abView -> replaceEntry( replEntry );
}
@@ -754,13 +754,13 @@ void AddressbookWindow::editEntry( EntryMode entryMode )
// populateCategories();
}
void AddressbookWindow::editPersonal()
{
- OContact entry;
+ Opie::OPimContact entry;
// Switch to personal view if not selected
// but take care of the menu, too
if ( ! actionPersonal->isOn() ){
qWarning("*** ++++");
actionPersonal->setOn( true );