Commit Graph
35 Commits
Author SHA1 Message Date
Alexander Ljungberg 6281c6469b Fix unit test warnings. 2013-01-24 00:08:47 +00:00
Martin Carlberg b52217e8a0 Tried to make the import mess a little better. Fixed a lot of bugs. Changed some class names in the test cases. Looks like all the tests are being run in the same space. Has to look into this….. 2012-12-17 00:40:26 +01:00
Martin Carlberg c297e926f9 Compiler now works with jake and can compiler the whole Cappuccino framework. A lot of test cases still fail 2012-12-16 17:38:47 +01:00
Ilya Kulakov c1ace9a7c3 Fix wrong indexes are selected when removing arranged objects. 2012-08-06 19:19:13 +07:00
Alexander Ljungberg 21a34f88b2 Fixed: don't crash when removing objects from an array controller which has its arrangedObjects.@count observed. 2012-04-20 15:12:59 +01:00
Alexander Ljungberg 0736f86f32 Fixed: "[CPString count] unrecognized selector" error when binding an array controller's content array to a key of another AC's selection.
This change also avoids wrapping a selection proxy in a KVO array proxy, which isn't helpful and probably hurts performance.
2012-03-07 16:49:41 +00:00
Alexander Ljungberg 9a32733f88 Fixed: incorrect bindings option in array controller test. 2012-03-07 13:04:20 +00:00
cacaodev 12201d38f3 CPArrayController : setAvoidsEmptySelection:YES should not apply when setting an empty selection explicitely. With tests. 2012-02-03 00:48:49 +01:00
Alexander Ljungberg 75d5619abd Clean up. 2011-12-29 20:12:11 +01:00
cacaodev b39f509263 CPArray (CPPredicate): -filteredArrayUsingPredicate: and -filterUsingPredicate:
Use CPArray methods (not js array) because the receiver can be a CPArray subclass. With tests.

Fixes the bug reported here: https://groups.google.com/forum/?pli=1#!topic/objectivej/8q9hqbZZUv0
2011-12-29 17:16:53 +01:00
Alexander Ljungberg 4195f3b8c6 Test that CPArrayController setSelectionIndexes: does not modify its input. 2011-09-07 18:02:53 +01:00
Alexander Ljungberg 01e35efdbb Refs #1343. Recreate manual bindings test as an automatic test. 2011-09-07 16:04:35 +01:00
Alexander Ljungberg b50005049e Fixed: array controller remove: would not only remove selected rows, but any other rows isEqual: to the selected rows. 2011-06-05 18:57:36 -04:00
Alexander Ljungberg 64e907156c Minor array controller optimisation: don't send a filterPredicate change notification if clearsFilterPredicateOnInsertion is YES but filterPredicate is already nil when insertObject:atArrangedObjectIndex: is called. 2011-06-03 00:00:39 -04:00
Alexander Ljungberg 5d01ca428c Optimise CPArrayController insertObject:atArrangedObjectIndex: by not attempting to arrange the content array. The given index is only meant for the arrangedObjects. 2011-06-02 23:41:03 -04:00
Alexander Ljungberg cf04fcc9d0 Verify correctness of observation notifications on arrangedObjects when the addObjects: message is sent. 2011-05-28 02:06:27 -04:00
Alexander Ljungberg 8aaa5fe07f Test array controller KVC binding correctness.
This change splits the insertObjectAtArrangedObjectIndex:, addObject:, and removeObject: tests into two versions: one for a regular AC setContent: setup and one for when the AC is bound to an array-like destination implementing KVC.
2011-04-02 18:09:16 -04:00
Brian Donovan abce41d6fd Make sure -[CPArrayController arrangedObjects] always has a non-nil value. 2011-03-15 19:53:14 -07:00
cacaodev 59cc590b51 CPArrayController -setContent: fixed a bug where objects where not rearranged if clearsFilterPredicateOnInsertion == YES and filterPredicate == nil. 2011-01-19 19:26:01 +01:00
Alexander Ljungberg 8ef7f07195 Fixed: CPArrayController's addObject and CPArray's insertObject:inArraySortedByDescriptors:.
CPArray insertObject:inArraySortedByDescriptors: now quickly inserts objects at the end of the array if no sort descriptors are specified.

CPArrayController initialises its sort descriptors to an empty array.

Fixed: array controller's addObject added objects to the arranged objects array in a different order than in the content array if no sort descriptor was set.
2010-12-14 23:33:14 +01:00
Klaas Pieter Annema 8345788e59 disable value caching in CPControllerSelectionProxy
More information here http://groups.google.com/group/objectivej-dev/browse_thread/thread/c100f16095073332.
2010-11-24 14:27:59 +01:00
Klaas Pieter Annema 34339fbcd9 several bindings / KVC fixes
- setValue:forKeyPath will now get call setValue:forKeyPath again on the value of the first part of the key path
- override valueForKeyPath: and valueForKey: in CPObjectController's CPControllerSelectionProxy to return controller markers when appropriate
- override setValue:forKeyPath: and setValue:forKey: in CPObjectController's CPControllerSelectionProxy to bypass possible controller markers

This commit also removes previous hacks for compound paths and adds test cases for the errors. All this is related to issue #967.
2010-11-23 14:18:22 +01:00
Brian Donovan 929ec28436 CPArrayController did not allow removing objects without a selection.
CPArrayController was erroneously using canRemove to determine whether explicit removal could take place, when in fact the documentation for [NSObjectController canRemove] (NSArrayController does not override canRemove) states that it returns "YES if an object can be removed from the receiver using remove:, otherwise NO", implying that it should only be used to check whether there is a selected element that can be removed (for example, to bind the enabled state of a toolbar button to a CPArrayController's canRemove property). It should not be used to decide whether a specific object can be removed or not.
2010-11-11 17:45:18 -08:00
Brian DonovanandFrancisco Ryan Tolmasky I 7bf2297125 -[CPArrayController setContent:] would interpret nil as [nil].
When initializing a CPArrayController with a value that is not an array setContent: would make it an array by replacing value with [value]. This is consistent with how Cocoa does it, but it should first check to make sure that the content is not nil. If it is, the sensible thing to do (and what Cocoa does) is to replace it with an empty array.

This commit also includes a missing import to make CPArrayControllerTest run without error.
2010-11-03 01:24:38 -07:00
Ross Boucher 74bedf6dcd Add a missing import to the ArrayController test. 2010-10-13 18:39:46 -07:00
Klaas Pieter Annema c9e0ab654f test observations during setSelectionIndexes 2010-09-23 10:59:00 +02:00
Alexander Ljungberg e704d42adb Fixed: if CPArrayController setPreserveSelection was off and a selected item disappeared, an invalid selection state could occur. The error was caused by a slightly overeager early-out optimisation in __setSelectionIndexes. 2010-09-04 22:12:08 -04:00
Alexander Ljungberg febdf4092e New implementation of change notifications from CPArrayController.
It is crucial that we send notification only before and after complete changes. In the middle notifications might cause observers to see or react to inconsistent data (e.g. selection indexes pointing to rows no longer present). Added some unit tests - more might be needed in the future. Fixed: before and after values when observing array controller key paths during content changes or rearranges were wrong. Fixed: the array controller sent out multiple redundant change notifications.
2010-08-23 18:53:29 -04:00
Alexander Ljungberg bcb22c7e46 Remove debug output from CPArrayControllerTest. 2010-08-13 14:28:25 -04:00
Alexander Ljungberg 0683b46239 Since issue #795 has not been decided on yet, make CPArrayControllerTest pass without those changes at this time. 2010-08-13 14:18:25 -04:00
Alexander Ljungberg 61ccc39f81 Merge remote branch 'klaaspieter/fix/794-cparraycontroller-preserveselection'
Conflicts:
	Tests/AppKit/CPArrayControllerTest.j
2010-08-13 14:06:35 -04:00
Klaas Pieter Annema ff98a9be5a fix preserve selection in removeObjects and added unit test 2010-07-28 15:02:48 +02:00
Klaas Pieter Annema 75ceeffab8 remove commented code from CPArrayControllerTest 2010-07-28 13:28:53 +02:00
Klaas Pieter Annema 48a5d55af7 fix CPArrayController selectPrevious: and selectNext:
Also added unit-tests for canSelectPrevious, canSelectNext, selectPrevious: and selectNext:
2010-07-27 09:10:41 +02:00
Klaas Pieter Annema bb3c08ce0b add CPArrayController test 2010-07-26 14:04:26 +02:00