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

List:       kde-bugs-dist
Subject:    [Bug 102380] Information not cascading properly when a file is
From:       Adam Treat <manyoso () yahoo ! com>
Date:       2005-03-28 23:43:34
Message-ID: 20050328234334.30448.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=102380         
manyoso yahoo com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From manyoso yahoo com  2005-03-29 01:43 -------
CVS commit by treat: 

Make sure to reset the child table when doing a search on the parent table
turns up nothing.

BUGS:102380


  M +13 -5     datatable.cpp   1.23
  M +6 -5      datatableeditorfactory.cpp   1.22
  M +5 -5      datatablesearch.cpp   1.7


--- kdeextragear-1/datakiosk/src/datatable.cpp  #1.22:1.23
 @ -450,7 +450,13  @ bool DataTable::isRootTable()
 void DataTable::slotUpdate()
 {
-    if ( m_updatesAllowed && ( m_tableView->currentSelection() != -1 ) )
+    if ( !m_updatesAllowed )
+        return;
+
+    if ( m_tableView->currentSelection() == -1 && m_tableView->numRows() < 1 )
+    {
+        emit myCurrentChanged( 0L );
+    }
+    else
     {
-        /*        kdDebug() << "selectionChanged: " << name() << endl;*/
         m_tableEdit->setCurrentRow( m_tableView->currentRow() );
         emit myCurrentChanged( m_tableView->sqlCursor() );
 @ -468,11 +474,13  @ void DataTable::slotDetailFromMaster( QS
 
     QString fk = foreignKey();
-    QString pk = record->value( parentKey() ).toString();
+    QString pk;
+    if ( record )
+        pk = record->value( parentKey() ).toString();
+    else
+        pk = "-1";
     setDefaultFilter( fk.append( "='" ).append( pk ).append( "'" ) );
     m_tableView->setFilter( defaultFilter().append( searchFilter() ) );
     m_tableEdit->setFilter( m_tableView->filter() );
 
-    //     kdDebug() << "filter: " << m_tableView->filter() << endl;
-
     tableRefresh();
 

--- kdeextragear-1/datakiosk/src/datatableeditorfactory.cpp  #1.21:1.22
 @ -358,11 +358,9  @ void RelationCombo::initializeFields( bo
             if ( ( *it ) ->relation() ->constraint() != QString::null )
             {
+                m_constrained = true;
+
                 QSqlRecord* record = m_dataTable->dataTableView()->currentRecord();
                 if ( !record )
-                {
-                    kdDebug() << "here " << endl;
                     continue;
-                }
-                m_constrained = true;
 
                 if ( where.count() )
 @ -373,5 +371,6  @ void RelationCombo::initializeFields( bo
                 where.append( ( *it ) ->relation()->key() );
                 where.append( "=" );
-                where.append( record->value( ( *it ) ->relation()->constraint() ).toString() );
+                QString value = record->value( ( *it ) ->relation()->constraint() ).toString();
+                where.append( value );
             }
         }
 @ -422,4 +421,6  @ void RelationCombo::initializeFields( bo
     QSqlQuery query( fullquerystring, database->connection() );
 
+//     kdDebug() << fullquerystring << endl;
+
     int greatestWidth = 0;
     QFontMetrics fm = fontMetrics();
[prev in list] [next in list] [prev in thread] [next in thread] 

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