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:
Allan Odgaard
2013-02-15 15:27:54 +01:00
parent deffe08d1b
commit a4dc3bf977
3 changed files with 4 additions and 4 deletions

View File

@@ -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;

View File

@@ -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 }];
}
// ===================

View File

@@ -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);