author | zautrix <zautrix> | 2004-10-08 23:38:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-08 23:38:07 (UTC) |
commit | 07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861 (patch) (unidiff) | |
tree | 03d0e5d20e607e035e17fcdabd6bce789069f41e /kaddressbook | |
parent | 44169895703beb3e8b1551a313d2d341bf742905 (diff) | |
download | kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.zip kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.tar.gz kdepimpi-07fdef2c2ea1153d39d7114b3d5bd4abc4f4c861.tar.bz2 |
some bugfixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 8 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 3 |
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 | |||
@@ -273,100 +273,101 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
273 | 273 | ||
274 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 274 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
275 | SLOT( deleteContacts( ) ) ); | 275 | SLOT( deleteContacts( ) ) ); |
276 | connect( mViewManager, SIGNAL( modified() ), | 276 | connect( mViewManager, SIGNAL( modified() ), |
277 | SLOT( setModified() ) ); | 277 | SLOT( setModified() ) ); |
278 | 278 | ||
279 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 279 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
280 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); | 280 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); |
281 | 281 | ||
282 | connect( mXXPortManager, SIGNAL( modified() ), | 282 | connect( mXXPortManager, SIGNAL( modified() ), |
283 | SLOT( setModified() ) ); | 283 | SLOT( setModified() ) ); |
284 | 284 | ||
285 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 285 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
286 | SLOT( incrementalSearch( const QString& ) ) ); | 286 | SLOT( incrementalSearch( const QString& ) ) ); |
287 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 287 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
288 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 288 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
289 | 289 | ||
290 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 290 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
291 | SLOT( sendMail( const QString& ) ) ); | 291 | SLOT( sendMail( const QString& ) ) ); |
292 | 292 | ||
293 | 293 | ||
294 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 294 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
295 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 295 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
296 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 296 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
297 | 297 | ||
298 | 298 | ||
299 | #ifndef KAB_EMBEDDED | 299 | #ifndef KAB_EMBEDDED |
300 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 300 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
301 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 301 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
302 | 302 | ||
303 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 303 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
304 | SLOT( browse( const QString& ) ) ); | 304 | SLOT( browse( const QString& ) ) ); |
305 | 305 | ||
306 | 306 | ||
307 | mAddressBookService = new KAddressBookService( this ); | 307 | mAddressBookService = new KAddressBookService( this ); |
308 | 308 | ||
309 | #endif //KAB_EMBEDDED | 309 | #endif //KAB_EMBEDDED |
310 | mEditorDialog = 0; | 310 | mEditorDialog = 0; |
311 | createAddresseeEditorDialog( this ); | 311 | createAddresseeEditorDialog( this ); |
312 | setModified( false ); | 312 | setModified( false ); |
313 | } | 313 | } |
314 | 314 | ||
315 | KABCore::~KABCore() | 315 | KABCore::~KABCore() |
316 | { | 316 | { |
317 | // save(); | 317 | // save(); |
318 | //saveSettings(); | 318 | //saveSettings(); |
319 | //KABPrefs::instance()->writeConfig(); | 319 | //KABPrefs::instance()->writeConfig(); |
320 | delete AddresseeConfig::instance(); | 320 | delete AddresseeConfig::instance(); |
321 | mAddressBook = 0; | 321 | mAddressBook = 0; |
322 | KABC::StdAddressBook::close(); | 322 | KABC::StdAddressBook::close(); |
323 | |||
324 | delete syncManager; | ||
323 | 325 | ||
324 | delete syncManager; | ||
325 | } | 326 | } |
326 | 327 | ||
327 | void KABCore::restoreSettings() | 328 | void KABCore::restoreSettings() |
328 | { | 329 | { |
329 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 330 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
330 | 331 | ||
331 | bool state; | 332 | bool state; |
332 | 333 | ||
333 | if (mMultipleViewsAtOnce) | 334 | if (mMultipleViewsAtOnce) |
334 | state = KABPrefs::instance()->mDetailsPageVisible; | 335 | state = KABPrefs::instance()->mDetailsPageVisible; |
335 | else | 336 | else |
336 | state = false; | 337 | state = false; |
337 | 338 | ||
338 | mActionDetails->setChecked( state ); | 339 | mActionDetails->setChecked( state ); |
339 | setDetailsVisible( state ); | 340 | setDetailsVisible( state ); |
340 | 341 | ||
341 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 342 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
342 | 343 | ||
343 | mActionJumpBar->setChecked( state ); | 344 | mActionJumpBar->setChecked( state ); |
344 | setJumpButtonBarVisible( state ); | 345 | setJumpButtonBarVisible( state ); |
345 | /*US | 346 | /*US |
346 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 347 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
347 | if ( splitterSize.count() == 0 ) { | 348 | if ( splitterSize.count() == 0 ) { |
348 | splitterSize.append( width() / 2 ); | 349 | splitterSize.append( width() / 2 ); |
349 | splitterSize.append( width() / 2 ); | 350 | splitterSize.append( width() / 2 ); |
350 | } | 351 | } |
351 | mMiniSplitter->setSizes( splitterSize ); | 352 | mMiniSplitter->setSizes( splitterSize ); |
352 | if ( mExtensionBarSplitter ) { | 353 | if ( mExtensionBarSplitter ) { |
353 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 354 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
354 | if ( splitterSize.count() == 0 ) { | 355 | if ( splitterSize.count() == 0 ) { |
355 | splitterSize.append( width() / 2 ); | 356 | splitterSize.append( width() / 2 ); |
356 | splitterSize.append( width() / 2 ); | 357 | splitterSize.append( width() / 2 ); |
357 | } | 358 | } |
358 | mExtensionBarSplitter->setSizes( splitterSize ); | 359 | mExtensionBarSplitter->setSizes( splitterSize ); |
359 | 360 | ||
360 | } | 361 | } |
361 | */ | 362 | */ |
362 | mViewManager->restoreSettings(); | 363 | mViewManager->restoreSettings(); |
363 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 364 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
364 | mExtensionManager->restoreSettings(); | 365 | mExtensionManager->restoreSettings(); |
365 | #ifdef DESKTOP_VERSION | 366 | #ifdef DESKTOP_VERSION |
366 | int wid = width(); | 367 | int wid = width(); |
367 | if ( wid < 10 ) | 368 | if ( wid < 10 ) |
368 | wid = 400; | 369 | wid = 400; |
369 | #else | 370 | #else |
370 | int wid = QApplication::desktop()->width(); | 371 | int wid = QApplication::desktop()->width(); |
371 | if ( wid < 640 ) | 372 | if ( wid < 640 ) |
372 | wid = QApplication::desktop()->height(); | 373 | wid = QApplication::desktop()->height(); |
@@ -657,96 +658,97 @@ void KABCore::beamMySelf() | |||
657 | } else { | 658 | } else { |
658 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); | 659 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); |
659 | 660 | ||
660 | 661 | ||
661 | } | 662 | } |
662 | } | 663 | } |
663 | 664 | ||
664 | void KABCore::export2phone() | 665 | void KABCore::export2phone() |
665 | { | 666 | { |
666 | 667 | ||
667 | KAex2phonePrefs ex2phone; | 668 | KAex2phonePrefs ex2phone; |
668 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 669 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
669 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 670 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
670 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 671 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
671 | 672 | ||
672 | if ( !ex2phone.exec() ) { | 673 | if ( !ex2phone.exec() ) { |
673 | return; | 674 | return; |
674 | } | 675 | } |
675 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 676 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
676 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 677 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
677 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 678 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
678 | 679 | ||
679 | 680 | ||
680 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 681 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
681 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 682 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
682 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 683 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
683 | 684 | ||
684 | QStringList uids = mViewManager->selectedUids(); | 685 | QStringList uids = mViewManager->selectedUids(); |
685 | if ( uids.isEmpty() ) | 686 | if ( uids.isEmpty() ) |
686 | return; | 687 | return; |
687 | 688 | ||
688 | #ifdef _WIN32_ | 689 | #ifdef _WIN32_ |
689 | QString fileName = locateLocal("tmp", "tempfile.vcf"); | 690 | QString fileName = locateLocal("tmp", "tempfile.vcf"); |
690 | #else | 691 | #else |
691 | QString fileName = "/tmp/kdepimtemp.vcf"; | 692 | QString fileName = "/tmp/kdepimtemp.vcf"; |
692 | #endif | 693 | #endif |
693 | 694 | ||
694 | KABC::VCardConverter converter; | 695 | KABC::VCardConverter converter; |
695 | QString description; | 696 | QString description; |
696 | QString datastream; | 697 | QString datastream; |
697 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 698 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
698 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 699 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
699 | 700 | ||
700 | if ( a.isEmpty() ) | 701 | if ( a.isEmpty() ) |
701 | continue; | 702 | continue; |
702 | a.simplifyEmails(); | 703 | a.simplifyEmails(); |
703 | a.simplifyPhoneNumbers(); | 704 | a.simplifyPhoneNumbers(); |
704 | a.simplifyPhoneNumberTypes(); | 705 | a.simplifyPhoneNumberTypes(); |
706 | a.simplifyAddresses(); | ||
705 | 707 | ||
706 | if (description.isEmpty()) | 708 | if (description.isEmpty()) |
707 | description = a.formattedName(); | 709 | description = a.formattedName(); |
708 | QString vcard; | 710 | QString vcard; |
709 | QString vcardnew; | 711 | QString vcardnew; |
710 | converter.addresseeToVCard( a, vcard ); | 712 | converter.addresseeToVCard( a, vcard ); |
711 | int start = 0; | 713 | int start = 0; |
712 | int next; | 714 | int next; |
713 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { | 715 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { |
714 | int semi = vcard.find(";", next); | 716 | int semi = vcard.find(";", next); |
715 | int dopp = vcard.find(":", next); | 717 | int dopp = vcard.find(":", next); |
716 | int sep; | 718 | int sep; |
717 | if ( semi < dopp && semi >= 0 ) | 719 | if ( semi < dopp && semi >= 0 ) |
718 | sep = semi ; | 720 | sep = semi ; |
719 | else | 721 | else |
720 | sep = dopp; | 722 | sep = dopp; |
721 | vcardnew +=vcard.mid( start, next - start); | 723 | vcardnew +=vcard.mid( start, next - start); |
722 | vcardnew +=vcard.mid( next+5,sep -next -5 ).upper(); | 724 | vcardnew +=vcard.mid( next+5,sep -next -5 ).upper(); |
723 | start = sep; | 725 | start = sep; |
724 | } | 726 | } |
725 | vcardnew += vcard.mid( start,vcard.length() ); | 727 | vcardnew += vcard.mid( start,vcard.length() ); |
726 | vcard = ""; | 728 | vcard = ""; |
727 | start = 0; | 729 | start = 0; |
728 | while ( (next = vcardnew.find("ADR", start) )>= 0 ) { | 730 | while ( (next = vcardnew.find("ADR", start) )>= 0 ) { |
729 | int sep = vcardnew.find(":", next); | 731 | int sep = vcardnew.find(":", next); |
730 | vcard +=vcardnew.mid( start, next - start+3); | 732 | vcard +=vcardnew.mid( start, next - start+3); |
731 | start = sep; | 733 | start = sep; |
732 | } | 734 | } |
733 | vcard += vcardnew.mid( start,vcardnew.length() ); | 735 | vcard += vcardnew.mid( start,vcardnew.length() ); |
734 | vcard.replace ( QRegExp(";;;") , "" ); | 736 | vcard.replace ( QRegExp(";;;") , "" ); |
735 | vcard.replace ( QRegExp(";;") , "" ); | 737 | vcard.replace ( QRegExp(";;") , "" ); |
736 | datastream += vcard; | 738 | datastream += vcard; |
737 | 739 | ||
738 | } | 740 | } |
739 | QFile outFile(fileName); | 741 | QFile outFile(fileName); |
740 | if ( outFile.open(IO_WriteOnly) ) { | 742 | if ( outFile.open(IO_WriteOnly) ) { |
741 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); | 743 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); |
742 | QTextStream t( &outFile ); // use a text stream | 744 | QTextStream t( &outFile ); // use a text stream |
743 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 745 | t.setEncoding( QTextStream::UnicodeUTF8 ); |
744 | t <<datastream; | 746 | t <<datastream; |
745 | outFile.close(); | 747 | outFile.close(); |
746 | if ( PhoneAccess::writeToPhone( fileName ) ) | 748 | if ( PhoneAccess::writeToPhone( fileName ) ) |
747 | qDebug("Export okay "); | 749 | qDebug("Export okay "); |
748 | else | 750 | else |
749 | qDebug("Error export contacts "); | 751 | qDebug("Error export contacts "); |
750 | 752 | ||
751 | } else { | 753 | } else { |
752 | qDebug("Error open temp file "); | 754 | qDebug("Error open temp file "); |
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 552c933..dded2bf 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -37,96 +37,97 @@ KABPrefs *KABPrefs::sInstance = 0; | |||
37 | static KStaticDeleter<KABPrefs> staticDeleter; | 37 | static KStaticDeleter<KABPrefs> staticDeleter; |
38 | 38 | ||
39 | KABPrefs::KABPrefs() | 39 | KABPrefs::KABPrefs() |
40 | : KPimPrefs("kaddressbookrc") | 40 | : KPimPrefs("kaddressbookrc") |
41 | { | 41 | { |
42 | KPrefs::setCurrentGroup( "Views" ); | 42 | KPrefs::setCurrentGroup( "Views" ); |
43 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); | 43 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); |
44 | 44 | ||
45 | KPrefs::setCurrentGroup( "General" ); | 45 | KPrefs::setCurrentGroup( "General" ); |
46 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); | 46 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); |
47 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); | 47 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); |
48 | 48 | ||
49 | #ifdef KAB_EMBEDDED | 49 | #ifdef KAB_EMBEDDED |
50 | addItemBool("AskForQuit",&mAskForQuit,true); | 50 | addItemBool("AskForQuit",&mAskForQuit,true); |
51 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 51 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
52 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 52 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
53 | addItemBool("SearchWithReturn",&mSearchWithReturn, true ); | 53 | addItemBool("SearchWithReturn",&mSearchWithReturn, true ); |
54 | 54 | ||
55 | 55 | ||
56 | #endif //KAB_EMBEDDED | 56 | #endif //KAB_EMBEDDED |
57 | 57 | ||
58 | KPrefs::setCurrentGroup( "MainWindow" ); | 58 | KPrefs::setCurrentGroup( "MainWindow" ); |
59 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); | 59 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); |
60 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); | 60 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); |
61 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); | 61 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); |
62 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); | 62 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); |
63 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); | 63 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); |
64 | 64 | ||
65 | 65 | ||
66 | KPrefs::setCurrentGroup( "Extensions_General" ); | 66 | KPrefs::setCurrentGroup( "Extensions_General" ); |
67 | QStringList defaultExtensions; | 67 | QStringList defaultExtensions; |
68 | defaultExtensions << "merge"; | 68 | defaultExtensions << "merge"; |
69 | defaultExtensions << "distribution_list_editor"; | 69 | defaultExtensions << "distribution_list_editor"; |
70 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); | 70 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); |
71 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); | 71 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); |
72 | 72 | ||
73 | KPrefs::setCurrentGroup( "Views" ); | 73 | KPrefs::setCurrentGroup( "Views" ); |
74 | QString defaultView = i18n( "Default Table View" ); | 74 | QString defaultView = i18n( "Default Table View" ); |
75 | addItemString( "CurrentView", &mCurrentView, defaultView ); | 75 | addItemString( "CurrentView", &mCurrentView, defaultView ); |
76 | addItemStringList( "ViewNames", &mViewNames, defaultView ); | 76 | addItemStringList( "ViewNames", &mViewNames, defaultView ); |
77 | 77 | ||
78 | KPrefs::setCurrentGroup( "Filters" ); | 78 | KPrefs::setCurrentGroup( "Filters" ); |
79 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); | 79 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); |
80 | 80 | ||
81 | } | 81 | } |
82 | 82 | ||
83 | KABPrefs::~KABPrefs() | 83 | KABPrefs::~KABPrefs() |
84 | { | 84 | { |
85 | //qDebug("KABPrefs::~KABPrefs() "); | ||
85 | } | 86 | } |
86 | 87 | ||
87 | KABPrefs *KABPrefs::instance() | 88 | KABPrefs *KABPrefs::instance() |
88 | { | 89 | { |
89 | if ( !sInstance ) { | 90 | if ( !sInstance ) { |
90 | #ifdef KAB_EMBEDDED | 91 | #ifdef KAB_EMBEDDED |
91 | sInstance = staticDeleter.setObject( new KABPrefs() ); | 92 | sInstance = staticDeleter.setObject( new KABPrefs() ); |
92 | #else //KAB_EMBEDDED | 93 | #else //KAB_EMBEDDED |
93 | //US the following line has changed ???. Why | 94 | //US the following line has changed ???. Why |
94 | staticDeleter.setObject( sInstance, new KABPrefs() ); | 95 | staticDeleter.setObject( sInstance, new KABPrefs() ); |
95 | #endif //KAB_EMBEDDED | 96 | #endif //KAB_EMBEDDED |
96 | sInstance->readConfig(); | 97 | sInstance->readConfig(); |
97 | } | 98 | } |
98 | 99 | ||
99 | return sInstance; | 100 | return sInstance; |
100 | } | 101 | } |
101 | 102 | ||
102 | void KABPrefs::setCategoryDefaults() | 103 | void KABPrefs::setCategoryDefaults() |
103 | { | 104 | { |
104 | mCustomCategories.clear(); | 105 | mCustomCategories.clear(); |
105 | 106 | ||
106 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) | 107 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) |
107 | << i18n( "Customer" ) << i18n( "Friend" ); | 108 | << i18n( "Customer" ) << i18n( "Friend" ); |
108 | } | 109 | } |
109 | 110 | ||
110 | // US introduce a nonconst way to return the config object. | 111 | // US introduce a nonconst way to return the config object. |
111 | KConfig* KABPrefs::getConfig() | 112 | KConfig* KABPrefs::getConfig() |
112 | { | 113 | { |
113 | return config(); | 114 | return config(); |
114 | } | 115 | } |
115 | 116 | ||
116 | 117 | ||
117 | /*US | 118 | /*US |
118 | void KABPrefs::usrSetDefaults() | 119 | void KABPrefs::usrSetDefaults() |
119 | { | 120 | { |
120 | KPimPrefs::usrSetDefaults(); | 121 | KPimPrefs::usrSetDefaults(); |
121 | } | 122 | } |
122 | 123 | ||
123 | void KABPrefs::usrReadConfig() | 124 | void KABPrefs::usrReadConfig() |
124 | { | 125 | { |
125 | KPimPrefs::usrReadConfig(); | 126 | KPimPrefs::usrReadConfig(); |
126 | } | 127 | } |
127 | 128 | ||
128 | void KABPrefs::usrWriteConfig() | 129 | void KABPrefs::usrWriteConfig() |
129 | { | 130 | { |
130 | KPimPrefs::usrWriteConfig(); | 131 | KPimPrefs::usrWriteConfig(); |
131 | } | 132 | } |
132 | */ | 133 | */ |