mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 08:41:54 +00:00
Update copyWithZone: method, provide simple implementation of addSelectionIndexPaths:
This commit is contained in:
parent
0f4e1711d0
commit
647076cb8a
1 changed files with 24 additions and 7 deletions
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
The tree controller class.
|
The tree controller class.
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012, 2024 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Author: Gregory Casamento <greg.casamento@gmail.com>
|
Author: Gregory Casamento <greg.casamento@gmail.com>
|
||||||
Date: 2012
|
Date: 2012, 2024
|
||||||
|
|
||||||
This file is part of the GNUstep GUI Library.
|
This file is part of the GNUstep GUI Library.
|
||||||
|
|
||||||
|
@ -98,8 +98,14 @@
|
||||||
|
|
||||||
- (BOOL) addSelectionIndexPaths: (NSArray *)indexPaths
|
- (BOOL) addSelectionIndexPaths: (NSArray *)indexPaths
|
||||||
{
|
{
|
||||||
// FIXME
|
BOOL f = [self commitEditing];
|
||||||
return NO;
|
|
||||||
|
if (YES == f)
|
||||||
|
{
|
||||||
|
[_selection_index_paths addObjectsFromArray: indexPaths];
|
||||||
|
}
|
||||||
|
|
||||||
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) alwaysUsesMultipleValuesMarker
|
- (BOOL) alwaysUsesMultipleValuesMarker
|
||||||
|
@ -520,9 +526,20 @@
|
||||||
|
|
||||||
- (id) copyWithZone: (NSZone*)zone
|
- (id) copyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
NSData *data = [NSArchiver archivedDataWithRootObject: self];
|
id copy = [[NSTreeController allocWithZone: zone] initWithContent: [self content]];
|
||||||
id result = [NSUnarchiver unarchiveObjectWithData: data];
|
|
||||||
return result;
|
if (copy != nil)
|
||||||
|
{
|
||||||
|
[copy setChildrenKeyPath: [self childrenKeyPath]];
|
||||||
|
[copy setCountKeyPath: [self countKeyPath]];
|
||||||
|
[copy setLeafKeyPath: [self leafKeyPath]];
|
||||||
|
|
||||||
|
[copy setAvoidsEmptySelection: [self avoidsEmptySelection]];
|
||||||
|
[copy setPreservesSelection: [self preservesSelection]];
|
||||||
|
[copy setSelectsInsertedObjects: [self selectsInsertedObjects]];
|
||||||
|
}
|
||||||
|
|
||||||
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue