summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp8
-rw-r--r--kaddressbook/kabprefs.cpp3
2 files changed, 7 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 939296f..9b059d3 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -297,52 +297,53 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
#ifndef KAB_EMBEDDED
connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
mXXPortManager, SLOT( importVCard( const KURL& ) ) );
connect( mDetails, SIGNAL( browse( const QString& ) ),
SLOT( browse( const QString& ) ) );
mAddressBookService = new KAddressBookService( this );
#endif //KAB_EMBEDDED
mEditorDialog = 0;
createAddresseeEditorDialog( this );
setModified( false );
}
KABCore::~KABCore()
{
// save();
//saveSettings();
//KABPrefs::instance()->writeConfig();
delete AddresseeConfig::instance();
- mAddressBook = 0;
- KABC::StdAddressBook::close();
+ mAddressBook = 0;
+ KABC::StdAddressBook::close();
+
+ delete syncManager;
- delete syncManager;
}
void KABCore::restoreSettings()
{
mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
bool state;
if (mMultipleViewsAtOnce)
state = KABPrefs::instance()->mDetailsPageVisible;
else
state = false;
mActionDetails->setChecked( state );
setDetailsVisible( state );
state = KABPrefs::instance()->mJumpButtonBarVisible;
mActionJumpBar->setChecked( state );
setJumpButtonBarVisible( state );
/*US
QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
if ( splitterSize.count() == 0 ) {
splitterSize.append( width() / 2 );
@@ -681,48 +682,49 @@ void KABCore::export2phone()
KPimGlobalPrefs::instance()->mEx2PhoneConnection,
KPimGlobalPrefs::instance()->mEx2PhoneModel );
QStringList uids = mViewManager->selectedUids();
if ( uids.isEmpty() )
return;
#ifdef _WIN32_
QString fileName = locateLocal("tmp", "tempfile.vcf");
#else
QString fileName = "/tmp/kdepimtemp.vcf";
#endif
KABC::VCardConverter converter;
QString description;
QString datastream;
for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
KABC::Addressee a = mAddressBook->findByUid( *it );
if ( a.isEmpty() )
continue;
a.simplifyEmails();
a.simplifyPhoneNumbers();
a.simplifyPhoneNumberTypes();
+ a.simplifyAddresses();
if (description.isEmpty())
description = a.formattedName();
QString vcard;
QString vcardnew;
converter.addresseeToVCard( a, vcard );
int start = 0;
int next;
while ( (next = vcard.find("TYPE=", start) )>= 0 ) {
int semi = vcard.find(";", next);
int dopp = vcard.find(":", next);
int sep;
if ( semi < dopp && semi >= 0 )
sep = semi ;
else
sep = dopp;
vcardnew +=vcard.mid( start, next - start);
vcardnew +=vcard.mid( next+5,sep -next -5 ).upper();
start = sep;
}
vcardnew += vcard.mid( start,vcard.length() );
vcard = "";
start = 0;
while ( (next = vcardnew.find("ADR", start) )>= 0 ) {
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 552c933..dded2bf 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -61,50 +61,51 @@ KABPrefs::KABPrefs()
addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
addItemIntList( "DetailsSplitter", &mDetailsSplitter );
addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
KPrefs::setCurrentGroup( "Extensions_General" );
QStringList defaultExtensions;
defaultExtensions << "merge";
defaultExtensions << "distribution_list_editor";
addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
KPrefs::setCurrentGroup( "Views" );
QString defaultView = i18n( "Default Table View" );
addItemString( "CurrentView", &mCurrentView, defaultView );
addItemStringList( "ViewNames", &mViewNames, defaultView );
KPrefs::setCurrentGroup( "Filters" );
addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
}
KABPrefs::~KABPrefs()
{
+ //qDebug("KABPrefs::~KABPrefs() ");
}
-
+
KABPrefs *KABPrefs::instance()
{
if ( !sInstance ) {
#ifdef KAB_EMBEDDED
sInstance = staticDeleter.setObject( new KABPrefs() );
#else //KAB_EMBEDDED
//US the following line has changed ???. Why
staticDeleter.setObject( sInstance, new KABPrefs() );
#endif //KAB_EMBEDDED
sInstance->readConfig();
}
return sInstance;
}
void KABPrefs::setCategoryDefaults()
{
mCustomCategories.clear();
mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" )
<< i18n( "Customer" ) << i18n( "Friend" );
}
// US introduce a nonconst way to return the config object.