Revision: 27766
http://sourceforge.net/p/bibdesk/svn/27766
Author: hofman
Date: 2022-07-24 21:39:22 +0000 (Sun, 24 Jul 2022)
Log Message:
-----------
revert part of previous commit, don't allow setting icon URLs. Make setter
private, as it makes no sense, as it will always be inconsistent with the
binding or datasource (or lack of it).
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2022-07-24
19:43:02 UTC (rev 27765)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.h 2022-07-24
21:39:22 UTC (rev 27766)
@@ -272,13 +272,6 @@
This property is KVO-compliant and supports Cocoa bindings.*/
- (NSArray *)iconURLs;
-/** Set the icon URLs.
-
- This property is KVO-compliant and supports Cocoa bindings.
-
- @param anArray Must not be nil. Pass an empty NSArray to clear selection.*/
-- (void)setIconURLs:(NSArray *)anArray;
-
/** Currently selected indexes.
This property is KVO-compliant and supports Cocoa bindings. Indexes are
numbered in ascending order order from left to right, top to bottom (row-major
order).*/
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2022-07-24
19:43:02 UTC (rev 27765)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2022-07-24
21:39:22 UTC (rev 27766)
@@ -213,6 +213,8 @@
- (NSURL *)URLAtIndex:(NSUInteger)anIndex;
- (NSUInteger)numberOfIcons;
+- (void)setIconURLs:(NSArray *)anArray;
+
// only declare methods here to shut the compiler up if we can't rearrange
- (FVIcon *)iconAtIndex:(NSUInteger)anIndex;
- (FVIcon *)_cachedIconForURL:(NSURL *)aURL;
@@ -835,9 +837,7 @@
if (_orderedURLs != array) {
[_orderedURLs release];
_orderedURLs = [[NSMutableArray alloc] initWithArray:array];
- if (nil == _contentBinding && nil == _dataSource)
- [self reloadIcons];
- }
+ }
}
- (NSArray *)iconURLs
@@ -1817,9 +1817,9 @@
- (void)_reloadIcons;
{
- BOOL hasDataSource = nil == _contentBinding && nil != _dataSource;
+ BOOL isBound = nil != _contentBinding;
- if (hasDataSource) {
+ if (NO == isBound) {
[self willChangeValueForKey:@"iconURLs"];
if (nil == _orderedURLs)
_orderedURLs = [[NSMutableArray alloc] init];
@@ -1857,16 +1857,16 @@
id (*subtitleAtIndex)(id, SEL, id, NSUInteger);
subtitleAtIndex = (id (*)(id, SEL, id, NSUInteger))[(id)_dataSource
methodForSelector:subtitleSel];
- NSUInteger i, iMax = hasDataSource ? [_dataSource
numberOfURLsInFileView:self] : [_orderedURLs count];
+ NSUInteger i, iMax = isBound ? [_orderedURLs count] : [_dataSource
numberOfURLsInFileView:self];
for (i = 0; i < iMax; i++) {
- NSURL *aURL = hasDataSource ? URLAtIndex(_dataSource, URLSel, self, i)
: objectAtIndex(_orderedURLs, objectSel, i);
+ NSURL *aURL = isBound ? objectAtIndex(_orderedURLs, objectSel, i) :
URLAtIndex(_dataSource, URLSel, self, i);
if (__builtin_expect(nil == aURL || [NSNull null] == (id)aURL, 0))
aURL = [FVIcon missingFileURL];
NSParameterAssert(nil != aURL && [NSNull null] != (id)aURL);
FVIcon *icon = cachedIcon(self, cachedIconSel, aURL);
NSParameterAssert(nil != icon);
- if (hasDataSource)
+ if (NO == isBound)
insertObjectAtIndex(_orderedURLs, insertSel, aURL, i);
insertObjectAtIndex(_orderedIcons, insertSel, icon, i);
if (_orderedSubtitles)
@@ -1873,7 +1873,7 @@
insertObjectAtIndex(_orderedSubtitles, insertSel,
subtitleAtIndex(_dataSource, subtitleSel, self, i), i);
}
- if (hasDataSource)
+ if (NO == isBound)
[self didChangeValueForKey:@"iconURLs"];
NSUInteger accessibilityCount = [_accessibilityIcons count];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit