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

List:       kde-commits
Subject:    koffice/kchart/shape
From:       Johannes Simon <johannes.simon () gmail ! com>
Date:       2010-01-30 0:01:15
Message-ID: 1264809675.896192.28510.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1082206 by jsimon:

Apply Dag Anderson's patch that lets ChartProxyModel handle source model resets.

Dag: Sorry it took me so long, found this patch while going through a continously \
growing stack of starred mails. ;)

CCMAIL:danders@get2net.dk



 M  +9 -0      ChartProxyModel.cpp  
 M  +3 -0      ChartProxyModel.h  


--- trunk/koffice/kchart/shape/ChartProxyModel.cpp #1082205:1082206
@@ -363,6 +363,8 @@
     beginResetModel();
 
     if ( this->sourceModel() ) {
+        disconnect( this->sourceModel(), SIGNAL( modelReset() ),
+                    this,                SLOT( slotModelReset() ) );
         disconnect( this->sourceModel(), SIGNAL( dataChanged( const QModelIndex&, \
                const QModelIndex& ) ),
                     this,                SLOT( dataChanged( const QModelIndex&, \
                const QModelIndex& ) ) );
         disconnect( this->sourceModel(), SIGNAL( rowsInserted( const QModelIndex&, \
int, int ) ), @@ -376,6 +378,8 @@
     }
 
     if ( sourceModel ) {
+        connect( sourceModel, SIGNAL( modelReset() ),
+                 this,        SLOT( slotModelReset() ) );
         connect( sourceModel, SIGNAL( dataChanged( const QModelIndex&, const \
                QModelIndex& ) ),
                  this,        SLOT( dataChanged( const QModelIndex&, const \
                QModelIndex& ) ) );
         connect( sourceModel, SIGNAL( rowsInserted( const QModelIndex&, int, int ) \
), @@ -867,5 +871,10 @@
     endResetModel();
 }
 
+void ChartProxyModel::slotModelReset()
+{
+    rebuildDataMap();
+    reset(); // propagate
+}
 
 #include "ChartProxyModel.moc"
--- trunk/koffice/kchart/shape/ChartProxyModel.h #1082205:1082206
@@ -111,6 +111,9 @@
 signals:
     void dataChanged();
 
+protected slots:
+    void slotModelReset();
+
 protected:
     // TODO: Remove once we depend on Qt 4.6
     // For compatability with Qt < 4.6


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

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