From 5c5c1354afa5d24768ceefe5b7dd8733ff7bd5f0 Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 05 Jul 2004 09:24:56 +0000 Subject: Removed strange handling of addresseeeditor --- (limited to 'kaddressbook/kabcore.cpp') diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 8d08713..b06e1bc 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -63,6 +63,7 @@ #include "printing/printingwizard.h" #else // KAB_EMBEDDED +#include #include "KDGanttMinimizeSplitter.h" #include "kaddressbookmain.h" #include "kactioncollection.h" @@ -198,7 +199,8 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mAddressBookService = new KAddressBookService( this ); #endif //KAB_EMBEDDED - + mEditorDialog = 0; + createAddresseeEditorDialog( this ); setModified( false ); } @@ -790,13 +792,13 @@ void KABCore::newContact() if ( resource ) { KABC::Addressee addr; addr.setResource( resource ); - dialog = createAddresseeEditorDialog( this ); - dialog->setAddressee( addr ); + mEditorDialog->setAddressee( addr ); + KApplication::execDialog ( mEditorDialog ); } else return; - mEditorDict.insert( dialog->addressee().uid(), dialog ); + // mEditorDict.insert( dialog->addressee().uid(), dialog ); dialog->show(); @@ -867,17 +869,8 @@ void KABCore::editContact( const QString &uid ) KABC::Addressee addr = mAddressBook->findByUid( localUID ); if ( !addr.isEmpty() ) { - AddresseeEditorDialog *dialog = mEditorDict.find( addr.uid() ); - if ( !dialog ) { - dialog = createAddresseeEditorDialog( this ); - - mEditorDict.insert( addr.uid(), dialog ); - - dialog->setAddressee( addr ); - } - - dialog->raise(); - dialog->show(); + mEditorDialog->setAddressee( addr ); + KApplication::execDialog ( mEditorDialog ); } } @@ -1088,24 +1081,25 @@ void KABCore::addressBookChanged() AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, const char *name ) { - AddresseeEditorDialog *dialog = new AddresseeEditorDialog( this, parent, + + if ( mEditorDialog == 0 ) { + mEditorDialog = new AddresseeEditorDialog( this, parent, name ? name : "editorDialog" ); -//US - dialog->setMaximumSize( 640, 480 ); - dialog->showMaximized(); - - connect( dialog, SIGNAL( contactModified( const KABC::Addressee& ) ), + + connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), SLOT( contactModified( const KABC::Addressee& ) ) ); - connect( dialog, SIGNAL( editorDestroyed( const QString& ) ), - SLOT( slotEditorDestroyed( const QString& ) ) ); + //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), + // SLOT( slotEditorDestroyed( const QString& ) ) ); + } - return dialog; + return mEditorDialog; } void KABCore::slotEditorDestroyed( const QString &uid ) { - mEditorDict.remove( uid ); + qDebug("KABCore::slotEditorDestroyed called. maybe a problem! "); + //mEditorDict.remove( uid ); } void KABCore::initGUI() -- cgit v0.9.0.2