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

List:       kde-commits
Subject:    koffice/kexi/koproperty2/koproperty
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2008-11-12 19:17:05
Message-ID: 1226517425.547486.10912.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 883357 by staniek:

KoProperty2
- unset the current property set (that is about to be deleted) from the editor
  (fixes possible crash)



 M  +13 -7     EditorView.cpp  
 M  +3 -0      EditorView.h  


--- trunk/koffice/kexi/koproperty2/koproperty/EditorView.cpp #883356:883357
@@ -30,6 +30,7 @@
 #include <QtGui/QVBoxLayout>
 #include <QtGui/QMouseEvent>
 #include <QtGui/QToolTip>
+#include <QtGui/QApplication>
 
 #include <KLocale>
 #include <KIconLoader>
@@ -339,23 +340,21 @@
     }
 
     d->set = set;
+    if (d->set) {
 /*not needed 
-    if (d->set) {
         //receive property changes
         connect(d->set, SIGNAL(propertyChangedInternal(KoProperty::Set&, KoProperty::Property&)),
                 this, SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&)));
         connect(d->set, SIGNAL(propertyReset(KoProperty::Set&, KoProperty::Property&)),
-                this, SLOT(slotPropertyReset(KoProperty::Set&, KoProperty::Property&)));
-        connect(d->set, SIGNAL(aboutToBeCleared()), this, SLOT(slotSetWillBeCleared()));
+                this, SLOT(slotPropertyReset(KoProperty::Set&, KoProperty::Property&)));*/
+//NEEDED?        connect(d->set, SIGNAL(aboutToBeCleared()), this, SLOT(slotSetWillBeCleared()));
         connect(d->set, SIGNAL(aboutToBeDeleted()), this, SLOT(slotSetWillBeDeleted()));
-    }*/
+    }
 
 //    fill();
     delete d->model;
     d->model = d->set ? new EditorDataModel(*d->set, this) : 0;
-    if (d->model) {
-        setModel( d->model );
-    }
+    setModel( d->model );
 
     emit propertySetChanged(d->set);
 
@@ -379,6 +378,13 @@
     }
 }
 
+void EditorView::slotSetWillBeDeleted()
+{
+//    qApp->processEvents();
+    changeSet(0, QByteArray());
+//    clearSelection();
+}
+
 void EditorView::setAutoSync(bool enable)
 {
     d->autoSync = enable;
--- trunk/koffice/kexi/koproperty2/koproperty/EditorView.h #883356:883357
@@ -129,6 +129,9 @@
     virtual void currentChanged( const QModelIndex & current, const QModelIndex & previous );
     virtual void commitData( QWidget * editor );
 
+    /*! Called when current property set is about to be destroyed. */
+    void slotSetWillBeDeleted();
+
 private:
     /*! Used by changeSet(). */
     void changeSetInternal(Set *set, SetOptions options, const QByteArray& propertyToSelect);
[prev in list] [next in list] [prev in thread] [next in thread] 

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