[Kroupware] Re: [Kde-pim] kontact

Don Sanders kroupware@mail.kde.org
Wed, 12 Mar 2003 23:51:16 +1000


--Boundary-00=_Utzb+DnMc1zmh7v
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline

On Wednesday 12 March 2003 21:15, Ralf Nolden wrote:
> On Mittwoch, 12. März 2003 12:23, Don Sanders wrote:
> > On Wednesday 12 March 2003 19:25, Ralf Nolden wrote:
> > > On Mittwoch, 12. März 2003 05:17, Don Sanders wrote:
> > > > On Wednesday 12 March 2003 14:11, Don Sanders wrote:
> > > > > On Tuesday 11 March 2003 23:07, Ralf Nolden wrote:
> > > > > > On Dienstag, 11. März 2003 14:18, Don Sanders wrote:
> > > > > > > On Friday 07 March 2003 19:48, Ralf Nolden wrote:
> > > > > > > > On Freitag, 7. März 2003 05:51, Don Sanders wrote:
> > > > > > > > > On Thursday 06 March 2003 16:14, Seth Kurtzberg 
wrote:
> > > > > > > > > > Hello list(s)
> > > > > > > > > >
> > > > > > > > > > I've been reading messages about kontact, and I
> > > > > > > > > > wanted to try it, so I pulled the latest from CVS
> > > > > > > > > > and built it. That gives me a kontact directory,
> > > > > > > > > > but I don't find an executable named kontact. Is
> > > > > > > > > > there something else to build, or does the
> > > > > > > > > > executable have a different name?
> > > > > > > > >
> > > > > > > > > For a version of Kontact that is known to work and
> > > > > > > > > be stable I suggest using the
> > > > > > > > > kdepim-kontact-0.2.1.tgz package on the Kontact
> > > > > > > > > website.
> > > > > > > >
> > > > > > > > It isn't complete :-) You need to move the docs over
> > > > > > > > to the kdepim package for the apps that got moved
> > > > > > > > there too. Don, can you package up a new version that
> > > > > > > > does that ? People asked me to provide debian
> > > > > > > > packages for my repository so I gave it a try and hit
> > > > > > > > that bug.
> > > > > > >
> > > > > > > I'll look into that for the next package due at the end
> > > > > > > of the month. If people want the doc sooner I guess
> > > > > > > some packager will have to manually mv it for now.
> > > > > > >
> > > > > > > These releases are intended to stable and usable but
> > > > > > > not complete. Even if/when the doc is included it will
> > > > > > > still be out of date as it won't cover all the new
> > > > > > > features.
> > > > > >
> > > > > > Regarding being stable - I tried it and lost all of my
> > > > > > addressbook contacts
> > > > >
> > > > > I experienced a bug in HEAD that did that but not
> > > > > kontact.2.1.
> > > > >
> > > > > Can you reproduce it?
> > >
> > > Sorry, I'm lacking the time to do that currently.
> > >
> > > > Yeah my first guess would be that you're running kontact.2.1
> > > > against HEAD kdelibs, and that there's a change of format
> > > > between HEAD and the KDE_3_1_BRANCH, and that this change is
> > > > backwards but not forwards compatible.
> > >
> > > No, I used the branch for my system and then installing kontact
> > > after compiling it against the branch in a chroot, so I made
> > > sure I don't have any stuff from HEAD around in my build
> > > systems.
> >
> > And you don't experience this when running KAddressBook from the
> > KDE_3_1_BRANCH? That would be surprising as KAddressBook from
> > kontact.0.2.1 and the KDE_3_1_BRANCH are very similar.
>
> No, never had any problems with the branch one. It's probably that
> the addressbook on a crash (which doesn't happen on the branch)

Sorry are you saying the kontact release crashes and the branch 
doesn't? Any backtrace?

> looses all its data.

Can you reproducibly cause KAddressBook to crash and lose all its 
data? Either from the branch or from the kontact package?

> I think it's also a misbehavior that it
> doesn't do autosaving if you change contacts...

KAddressBook when used as a part in Kontact should automatically save 
contacts on exit of Kontact, I just verified this. KAddressBook 
standalone from both the branch and the kontact package should prompt 
for saving on exit. It might be nice to use a timer to auto save the 
data but I don't think it would be productive to discuss this issue 
further at this time.

If the 3.1 release works and the kontact version doesn't it should be 
easy pinpoint the location of any bug. This is because the kontact 
version of kaddressbook and the branch are almost identical and the 
differences can easily be backed out.

If possible can you see if KAddressBook standalone from the kontact 
package behaves differently from the 3.1 release. If so can you apply 
the attached patch to the kontact package and see if the problem 
persists?

BTW it's probably a good to double check that any problem occurs in 
KAddressBook standalone from the kontact package and not in the 3.1 
release.

Thanks,
Don.

--Boundary-00=_Utzb+DnMc1zmh7v
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="kaddressbook.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="kaddressbook.diff"

diff -dup kdepim-kontact-0.2.1/kaddressbook/actionmanager.cpp kdepim-3.1/kaddressbook/actionmanager.cpp
--- kdepim-kontact-0.2.1/kaddressbook/actionmanager.cpp	Mon Dec 23 04:46:30 2002
+++ kdepim-3.1/kaddressbook/actionmanager.cpp	Mon Nov 18 23:22:07 2002
@@ -27,7 +27,6 @@
 #include <kapplication.h>
 #include <kconfig.h>
 #include <kdebug.h>
-#include <kkeydialog.h>
 #include <klocale.h>
 #include <kprotocolinfo.h>
 #include <kxmlguiclient.h>
@@ -44,7 +43,6 @@ ActionManager::ActionManager(KXMLGUIClie
 {
     mGUIClient = client;
     mACollection = mGUIClient->actionCollection();
-    mIsPart = !parent->inherits("KAddressBookMain");

     mWidget = widget;
     connect( mWidget, SIGNAL( addresseeSelected( bool ) ),
@@ -65,7 +63,7 @@ ActionManager::ActionManager(KXMLGUIClie
         initReadWriteActions();

     // Read our own config
-    KConfig *config = ViewManager::config();
+    KConfig *config = kapp->config();
     config->setGroup("Views");
     mActiveViewName = config->readEntry("Active");
     config->setGroup("MainWindow");
@@ -88,7 +86,7 @@ ActionManager::ActionManager(KXMLGUIClie
 ActionManager::~ActionManager()
 {
     // Write our own config
-    KConfig *config = ViewManager::config();
+    KConfig *config = kapp->config();

     config->setGroup("Views");
     config->writeEntry("Active", mActiveViewName);
@@ -129,24 +127,13 @@ void ActionManager::initReadOnlyActions(
     new KAction(i18n("&New Contact..."), "filenew", CTRL+Key_N, mWidget,
                 SLOT(newAddressee()),mACollection,"file_new_contact");

-    if (mIsPart) {
-      mActionMail = new KAction(i18n("&Mail"), "mail_generic", 0, mViewManager,
-				SLOT(sendMail()), mACollection, "kaddressbook_mail");
-    } else {
-      mActionMail = KStdAction::mail(mViewManager, SLOT(sendMail()),
-				     mACollection);
-    }
-
+    mActionMail = KStdAction::mail(mViewManager, SLOT(sendMail()),
+                                   mACollection);
     mActionEditAddressee = new KAction(i18n("&Edit Contact..."), "edit", 0,
                                        mWidget, SLOT(editAddressee()),
                                        mACollection, "file_properties");

-    if (mIsPart) {
-      new KAction(i18n("&Print"), "fileprint", CTRL+Key_P, mWidget,
-		  SLOT(print()), mACollection, "kaddressbook_print" );
-    } else {
-      KStdAction::print(mWidget, SLOT(print()), mACollection);
-    }
+    KStdAction::print(mWidget, SLOT(print()), mACollection);

     new KAction(i18n("Import &KDE 2 Address Book..."), 0, mWidget,
                 SLOT(importKDE2()), mACollection, "file_import_kde2");
@@ -164,41 +151,20 @@ void ActionManager::initReadOnlyActions(
                 mACollection, "file_export_vcard30");

     // Edit menu
-    if (mIsPart) {
-      mActionCopy = new KAction(i18n("&Copy"), "editcopy", CTRL+Key_C, mViewManager,
-				SLOT(copy()), mACollection, "kaddressbook_copy");
-    } else {
-      mActionCopy = KStdAction::copy(mViewManager, SLOT(copy()),
-				     mACollection);
-    }
+    mActionCopy = KStdAction::copy(mViewManager, SLOT(copy()),
+                                   mACollection);

-    if (mIsPart) {
-      new KAction(i18n("Select &All"), CTRL+Key_A, mViewManager,
-		  SLOT(setSelected()), mACollection, "kaddressbook_select_all");
-    } else {
-      KStdAction::selectAll(mViewManager, SLOT(setSelected()), mACollection);
-    }
+    KStdAction::selectAll(mViewManager, SLOT(setSelected()), mACollection);

     mActionDelete = new KAction(i18n("&Delete Contact"), "editdelete",
                                 Key_Delete, mViewManager,
                                 SLOT(deleteAddressee()), mACollection,
                                 "edit_delete");

-    if (mIsPart) {
-      mActionUndo = new KAction(i18n("&Undo"), "undo", CTRL+Key_Z, mWidget,
-				SLOT(undo()), mACollection, "kaddressbook_undo");
-    } else {
-      mActionUndo = KStdAction::undo(mWidget, SLOT(undo()), mACollection);
-    }
+    mActionUndo = KStdAction::undo(mWidget, SLOT(undo()), mACollection);
     mActionUndo->setEnabled(false);

-    if (mIsPart) {
-      mActionRedo = new KAction(i18n("Re&do"), "redo", CTRL+SHIFT+Key_Z, mWidget,
-				SLOT(redo()), mACollection, "kaddressbook_redo");
-
-    } else {
-      mActionRedo = KStdAction::redo(mWidget, SLOT(redo()), mACollection);
-    }
+    mActionRedo = KStdAction::redo(mWidget, SLOT(redo()), mACollection);
     mActionRedo->setEnabled( false );

     // View menu
@@ -262,35 +228,14 @@ void ActionManager::initReadOnlyActions(
             SLOT(setCurrentFilterName(const QString&)));
     connect(mViewManager, SIGNAL(setCurrentFilter(int)),
             SLOT(setCurrentFilter(int)));
-
-    if (mIsPart) {
-      new KAction( i18n("&Configure KAddressBook..."),
-		   "configure", 0, mWidget,
-		   SLOT(configure()), mACollection,
-		   "kaddressbook_configure" );
-      new KAction( i18n("Configure S&hortcuts..."),
-		   "configure_shortcuts", 0, this,
-		   SLOT(keyBindings()), mACollection,
-		   "kaddressbook_configure_shortcuts" );
-    } else {
-      KStdAction::preferences( mWidget, SLOT( configure() ), mACollection );
-      KStdAction::keyBindings(this, SLOT( keyBindings()), mACollection );
-    }
 }

 void ActionManager::initReadWriteActions()
 {
     // Edit menu
-    if (mIsPart) {
-      mActionCut = new KAction(i18n("Cu&t"), "editcut", CTRL+Key_X, mViewManager,
-			       SLOT(cut()), mACollection, "kaddressbook_cut");
-      mActionPaste = new KAction(i18n("&Paste"), "editpaste", CTRL+Key_V, mViewManager,
-				 SLOT(paste()), mACollection, "kaddressbook_paste");
-    } else {
-      mActionCut = KStdAction::cut(mViewManager, SLOT(cut()), mACollection);
-      mActionPaste = KStdAction::paste(mViewManager, SLOT(paste()),
-				       mACollection);
-    }
+    mActionCut = KStdAction::cut(mViewManager, SLOT(cut()), mACollection);
+    mActionPaste = KStdAction::paste(mViewManager, SLOT(paste()),
+                                     mACollection);
     clipboardDataChanged();
 }

@@ -463,11 +408,6 @@ void ActionManager::setCurrentFilter(int
 bool ActionManager::isModified()
 {
   return mModified;
-}
-
-void ActionManager::keyBindings()
-{
-  KKeyDialog::configure( mACollection, true );
 }

 #include "actionmanager.moc"
diff -dup kdepim-kontact-0.2.1/kaddressbook/actionmanager.h kdepim-3.1/kaddressbook/actionmanager.h
--- kdepim-kontact-0.2.1/kaddressbook/actionmanager.h	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/actionmanager.h	Sun Oct 27 08:22:25 2002
@@ -97,8 +97,6 @@ class ActionManager : public QObject
     /** Catch changes in the filter selection. */
     void slotFilterActivated(int);

-    void keyBindings();
-
   signals:
     /** Announce filter selection changes. */
     void filterActivated(int);
@@ -119,7 +117,6 @@ class ActionManager : public QObject

     bool mReadWrite;
     bool mModified;
-    bool mIsPart;

     QString mActiveViewName;

diff -dup kdepim-kontact-0.2.1/kaddressbook/addresseeeditorwidget.cpp kdepim-3.1/kaddressbook/addresseeeditorwidget.cpp
--- kdepim-kontact-0.2.1/kaddressbook/addresseeeditorwidget.cpp	Thu Nov 14 19:47:28 2002
+++ kdepim-3.1/kaddressbook/addresseeeditorwidget.cpp	Tue Jan 14 10:04:27 2003
@@ -162,8 +162,7 @@ void AddresseeEditorWidget::setupTab1()

   // File as (formatted name)
   label = new QLabel( i18n("Formatted name:"), tab1 );
-  mFormattedNameBox = new KComboBox(tab1, "mFormattedNameBox");
-  mFormattedNameBox->setEditable(true);
+  mFormattedNameBox = new KComboBox(true, tab1, "mFormattedNameBox");
   mFormattedNameBox->setDuplicatesEnabled(false);
   mFormattedNameBox->setAutoCompletion(true);
   label->setBuddy( mFormattedNameBox );
diff -dup kdepim-kontact-0.2.1/kaddressbook/kabprefs.cpp kdepim-3.1/kaddressbook/kabprefs.cpp
--- kdepim-kontact-0.2.1/kaddressbook/kabprefs.cpp	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/kabprefs.cpp	Mon Jul  1 02:15:35 2002
@@ -29,7 +29,6 @@
 KABPrefs *KABPrefs::sInstance = 0;

 KABPrefs::KABPrefs()
-  : KPimPrefs("kaddressbookrc")
 {
   KPrefs::setCurrentGroup( "Views" );

diff -dup kdepim-kontact-0.2.1/kaddressbook/kaddressbook.cpp kdepim-3.1/kaddressbook/kaddressbook.cpp
--- kdepim-kontact-0.2.1/kaddressbook/kaddressbook.cpp	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/kaddressbook.cpp	Fri Dec  6 06:49:58 2002
@@ -75,7 +75,7 @@ KAddressBook::KAddressBook( QWidget *par
                              "X-Anniversary", "KADDRESSBOOK" );

   // Create the GUI
-  mViewManager = new ViewManager(mDocument, ViewManager::config(),
+  mViewManager = new ViewManager(mDocument, kapp->config(),
                                  this, "mViewManager");
   topLayout->addWidget(mViewManager);
   connect(mViewManager, SIGNAL(selected(const QString &)),
diff -dup kdepim-kontact-0.2.1/kaddressbook/kaddressbook_part.cpp kdepim-3.1/kaddressbook/kaddressbook_part.cpp
--- kdepim-kontact-0.2.1/kaddressbook/kaddressbook_part.cpp	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/kaddressbook_part.cpp	Fri Dec  6 06:49:58 2002
@@ -30,7 +30,6 @@
 #include <kiconloader.h>
 #include <kaction.h>
 #include <kdebug.h>
-#include <kstandarddirs.h>
 #include <kparts/genericfactory.h>

 #include "kaddressbook.h"
@@ -74,14 +73,13 @@ KAddressbookPart::KAddressbookPart(QWidg

   widget->show();

-  mActionManager = new ActionManager(this, widget, true, this);
+  mActionManager = new ActionManager(this, widget, false, this);

   setXMLFile( "kaddressbook_part.rc" );
 }

 KAddressbookPart::~KAddressbookPart()
 {
-  widget->save();
   closeURL();
 }

diff -dup kdepim-kontact-0.2.1/kaddressbook/kaddressbook_part.rc kdepim-3.1/kaddressbook/kaddressbook_part.rc
--- kdepim-kontact-0.2.1/kaddressbook/kaddressbook_part.rc	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/kaddressbook_part.rc	Sun Oct 27 08:22:26 2002
@@ -1,11 +1,8 @@
 <!DOCTYPE kpartgui>
-<kpartgui name="kaddressbook" version="7">
+<kpartgui name="kaddressbook" version="5">

   <MenuBar>
     <Menu name="file"><text>&amp;File</text>
-      <Action name="kaddressbook_print"/>
-      <Action name="kaddressbook_mail"/>
-      <Separator/>
       <Action name="file_new_contact"/>
       <Action name="file_properties"/>
       <Separator/>
@@ -13,7 +10,8 @@

       <Menu name="file_import"><text>&amp;Import</text>
         <Action name="file_import_kde2"/>
-        <Action name="file_import_vcard"/>
+        <Action name="file_import_vcard21"/>
+        <Action name="file_import_vcard30"/>
         <Action name="file_import_csv"/>
       </Menu>

@@ -24,86 +22,69 @@
     </Menu>

     <Menu name="edit"><text>&amp;Edit</text>
-      <Action name="kaddressbook_undo"/>
-      <Action name="kaddressbook_redo"/>
-      <Separator/>
-      <Action name="kaddressbook_cut"/>
-      <Action name="kaddressbook_copy"/>
-      <Action name="kaddressbook_paste"/>
-      <Action name="edit_delete"/>
-      <Separator/>
-      <Action name="kaddressbook_select_all"/>
+      <Action name="edit_delete" append="edit_paste_merge"/>
     </Menu>

     <Menu name="view"><text>&amp;View</text>
       <ActionList name="view_loadedviews"/>
       <Separator/>
-      <Action name="view_add"/>
       <Action name="view_modify"/>
       <Action name="view_delete"/>
+      <Action name="view_add"/>
       <Separator/>
       <Action name="view_refresh"/>
-      <Separator/>
-      <Action name="select_filter"/>
-      <Separator/>
     </Menu>

     <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
-      <Action name="options_show_features"/>
       <Action name="options_show_jump_bar"/>
+      <Action name="options_show_inc_search"/>
+      <Action name="options_show_features"/>
       <Action name="options_show_details"/>
+      <Action name="options_show_filter_selector"/>
+      <Action name="options_show_toolbar"/>
       <Action name="options_show_statusbar"/>
       <Merge name="show_merge"/>
       <Separator/>
       <Merge/>
       <Action name="options_edit_filters"/>
       <Separator/>
-      <Action name="kaddressbook_configure_shortcuts"/>
+      <Action name="options_configure_keybinding"/>
       <Action name="options_configure_toolbars"/>
-      <Action name="kaddressbook_configure"/>
+      <Action name="options_configure"/>
       <Merge name="configure_merge"/>
     </Menu>

   </MenuBar>

   <ToolBar name="mainToolBar" noMerge="1"><text>Main Toolbar</text>
-    <Action name="file_sync" />
-    <Action name="kaddressbook_print" />
     <Separator/>
-    <Action name="file_new_contact"/>
-    <Action name="file_properties"/>
+    <Action name="file_sync" />
+    <Action name="file_print" />
     <Separator/>
-    <Action name="kaddressbook_mail"/>
+    <Action name="edit_undo"/>
+    <Action name="edit_redo"/>
     <Separator/>
     <Action name="ldap_lookup"/>
   </ToolBar>

   <ToolBar name="addresseeToolBar" noMerge="1"><text>Contact Toolbar</text>
-    <Action name="edit_undo"/>
-    <Action name="edit_redo"/>
+    <Action name="file_new_contact"/>
+    <Action name="file_properties"/>
+    <Action name="edit_delete"/>
+    <Separator/>
+    <Action name="file_mail"/>
     <Separator/>
     <Action name="edit_cut"/>
     <Action name="edit_copy"/>
     <Action name="edit_paste"/>
-    <Separator/>
-    <Action name="edit_delete"/>
   </ToolBar>

   <ToolBar name="viewToolBar" noMerge="1"><text>View Toolbar</text>
+    <Action name="view_delete"/>
     <Action name="view_add"/>
     <Action name="view_modify"/>
-    <Action name="view_delete"/>
     <Separator/>
     <Action name="view_refresh"/>
-    <Separator/>
-    <Action name="options_show_features"/>
-    <Separator/>
-  </ToolBar>
-
-  <ToolBar name="filterToolBar" noMerge="1"><text>Filter Toolbar</text>
-    <Action name="options_edit_filters"/>
-    <Action name="select_filter"/>
-    <Separator/>
   </ToolBar>

 </kpartgui>
diff -dup kdepim-kontact-0.2.1/kaddressbook/kaddressbookmain.cpp kdepim-3.1/kaddressbook/kaddressbookmain.cpp
--- kdepim-kontact-0.2.1/kaddressbook/kaddressbookmain.cpp	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/kaddressbookmain.cpp	Sun Oct 27 08:22:26 2002
@@ -99,8 +99,10 @@ void KAddressBookMain::initActions()
 {
   KStdAction::quit( this, SLOT(close()), actionCollection() );

+  KStdAction::preferences( mWidget, SLOT( configure() ), actionCollection() );
   KStdAction::configureToolbars( this, SLOT( configureToolbars() ),
                                  actionCollection() );
+  KStdAction::keyBindings(this, SLOT( configureKeys()), actionCollection() );
 }

 void KAddressBookMain::configureToolbars()
diff -dup kdepim-kontact-0.2.1/kaddressbook/kaddressbookui.rc kdepim-3.1/kaddressbook/kaddressbookui.rc
--- kdepim-kontact-0.2.1/kaddressbook/kaddressbookui.rc	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/kaddressbookui.rc	Sun Oct 27 08:22:26 2002
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui name="kaddressbook" version="8">
+<kpartgui name="kaddressbook" version="7">

   <MenuBar>
     <Menu name="file"><text>&amp;File</text>
diff -dup kdepim-kontact-0.2.1/kaddressbook/ldapoptionswidget.cpp kdepim-3.1/kaddressbook/ldapoptionswidget.cpp
--- kdepim-kontact-0.2.1/kaddressbook/ldapoptionswidget.cpp	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/ldapoptionswidget.cpp	Fri Jan  3 15:05:25 2003
@@ -36,7 +36,6 @@

 #include "addhostdialog.h"
 #include "ldapoptionswidget.h"
-#include "viewmanager.h"

 class LDAPServer
 {
@@ -150,7 +149,7 @@ void LDAPOptionsWidget::slotRemoveHost()

 void LDAPOptionsWidget::restoreSettings()
 {
-  KConfig *config = ViewManager::config();
+  KConfig *config = kapp->config();
   config->setGroup( "LDAP" );

   QString host;
@@ -178,7 +177,7 @@ void LDAPOptionsWidget::restoreSettings(

 void LDAPOptionsWidget::saveSettings()
 {
-  KConfig *config = ViewManager::config();
+  KConfig *config = kapp->config();
   config->deleteGroup( "LDAP" );

   config->setGroup("LDAP");
diff -dup kdepim-kontact-0.2.1/kaddressbook/ldapsearchdialogimpl.cpp kdepim-3.1/kaddressbook/ldapsearchdialogimpl.cpp
--- kdepim-kontact-0.2.1/kaddressbook/ldapsearchdialogimpl.cpp	Mon Mar  3 19:00:54 2003
+++ kdepim-3.1/kaddressbook/ldapsearchdialogimpl.cpp	Sun Oct 27 08:22:26 2002
@@ -28,11 +28,10 @@
 #include <kconfig.h>
 #include <kpushbutton.h>
 #include <kmessagebox.h>
-#include <qvaluelist.h>
+#include <qvaluelist.h>
 #include <qapplication.h>

 #include "ldapsearchdialogimpl.h"
-#include "viewmanager.h"

 static QString join( const KABC::LdapAttrValue& lst, const QString& sep )
 {
@@ -100,7 +99,7 @@ LDAPSearchDialogImpl::LDAPSearchDialogIm
   filterCombo->insertItem( i18n( "Name" ) );
   filterCombo->insertItem( i18n( "Email" ) );
   filterCombo->insertItem( i18n( "Phone Number" ) );
-
+
   resultListView->setSelectionMode( QListView::Multi );
   resultListView->setAllColumnsShowFocus( true );
   resultListView->setShowSortIndicator( true );
@@ -125,16 +124,16 @@ void LDAPSearchDialogImpl::rereadConfig(
 {
   // Create one KABC::LdapClient per selected server and configure it.

-  // First clean the list to make sure it is empty at
+  // First clean the list to make sure it is empty at
   // the beginning of the process
   mLdapClientList.setAutoDelete( true );
   mLdapClientList.clear();

-  // then read the config file and register all selected
+  // then read the config file and register all selected
   // server in the list
-  KConfig* config = ViewManager::config();
+  KConfig* config = kapp->config();
   config->setGroup( "LDAP" );
-  mNumHosts = config->readUnsignedNumEntry( "NumSelectedHosts" );
+  mNumHosts = config->readUnsignedNumEntry( "NumSelectedHosts" );
   if ( !mNumHosts ) {
     KMessageBox::error( this, i18n( "You must select a LDAP server before searching.\nYou can do this from the menu Settings/Configure KAddressBook." ) );
     mIsOK = false;
@@ -142,7 +141,7 @@ void LDAPSearchDialogImpl::rereadConfig(
     mIsOK = true;
     for ( int j = 0; j < mNumHosts; ++j ) {
       KABC::LdapClient* ldapClient = new KABC::LdapClient( this, "ldapclient" );
-
+
       QString host =  config->readEntry( QString( "SelectedHost%1" ).arg( j ), "" );
       if ( !host.isEmpty() )
         ldapClient->setHost( host );
@@ -165,11 +164,11 @@ void LDAPSearchDialogImpl::rereadConfig(
       connect( ldapClient, SIGNAL( result( const KABC::LdapObject& ) ),
 	       this, SLOT( slotAddResult( const KABC::LdapObject& ) ) );
       connect( ldapClient, SIGNAL( done() ),
-	       this, SLOT( slotSearchDone() ) );
+	       this, SLOT( slotSearchDone() ) );
       connect( ldapClient, SIGNAL( error( const QString& ) ),
 	       this, SLOT( slotError( const QString& ) ) );

-      mLdapClientList.append( ldapClient );
+      mLdapClientList.append( ldapClient );
     }

 /** CHECKIT*/
@@ -221,7 +220,7 @@ void LDAPSearchDialogImpl::slotSetScope(
     if ( rec )
       client->setScope( "sub" );
     else
-      client->setScope( "one" );
+      client->setScope( "one" );
   }
 }

@@ -261,7 +260,7 @@ void LDAPSearchDialogImpl::slotStartSear

   QString filter = makeFilter( searchEdit->text().stripWhiteSpace(), filterCombo->currentText() );

-   // loop in the list and run the KABC::LdapClients
+   // loop in the list and run the KABC::LdapClients
   resultListView->clear();
   for( KABC::LdapClient* client = mLdapClientList.first(); client; client = mLdapClientList.next() ) {
     client->startQuery( filter );
@@ -394,30 +393,9 @@ QString LDAPSearchDialogImpl::selectedEM
   return result.join( ", " );
 }

-#include <dcopclient.h>
 void LDAPSearchDialogImpl::slotSendMail()
 {
-  QCString name = "kontact";
-  if (kapp->name() == name) {
-    QByteArray data;
-    QDataStream stream(data, IO_WriteOnly);
-    stream << selectedEMails();
-    stream << QString("");
-    stream << QString("");
-    stream << QString("");
-    stream << QString("");
-    stream << (bool)false;
-    kapp->dcopClient()->send(name, "KMailIface", "openComposer(QString,QString,QString,QString,QString,bool)", data );
-  } else {
-    KConfig config("emaildefaults");
-    config.setGroup( QString::fromLatin1("PROFILE_Default") );
-    QString command = config.readEntry("EmailClient");
-    config.writeEntry("EmailClient", "kmail --composer -s %s -c %c -b %b --body %B --attach %A %t");
-    config.sync();
-    kapp->invokeMailer( selectedEMails(), "" );
-    config.writeEntry("EmailClient", command );
-    config.sync();
-  }
+  kapp->invokeMailer( selectedEMails(), "" );
 }

 void LDAPSearchDialogImpl::slotSelectAll()
diff -dup kdepim-kontact-0.2.1/kaddressbook/main.cpp kdepim-3.1/kaddressbook/main.cpp
--- kdepim-kontact-0.2.1/kaddressbook/main.cpp	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/main.cpp	Sun Oct 27 08:22:26 2002
@@ -3,13 +3,11 @@
 #include <qstring.h>

 #include <kcmdlineargs.h>
-#include <kconfig.h>
 #include <klocale.h>
 #include <kaboutdata.h>
 #include <kdebug.h>
 #include <kuniqueapplication.h>
 #include <kwin.h>
-#include <kstandarddirs.h>
 #include <kstartupinfo.h>

 #include "kaddressbookmain.h"
diff -dup kdepim-kontact-0.2.1/kaddressbook/viewmanager.cpp kdepim-3.1/kaddressbook/viewmanager.cpp
--- kdepim-kontact-0.2.1/kaddressbook/viewmanager.cpp	Mon Mar  3 19:00:47 2003
+++ kdepim-3.1/kaddressbook/viewmanager.cpp	Tue Jan 14 10:04:31 2003
@@ -46,7 +46,6 @@
 #include <kmessagebox.h>
 #include <kmultipledrag.h>
 #include <libkdepim/kvcarddrag.h>
-#include <kstandarddirs.h>

 #include "undo.h"
 #include "undocmds.h"
@@ -165,31 +164,10 @@ QStringList ViewManager::selectedUids()
   return mActiveView->selectedUids();
 }

-#include <dcopclient.h>
 void ViewManager::sendMail()
 {
   QString emailAddrs = mActiveView->selectedEmails();
-  QCString name = "kontact";
-  if (kapp->name() == name) {
-    QByteArray data;
-    QDataStream stream(data, IO_WriteOnly);
-    stream << emailAddrs;
-    stream << QString("");
-    stream << QString("");
-    stream << QString("");
-    stream << QString("");
-    stream << (bool)false;
-    kapp->dcopClient()->send(name, "KMailIface", "openComposer(QString,QString,QString,QString,QString,bool)", data );
-  } else {
-    KConfig config("emaildefaults");
-    config.setGroup( QString::fromLatin1("PROFILE_Default") );
-    QString command = config.readEntry("EmailClient");
-    config.writeEntry("EmailClient", "kmail --composer -s %s -c %c -b %b --body %B --attach %A %t");
-    config.sync();
-    kapp->invokeMailer( emailAddrs, "" );
-    config.writeEntry("EmailClient", command );
-    config.sync();
-  }
+  kapp->invokeMailer( emailAddrs, "" );
 }

 void ViewManager::sendMail(const QString& addressee)
@@ -298,7 +276,7 @@ void ViewManager::setActiveView(const QS
     // Check if we found the view. If we didn't, then we need to create it
     if (view == 0)
     {
-      KConfig *config = ViewManager::config();
+      KConfig *config = kapp->config();
       config->setGroup(name);
       QString type = config->readEntry("Type", "Table");

@@ -448,7 +426,7 @@ void ViewManager::deleteView()
     mViewNameList.remove(mActiveView->name());

     // remove the view from the config file
-    KConfig *config = ViewManager::config();
+    KConfig *config = kapp->config();
     config->deleteGroup( mActiveView->name() );

     mViewDict.remove(mActiveView->name());
@@ -491,7 +469,7 @@ void ViewManager::addView()

     // write the view to the config file,
     // launch the view config dialog
-    KConfig *config = ViewManager::config();
+    KConfig *config = kapp->config();
     config->deleteGroup(newName);   // Incase they had this view before
     config->setGroup(newName);
     config->writeEntry("Type", type);
@@ -588,13 +566,15 @@ void ViewManager::refreshIncrementalSear
 void ViewManager::incSearch(const QString& text, int field)
 {
     mCurrentIncSearchField=mIncrementalSearchFields[field];
-    mActiveView->incrementalSearch(text, mCurrentIncSearchField);
+    if( mActiveView )
+        mActiveView->incrementalSearch(text, mCurrentIncSearchField);
 }

 void ViewManager::jumpToLetter(const QChar &ch)
 {
   // Jumping always works based on the first field
-    mActiveView->incrementalSearch(QString(ch), mCurrentIncSearchField);
+    if ( mActiveView )
+        mActiveView->incrementalSearch(QString(ch), mCurrentIncSearchField);
 }

 void ViewManager::setJumpButtonBarVisible(bool visible)
@@ -768,14 +748,5 @@ void ViewManager::showFeatures( int id )
     mFeatureBar->show();
   }
 }
-
-KConfig* ViewManager::config()
-{
-  static KConfig *mConfig = 0;
-  if (!mConfig)
-    mConfig = new KConfig( locateLocal( "config", "kaddressbookrc" ) );
-  return mConfig;
-}
-

 #include "viewmanager.moc"
diff -dup kdepim-kontact-0.2.1/kaddressbook/viewmanager.h kdepim-3.1/kaddressbook/viewmanager.h
--- kdepim-kontact-0.2.1/kaddressbook/viewmanager.h	Mon Dec 23 04:33:05 2002
+++ kdepim-3.1/kaddressbook/viewmanager.h	Sun Oct 27 08:22:26 2002
@@ -109,10 +109,6 @@ class ViewManager : public QWidget
     */
     const Filter::List &filters() const { return mFilterList; }

-    /** @return KConfig for kaddressbookrc, useful for when KAddressBook
-	is used as a KPart */
-    static KConfig *config();
-
   public slots:
     /** Reads the config file.
     */

--Boundary-00=_Utzb+DnMc1zmh7v--