mirror of
https://github.com/textmate/textmate.git
synced 2026-01-20 20:27:59 -05:00
OakFileManagerDirectoryKey → OakFileManagerPathKey
This allows us to use the same key for more than just directories. The notification name itself should indicate if the ‘path’ refers only to directories or files.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#import <oak/misc.h>
|
||||
|
||||
PUBLIC extern NSString* const OakFileManagerDidChangeContentsOfDirectory;
|
||||
PUBLIC extern NSString* const OakFileManagerDirectoryKey;
|
||||
PUBLIC extern NSString* const OakFileManagerPathKey;
|
||||
|
||||
PUBLIC @interface OakFileManager : NSObject
|
||||
+ (OakFileManager*)sharedInstance;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#import <io/path.h>
|
||||
|
||||
NSString* const OakFileManagerDidChangeContentsOfDirectory = @"OakFileManagerDidChangeContentsOfDirectory";
|
||||
NSString* const OakFileManagerDirectoryKey = @"directory";
|
||||
NSString* const OakFileManagerPathKey = @"directory";
|
||||
|
||||
@interface OakFileManager ()
|
||||
@property (nonatomic) BOOL hasUISoundToPlay;
|
||||
@@ -35,7 +35,7 @@ NSString* const OakFileManagerDirectoryKey = @"directory";
|
||||
|
||||
- (void)postDidChangeContentsOfDirectory:(NSString*)aDirectory
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:OakFileManagerDidChangeContentsOfDirectory object:self userInfo:@{ OakFileManagerDirectoryKey : aDirectory }];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:OakFileManagerDidChangeContentsOfDirectory object:self userInfo:@{ OakFileManagerPathKey : aDirectory }];
|
||||
}
|
||||
|
||||
// ===================
|
||||
|
||||
@@ -343,7 +343,7 @@ private:
|
||||
- (void)fileManagerDidChangeContentsOfDirectory:(NSNotification*)aNotification
|
||||
{
|
||||
NSDictionary* userInfo = [aNotification userInfo];
|
||||
NSString* dir = userInfo[OakFileManagerDirectoryKey];
|
||||
NSString* dir = userInfo[OakFileManagerPathKey];
|
||||
auto it = visibleItems.find(to_s(dir));
|
||||
if(it != visibleItems.end())
|
||||
it->second->reload(false);
|
||||
|
||||
Reference in New Issue
Block a user