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

List:       kde-commits
Subject:    kdeextragear-1/datakiosk/src
From:       Adam Treat <manyoso () yahoo ! com>
Date:       2005-03-01 4:20:12
Message-ID: 20050301042012.1C4C716EF1 () office ! kde ! org
[Download RAW message or body]

CVS commit by treat: 

* Fix a serious slow down that cropped up after switching back over to a heavy
database.


  M +2 -6      datatable.cpp   1.16
  M +9 -1      datatableedit.cpp   1.10
  M +2 -0      datatableedit.h   1.6
  M +5 -0      datatableview.cpp   1.5
  M +1 -1      datatableview.h   1.5
  M +0 -3      project.cpp   1.10


--- kdeextragear-1/datakiosk/src/datatable.cpp  #1.15:1.16
@@ -110,8 +110,5 @@ bool DataTable::initialize()
 
     if ( parentName() == QString::null )
-    {
-        m_tableView->selectRow( 0 );
-        m_tableView->sqlCursor() ->first();
-    }
+        slotSelectFirstRow();
     else
         emit requestParentSelect();
@@ -446,6 +443,5 @@ void DataTable::slotUpdate()
     {
         /*        kdDebug() << "selectionChanged: " << name() << endl;*/
-        m_tableEdit->refresh();
-        m_tableEdit->seek( m_tableView->currentRow() );
+        m_tableEdit->setCurrentRow( m_tableView->currentRow() );
         emit mycurrentChanged( m_tableView->sqlCursor() );
     }

--- kdeextragear-1/datakiosk/src/datatableedit.cpp  #1.9:1.10
@@ -52,5 +52,6 @@ DataTableEdit::DataTableEdit( QWidget *p
         : QDataBrowser( parent, name ),
         m_commit( 0L ),
-        m_refreshing( false )
+        m_refreshing( false ),
+        m_currentRow( 0 )
 {
     setAutoEdit( false );
@@ -149,4 +150,10 @@ QFrame* DataTableEdit::getFormBox() cons
 }
 
+void DataTableEdit::setCurrentRow( int row )
+{
+    m_currentRow = row;
+    seek( row, FALSE);
+}
+
 bool DataTableEdit::seek( int i, bool relative )
 {
@@ -201,4 +208,5 @@ void DataTableEdit::update()
     QDataBrowser::update();
     readFields();
+    seek( m_currentRow, FALSE );
     changeColorBox( Qt::green );
     m_commit->setEnabled( false );

--- kdeextragear-1/datakiosk/src/datatableedit.h  #1.5:1.6
@@ -52,4 +52,5 @@ public:
     ScrollForm* getScrollView() const;
     QFrame* getFormBox() const;
+    void setCurrentRow( int row );
     
     virtual bool seek( int i, bool relative = FALSE );
@@ -86,4 +87,5 @@ private:
     QPushButton *m_commit;
     bool m_refreshing;
+    int m_currentRow;
 };
 

--- kdeextragear-1/datakiosk/src/datatableview.cpp  #1.4:1.5
@@ -84,4 +84,9 @@ void DataTableView::slotSelectLastRow( b
 }
 
+void DataTableView::handleError( const QSqlError &error )
+{
+    QDataTable::handleError( error );
+}
+
 void DataTableView::paintCell( QPainter * p, int row, int col, const QRect & cr,
                            bool selected, const QColorGroup &cg )

--- kdeextragear-1/datakiosk/src/datatableview.h  #1.4:1.5
@@ -34,5 +34,5 @@ public slots:
 
 protected:
-
+    void handleError( const QSqlError & error );
     virtual void paintCell( QPainter * p, int row, int col, const QRect & cr,
                             bool selected, const QColorGroup &cg );

--- kdeextragear-1/datakiosk/src/project.cpp  #1.9:1.10
@@ -787,8 +787,5 @@ bool Project::loadDataTables()
                     DataTable *table = dataTableByName( componentDataTable );
                     if ( !table )
-                    {
-                        kdDebug() << "here" << endl;
                         continue;
-                    }
                     DataField *field = table ->dataField( componentDataField );
 


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

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