summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index cd833cf..b107e2d 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1582,99 +1582,99 @@ void KABCore::extensionModified( const KABC::Addressee::List &list )
1582 1582
1583} 1583}
1584 1584
1585QString KABCore::getNameByPhone( const QString &phone ) 1585QString KABCore::getNameByPhone( const QString &phone )
1586{ 1586{
1587#ifndef KAB_EMBEDDED 1587#ifndef KAB_EMBEDDED
1588 QRegExp r( "[/*/-/ ]" ); 1588 QRegExp r( "[/*/-/ ]" );
1589 QString localPhone( phone ); 1589 QString localPhone( phone );
1590 1590
1591 bool found = false; 1591 bool found = false;
1592 QString ownerName = ""; 1592 QString ownerName = "";
1593 KABC::AddressBook::Iterator iter; 1593 KABC::AddressBook::Iterator iter;
1594 KABC::PhoneNumber::List::Iterator phoneIter; 1594 KABC::PhoneNumber::List::Iterator phoneIter;
1595 KABC::PhoneNumber::List phoneList; 1595 KABC::PhoneNumber::List phoneList;
1596 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { 1596 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) {
1597 phoneList = (*iter).phoneNumbers(); 1597 phoneList = (*iter).phoneNumbers();
1598 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); 1598 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() );
1599 ++phoneIter) { 1599 ++phoneIter) {
1600 // Get rid of separator chars so just the numbers are compared. 1600 // Get rid of separator chars so just the numbers are compared.
1601 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { 1601 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) {
1602 ownerName = (*iter).formattedName(); 1602 ownerName = (*iter).formattedName();
1603 found = true; 1603 found = true;
1604 } 1604 }
1605 } 1605 }
1606 } 1606 }
1607 1607
1608 return ownerName; 1608 return ownerName;
1609#else //KAB_EMBEDDED 1609#else //KAB_EMBEDDED
1610 qDebug("KABCore::getNameByPhone finsih method"); 1610 qDebug("KABCore::getNameByPhone finsih method");
1611 return ""; 1611 return "";
1612#endif //KAB_EMBEDDED 1612#endif //KAB_EMBEDDED
1613 1613
1614} 1614}
1615void KABCore::openConfigGlobalDialog() 1615void KABCore::openConfigGlobalDialog()
1616{ 1616{
1617 KPimPrefsGlobalDialog gc ( this ); 1617 KPimPrefsGlobalDialog gc ( this );
1618 gc.exec(); 1618 gc.exec();
1619} 1619}
1620void KABCore::openConfigDialog() 1620void KABCore::openConfigDialog()
1621{ 1621{
1622 KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true); 1622 KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true);
1623 1623
1624 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog , "KCMKabConfig" ); 1624 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog , "KCMKabConfig" );
1625 ConfigureDialog->setMainWidget( kabcfg ); 1625 ConfigureDialog->setMainWidget( kabcfg );
1626 connect( ConfigureDialog, SIGNAL( applyClicked() ), 1626 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1627 this, SLOT( configurationChanged() ) ); 1627 this, SLOT( configurationChanged() ) );
1628 connect( ConfigureDialog, SIGNAL( applyClicked() ), 1628 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1629 kabcfg, SLOT( save() ) ); 1629 kabcfg, SLOT( save() ) );
1630 connect( ConfigureDialog, SIGNAL( okClicked() ), 1630 connect( ConfigureDialog, SIGNAL( acceptClicked() ),
1631 this, SLOT( configurationChanged() ) ); 1631 this, SLOT( configurationChanged() ) );
1632 connect( ConfigureDialog, SIGNAL( okClicked() ), 1632 connect( ConfigureDialog, SIGNAL( acceptClicked() ),
1633 kabcfg, SLOT( save() ) ); 1633 kabcfg, SLOT( save() ) );
1634 connect( ConfigureDialog, SIGNAL( defaultClicked() ), 1634 connect( ConfigureDialog, SIGNAL( defaultClicked() ),
1635 kabcfg, SLOT( defaults() ) ); 1635 kabcfg, SLOT( defaults() ) );
1636 saveSettings(); 1636 saveSettings();
1637 kabcfg->load(); 1637 kabcfg->load();
1638#ifndef DESKTOP_VERSION 1638#ifndef DESKTOP_VERSION
1639 if ( QApplication::desktop()->height() <= 480 ) 1639 if ( QApplication::desktop()->height() <= 480 )
1640 ConfigureDialog->hideButtons(); 1640 ConfigureDialog->hideButtons();
1641 ConfigureDialog->showMaximized(); 1641 ConfigureDialog->showMaximized();
1642#endif 1642#endif
1643 if ( ConfigureDialog->exec() ) 1643 if ( ConfigureDialog->exec() )
1644 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); 1644 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
1645 delete ConfigureDialog; 1645 delete ConfigureDialog;
1646} 1646}
1647 1647
1648void KABCore::openLDAPDialog() 1648void KABCore::openLDAPDialog()
1649{ 1649{
1650#ifndef KAB_EMBEDDED 1650#ifndef KAB_EMBEDDED
1651 if ( !mLdapSearchDialog ) { 1651 if ( !mLdapSearchDialog ) {
1652 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); 1652 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this );
1653 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, 1653 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager,
1654 SLOT( refreshView() ) ); 1654 SLOT( refreshView() ) );
1655 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, 1655 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this,
1656 SLOT( setModified() ) ); 1656 SLOT( setModified() ) );
1657 } else 1657 } else
1658 mLdapSearchDialog->restoreSettings(); 1658 mLdapSearchDialog->restoreSettings();
1659 1659
1660 if ( mLdapSearchDialog->isOK() ) 1660 if ( mLdapSearchDialog->isOK() )
1661 mLdapSearchDialog->exec(); 1661 mLdapSearchDialog->exec();
1662#else //KAB_EMBEDDED 1662#else //KAB_EMBEDDED
1663 qDebug("KABCore::openLDAPDialog() finsih method"); 1663 qDebug("KABCore::openLDAPDialog() finsih method");
1664#endif //KAB_EMBEDDED 1664#endif //KAB_EMBEDDED
1665} 1665}
1666 1666
1667void KABCore::print() 1667void KABCore::print()
1668{ 1668{
1669#ifndef KAB_EMBEDDED 1669#ifndef KAB_EMBEDDED
1670 KPrinter printer; 1670 KPrinter printer;
1671 if ( !printer.setup( this ) ) 1671 if ( !printer.setup( this ) )
1672 return; 1672 return;
1673 1673
1674 KABPrinting::PrintingWizard wizard( &printer, mAddressBook, 1674 KABPrinting::PrintingWizard wizard( &printer, mAddressBook,
1675 mViewManager->selectedUids(), this ); 1675 mViewManager->selectedUids(), this );
1676 1676
1677 wizard.exec(); 1677 wizard.exec();
1678#else //KAB_EMBEDDED 1678#else //KAB_EMBEDDED
1679 qDebug("KABCore::print() finsih method"); 1679 qDebug("KABCore::print() finsih method");
1680#endif //KAB_EMBEDDED 1680#endif //KAB_EMBEDDED
@@ -3385,50 +3385,50 @@ bool KABCore::syncPhone()
3385 syncManager->hideProgressBar(); 3385 syncManager->hideProgressBar();
3386 if ( syncOK ) { 3386 if ( syncOK ) {
3387 if ( syncManager->mWriteBackFile ) { 3387 if ( syncManager->mWriteBackFile ) {
3388 abLocal.removeSyncAddressees( true ); 3388 abLocal.removeSyncAddressees( true );
3389 abLocal.saveABphone( fileName ); 3389 abLocal.saveABphone( fileName );
3390 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3390 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3391 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3391 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3392 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3392 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3393 } 3393 }
3394 } 3394 }
3395 setModified(); 3395 setModified();
3396 } 3396 }
3397 abLocal.removeResources(); 3397 abLocal.removeResources();
3398 if ( syncOK ) 3398 if ( syncOK )
3399 mViewManager->refreshView(); 3399 mViewManager->refreshView();
3400 return syncOK; 3400 return syncOK;
3401} 3401}
3402void KABCore::getFile( bool success ) 3402void KABCore::getFile( bool success )
3403{ 3403{
3404 if ( ! success ) { 3404 if ( ! success ) {
3405 message( i18n("Error receiving file. Nothing changed!") ); 3405 message( i18n("Error receiving file. Nothing changed!") );
3406 return; 3406 return;
3407 } 3407 }
3408 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); 3408 int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
3409 if ( count ) 3409 if ( count )
3410 setModified( true ); 3410 setModified( true );
3411 message( i18n("Pi-Sync successful!") ); 3411 message( i18n("Pi-Sync successful!") );
3412 mViewManager->refreshView(); 3412 mViewManager->refreshView();
3413} 3413}
3414void KABCore::syncFileRequest() 3414void KABCore::syncFileRequest()
3415{ 3415{
3416 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { 3416 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
3417 syncManager->slotSyncMenu( 999 ); 3417 syncManager->slotSyncMenu( 999 );
3418 } 3418 }
3419 mAddressBook->export2File( sentSyncFile() ); 3419 mAddressBook->export2File( sentSyncFile() );
3420} 3420}
3421QString KABCore::sentSyncFile() 3421QString KABCore::sentSyncFile()
3422{ 3422{
3423#ifdef DESKTOP_VERSION 3423#ifdef DESKTOP_VERSION
3424 return locateLocal( "tmp", "copysyncab.vcf" ); 3424 return locateLocal( "tmp", "copysyncab.vcf" );
3425#else 3425#else
3426 return QString( "/tmp/copysyncab.vcf" ); 3426 return QString( "/tmp/copysyncab.vcf" );
3427#endif 3427#endif
3428} 3428}
3429 3429
3430void KABCore::setCaptionBack() 3430void KABCore::setCaptionBack()
3431{ 3431{
3432 mMessageTimer->stop(); 3432 mMessageTimer->stop();
3433 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 3433 topLevelWidget()->setCaption( i18n("KA/Pi") );
3434} 3434}