mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-17 12:10:42 +00:00
Fix for issue 1507 CPTableview autosave tablecolumns
This commit is contained in:
1 parent
5763ebdf2b
commit
5384a9e86f
1 file changed
+9
-4
@@ -2285,6 +2285,7 @@ NOT YET IMPLEMENTED
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
/// debugging autosave
|
||||
- (void)_restoreFromAutosave
|
||||
{
|
||||
if (![self _autosaveEnabled])
|
||||
@@ -2294,19 +2295,23 @@ NOT YET IMPLEMENTED
|
||||
autosaveName = [self autosaveName],
|
||||
tableColumns = [userDefaults objectForKey:[self _columnsKeyForAutosaveName:autosaveName]];
|
||||
|
||||
if([tableColumns count] != [[self tableColumns] count])
|
||||
return;
|
||||
|
||||
for (var i = 0; i < [tableColumns count]; i++)
|
||||
{
|
||||
var metaData = [tableColumns objectAtIndex:i],
|
||||
columnIdentifier = [metaData objectForKey:@"identifier"],
|
||||
column = [self columnWithIdentifier:columnIdentifier],
|
||||
tableColumn = [self tableColumnWithIdentifier:columnIdentifier];
|
||||
|
||||
[self _moveColumn:column toColumn:i];
|
||||
[tableColumn setWidth:[metaData objectForKey:@"width"]];
|
||||
if(tableColumn && column != CPNotFound)
|
||||
{
|
||||
[self _moveColumn:column toColumn:i];
|
||||
[tableColumn setWidth:[metaData objectForKey:@"width"]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
@anchor setdelegate
|
||||
Sets the delegate of the receiver.
|
||||
|
||||
Reference in new issue
Block a user