summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Unidiff
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
@@ -23,10 +23,10 @@
23#include "addressbook.h" 23#include "addressbook.h"
24 24
25 25
26#include <opie/ofileselector.h> 26#include <opie2/ofileselector.h>
27#include <opie/ofiledialog.h> 27#include <opie2/ofiledialog.h>
28#include <opie/ocontact.h> 28#include <opie2/opimcontact.h>
29#include <opie/ocontactaccessbackend_vcard.h> 29#include <opie2/ocontactaccessbackend_vcard.h>
30 30
31#include <qpe/resource.h> 31#include <qpe/resource.h>
32#include <qpe/ir.h> 32#include <qpe/ir.h>
@@ -317,7 +317,7 @@ void AddressbookWindow::slotSetFont( int size )
317 317
318 318
319void AddressbookWindow::importvCard() { 319void AddressbookWindow::importvCard() {
320 QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this ); 320 QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/");//,"", "*", this );
321 if(!str.isEmpty() ){ 321 if(!str.isEmpty() ){
322 setDocument((const QString&) str ); 322 setDocument((const QString&) str );
323 } 323 }
@@ -326,14 +326,14 @@ void AddressbookWindow::importvCard() {
326void AddressbookWindow::exportvCard() 326void AddressbookWindow::exportvCard()
327{ 327{
328 qWarning(" void AddressbookWindow::exportvCard()"); 328 qWarning(" void AddressbookWindow::exportvCard()");
329 QString filename = OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this ); 329 QString filename = Opie::Ui::OFileDialog::getSaveFileName( 1,"/home/"); //,"", "*", this );
330 if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){ 330 if( !filename.isEmpty() && ( filename[filename.length()-1] != '/' ) ){
331 qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 ); 331 qWarning(" Save to file %s, (%d)", filename.latin1(), filename.length()-1 );
332 OContact curCont = m_abView->currentEntry(); 332 Opie::OPimContact curCont = m_abView->currentEntry();
333 if ( !curCont.isEmpty() ){ 333 if ( !curCont.isEmpty() ){
334 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 334 Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
335 filename ); 335 filename );
336 OContactAccess* access = new OContactAccess ( "addressbook_exp", QString::null , vcard_backend, true ); 336 Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook_exp", QString::null , vcard_backend, true );
337 if ( access ){ 337 if ( access ){
338 access->add( curCont ); 338 access->add( curCont );
339 access->save(); 339 access->save();
@@ -371,10 +371,10 @@ void AddressbookWindow::setDocument( const QString &filename )
371 } 371 }
372 } 372 }
373 373
374 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 374 Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
375 filename ); 375 filename );
376 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 376 Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
377 OContactAccess::List allList = access->allRecords(); 377 Opie::OPimContactAccess::List allList = access->allRecords();
378 qWarning( "Found number of contacts in File: %d", allList.count() ); 378 qWarning( "Found number of contacts in File: %d", allList.count() );
379 379
380 if ( !allList.count() ) { 380 if ( !allList.count() ) {
@@ -384,7 +384,7 @@ void AddressbookWindow::setDocument( const QString &filename )
384 } 384 }
385 385
386 bool doAsk = true; 386 bool doAsk = true;
387 OContactAccess::List::Iterator it; 387 Opie::OPimContactAccess::List::Iterator it;
388 for ( it = allList.begin(); it != allList.end(); ++it ){ 388 for ( it = allList.begin(); it != allList.end(); ++it ){
389 qWarning("Adding Contact from: %s", (*it).fullName().latin1() ); 389 qWarning("Adding Contact from: %s", (*it).fullName().latin1() );
390 if ( doAsk ){ 390 if ( doAsk ){
@@ -433,13 +433,13 @@ AddressbookWindow::~AddressbookWindow()
433 433
434void AddressbookWindow::slotUpdateToolbar() 434void AddressbookWindow::slotUpdateToolbar()
435{ 435{
436 OContact ce = m_abView->currentEntry(); 436 Opie::OPimContact ce = m_abView->currentEntry();
437 actionMail->setEnabled( !ce.defaultEmail().isEmpty() ); 437 actionMail->setEnabled( !ce.defaultEmail().isEmpty() );
438} 438}
439 439
440void AddressbookWindow::slotListNew() 440void AddressbookWindow::slotListNew()
441{ 441{
442 OContact cnt; 442 Opie::OPimContact cnt;
443 if( !syncing ) { 443 if( !syncing ) {
444 editEntry( NewEntry ); 444 editEntry( NewEntry );
445 } else { 445 } else {
@@ -458,7 +458,7 @@ void AddressbookWindow::slotListNew()
458void AddressbookWindow::slotListDelete() 458void AddressbookWindow::slotListDelete()
459{ 459{
460 if(!syncing) { 460 if(!syncing) {
461 OContact tmpEntry = m_abView ->currentEntry(); 461 Opie::OPimContact tmpEntry = m_abView ->currentEntry();
462 462
463 // get a name, do the best we can... 463 // get a name, do the best we can...
464 QString strName = tmpEntry.fullName(); 464 QString strName = tmpEntry.fullName();
@@ -525,7 +525,7 @@ void AddressbookWindow::slotViewEdit()
525 525
526void AddressbookWindow::writeMail() 526void AddressbookWindow::writeMail()
527{ 527{
528 OContact c = m_abView -> currentEntry(); 528 Opie::OPimContact c = m_abView -> currentEntry();
529 QString name = c.fileAs(); 529 QString name = c.fileAs();
530 QString email = c.defaultEmail(); 530 QString email = c.defaultEmail();
531 531
@@ -565,16 +565,16 @@ static const char * beamfile = "/tmp/obex/contact.vcf";
565void AddressbookWindow::slotBeam() 565void AddressbookWindow::slotBeam()
566{ 566{
567 QString beamFilename; 567 QString beamFilename;
568 OContact c; 568 Opie::OPimContact c;
569 if ( actionPersonal->isOn() ) { 569 if ( actionPersonal->isOn() ) {
570 beamFilename = addressbookPersonalVCardName(); 570 beamFilename = addressbookPersonalVCardName();
571 if ( !QFile::exists( beamFilename ) ) 571 if ( !QFile::exists( beamFilename ) )
572 return; // can't beam a non-existent file 572 return; // can't beam a non-existent file
573 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 573 Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
574 beamFilename ); 574 beamFilename );
575 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 575 Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
576 OContactAccess::List allList = access->allRecords(); 576 Opie::OPimContactAccess::List allList = access->allRecords();
577 OContactAccess::List::Iterator it = allList.begin(); // Just take first 577 Opie::OPimContactAccess::List::Iterator it = allList.begin(); // Just take first
578 c = *it; 578 c = *it;
579 579
580 delete access; 580 delete access;
@@ -582,9 +582,9 @@ void AddressbookWindow::slotBeam()
582 unlink( beamfile ); // delete if exists 582 unlink( beamfile ); // delete if exists
583 mkdir("/tmp/obex/", 0755); 583 mkdir("/tmp/obex/", 0755);
584 c = m_abView -> currentEntry(); 584 c = m_abView -> currentEntry();
585 OContactAccessBackend* vcard_backend = new OContactAccessBackend_VCard( QString::null, 585 Opie::OPimContactAccessBackend* vcard_backend = new Opie::OPimContactAccessBackend_VCard( QString::null,
586 beamfile ); 586 beamfile );
587 OContactAccess* access = new OContactAccess ( "addressbook", QString::null , vcard_backend, true ); 587 Opie::OPimContactAccess* access = new Opie::OPimContactAccess ( "addressbook", QString::null , vcard_backend, true );
588 access->add( c ); 588 access->add( c );
589 access->save(); 589 access->save();
590 delete access; 590 delete access;
@@ -652,7 +652,7 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
652 QString name, email; 652 QString name, email;
653 stream >> name >> email; 653 stream >> name >> email;
654 654
655 OContact cnt; 655 Opie::OPimContact cnt;
656 QString fn, mn, ln; 656 QString fn, mn, ln;
657 parseName( name, &fn, &mn, &ln ); 657 parseName( name, &fn, &mn, &ln );
658 // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() ); 658 // qDebug( " %s - %s - %s", fn.latin1(), mn.latin1(), ln.latin1() );
@@ -722,7 +722,7 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
722 722
723void AddressbookWindow::editEntry( EntryMode entryMode ) 723void AddressbookWindow::editEntry( EntryMode entryMode )
724{ 724{
725 OContact entry; 725 Opie::OPimContact entry;
726 if ( !abEditor ) { 726 if ( !abEditor ) {
727 abEditor = new ContactEditor( entry, this, "editor" ); 727 abEditor = new ContactEditor( entry, this, "editor" );
728 } 728 }
@@ -738,12 +738,12 @@ void AddressbookWindow::editEntry( EntryMode entryMode )
738 if ( QPEApplication::execDialog( abEditor ) ) { 738 if ( QPEApplication::execDialog( abEditor ) ) {
739 setFocus(); 739 setFocus();
740 if ( entryMode == NewEntry ) { 740 if ( entryMode == NewEntry ) {
741 OContact insertEntry = abEditor->entry(); 741 Opie::OPimContact insertEntry = abEditor->entry();
742 insertEntry.assignUid(); 742 insertEntry.assignUid();
743 m_abView -> addEntry( insertEntry ); 743 m_abView -> addEntry( insertEntry );
744 m_abView -> setCurrentUid( insertEntry.uid() ); 744 m_abView -> setCurrentUid( insertEntry.uid() );
745 } else { 745 } else {
746 OContact replEntry = abEditor->entry(); 746 Opie::OPimContact replEntry = abEditor->entry();
747 747
748 if ( !replEntry.isValidUid() ) 748 if ( !replEntry.isValidUid() )
749 replEntry.assignUid(); 749 replEntry.assignUid();
@@ -757,7 +757,7 @@ void AddressbookWindow::editEntry( EntryMode entryMode )
757 757
758void AddressbookWindow::editPersonal() 758void AddressbookWindow::editPersonal()
759{ 759{
760 OContact entry; 760 Opie::OPimContact entry;
761 761
762 // Switch to personal view if not selected 762 // Switch to personal view if not selected
763 // but take care of the menu, too 763 // but take care of the menu, too