CPTableView: -_reloadDataViewsImmediately -> -reloadData

CPTableColumn: binder:-setValueFor:  is a simple data reload.
This commit is contained in:
cacaodev
2014-09-23 12:17:52 +02:00
parent 2dccd2f30b
commit f82099143f
3 changed files with 7 additions and 25 deletions
-6
View File
@@ -1321,12 +1321,6 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
[self reloadData];
}
- (BOOL)_dataViewsNeedReloadAfterContentChange
{
// Alternatively, check if the current tree of views mactches the current tree in the data source.
return YES;
}
/*!
Reloads all the data of the outlineview.
*/
+2 -1
View File
@@ -564,7 +564,8 @@ CPTableColumnUserResizingMask = 1 << 1;
rowIndexes = [CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, [tableView numberOfRows])],
columnIndexes = [CPIndexSet indexSetWithIndex:column];
[tableView reloadDataForRowIndexes:rowIndexes columnIndexes:columnIndexes];
// Reloads objectValues only, not the views.
[tableView _reloadDataForRowIndexes:rowIndexes columnIndexes:columnIndexes];
}
- (CPSortDescriptor)_defaultSortDescriptorPrototype
+5 -18
View File
@@ -616,9 +616,8 @@ NOT YET IMPLEMENTED
*/
- (void)reloadData
{
// Empty the data cache.
_objectValues = { };
[self _reloadDataViewsImmediately];
[self _reloadDataViews];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
/*!
@@ -641,11 +640,6 @@ NOT YET IMPLEMENTED
}];
}
- (BOOL)_dataViewsNeedReloadAfterContentChange
{
return (_numberOfRows !== [self _numberOfRows]);
}
// Reloads the views AND the data
- (void)_reloadDataViews
{
@@ -668,13 +662,6 @@ NOT YET IMPLEMENTED
[self setNeedsDisplay:YES];
}
// reload data views and process events to force a -load
- (void)_reloadDataViewsImmediately
{
[self _reloadDataViews];
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
//Target-action Behavior
/*!
Sets the message sent to the target when the user double-clicks an
@@ -1152,7 +1139,7 @@ NOT YET IMPLEMENTED
else
_dirtyTableColumnRangeIndex = MIN(index, _dirtyTableColumnRangeIndex);
[self _reloadDataViewsImmediately];
[self reloadData];
}
/*!
@@ -3804,7 +3791,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
- (void)enumerateAvailableViewsUsingBlock:(Function/*CPView *dataView, CPInteger row, CPInteger column*, @ref stop*/)handler
{
[self _reloadDataViewsImmediately];
[self reloadData];
[self _enumerateViewsInRows:_exposedRows columns:_exposedColumns usingBlock:handler];
}
@@ -5206,7 +5193,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
if (![self isRowSelected:rowIndex])
[[CPException exceptionWithName:@"Error" reason:@"Attempt to edit row " + rowIndex + " when not selected." userInfo:nil] raise];
[self _reloadDataViewsImmediately];
[self reloadData];
[self scrollRowToVisible:rowIndex];
[self scrollColumnToVisible:columnIndex];