[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kde3support/kdeui
From:       Christoph Feck <christoph () maxiom ! de>
Date:       2008-12-19 1:01:45
Message-ID: 1229648505.638658.14677.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 898774 by cfeck:

Fix crash due to accessing uninitialized d-pointer


 M  +10 -4     k3listview.cpp  


--- trunk/KDE/kdelibs/kde3support/kdeui/k3listview.cpp #898773:898774
@@ -74,12 +74,12 @@
 class K3ListView::K3ListViewPrivate
 {
 public:
-  K3ListViewPrivate (K3ListView* listview)
+  K3ListViewPrivate ()
     : pCurrentItem (0),
       autoSelectDelay(0),
       dragOverItem(0),
       dragDelay (KGlobalSettings::dndEventDelay()),
-      editor (new K3ListViewLineEdit (listview)),
+      editor (0),
       cursorInExecuteArea(false),
       itemsMovable (true),
       selectedBySimpleMove(false),
@@ -109,7 +109,6 @@
       shadeSortColumn(KGlobalSettings::shadeSortColumn())
   {
       renameable.append(0);
-      connect(editor, SIGNAL(done(Q3ListViewItem*,int)), listview, \
SLOT(doneEditing(Q3ListViewItem*,int)));  }
 
   ~K3ListViewPrivate ()
@@ -117,6 +116,12 @@
     delete editor;
   }
 
+  void createEditor (K3ListView *listview)
+  {
+      editor = new K3ListViewLineEdit (listview);
+      connect(editor, SIGNAL(done(Q3ListViewItem*,int)), listview, \
SLOT(doneEditing(Q3ListViewItem*,int))); +  }
+
   Q3ListViewItem* pCurrentItem;
 
   QTimer autoSelect;
@@ -413,8 +418,9 @@
 
 K3ListView::K3ListView( QWidget *parent )
   : Q3ListView( parent ),
-        d (new K3ListViewPrivate (this))
+        d (new K3ListViewPrivate)
 {
+  d->createEditor(this);
   setDragAutoScroll(true);
 
   connect( this, SIGNAL( onViewport() ),


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic