Bug 68370

Summary: Plugin selection list ever increasing
Product: [Applications] kontact Reporter: Stephan Binner <binner>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: sean.clarke
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Stephan Binner 2003-11-16 14:17:14 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

With every call of "Configure Kontacts..." the presented "Select Components" list gets bigger.
Comment 1 Stephan Binner 2003-11-19 09:57:08 UTC
*** Bug 68549 has been marked as a duplicate of this bug. ***
Comment 2 Stephan Binner 2003-11-20 14:14:23 UTC
Subject: kdelibs/kutils/ksettings

CVS commit by binner: 

Fixed Bug 68370: Plugin selection list ever increasing
CCMAIL: 68370-done@bugs.kde.org


  M +1 -0      componentsdialog.cpp   1.9


--- kdelibs/kutils/ksettings/componentsdialog.cpp  #1.8:1.9
@@ -104,4 +104,5 @@ void ComponentsDialog::show()
 {
     // construct the treelist
+    d->listview->clear();
     for( QValueList<KPluginInfo*>::ConstIterator it = d->plugininfolist.begin();
             it != d->plugininfolist.end(); ++it )


Comment 3 Sean Clarke 2003-12-09 01:23:31 UTC
Can confirm, fixed in KDE 3.2 beta 2
Comment 4 Matthias Kretz 2004-07-05 22:41:04 UTC
CVS commit by mkretz: 

Committing the real fix for #68370 which I had lying around locally for ages
(shame on me).
Also add a convenience method for adding plugin infos without having to
overwrite the whole list.

CCMAIL: 68370@bugs.kde.org


  M +9 -1      componentsdialog.cpp   1.10
  M +6 -2      componentsdialog.h   1.5


--- kdelibs/kutils/ksettings/componentsdialog.cpp  #1.9:1.10
@@ -86,4 +86,9 @@ ComponentsDialog::~ComponentsDialog()
 }
 
+void ComponentsDialog::addPluginInfo( KPluginInfo * info )
+{
+    d->plugininfolist.append( info );
+}
+
 void ComponentsDialog::setPluginInfos( const QMap<QString, KPluginInfo*> &
         plugininfos )
@@ -103,6 +108,9 @@ void ComponentsDialog::setPluginInfos( c
 void ComponentsDialog::show()
 {
-    // construct the treelist
+    // clear the treelist
     d->listview->clear();
+    d->plugininfomap.clear();
+
+    // construct the treelist
     for( QValueList<KPluginInfo*>::ConstIterator it = d->plugininfolist.begin();
             it != d->plugininfolist.end(); ++it )

--- kdelibs/kutils/ksettings/componentsdialog.h  #1.4:1.5
@@ -50,9 +50,13 @@ class ComponentsDialog : public KDialogB
 
         /**
-          Set list of plugins the dialog offers for selection.
+          Add a plugin that the dialog offers for selection.
+        */
+        void addPluginInfo( KPluginInfo * );
+        /**
+          Set list of plugins the dialog offers for selection. (Overwrites a previous list)
         */
         void setPluginInfos( const QMap<QString, KPluginInfo*> & plugininfos );
         /**
-          Set list of plugins the dialog offers for selection.
+          Set list of plugins the dialog offers for selection. (Overwrites a previous list)
         */
         void setPluginInfos( const QValueList<KPluginInfo *> &plugins );