Rename property (location → path)

This commit is contained in:
Allan Odgaard
2013-01-12 03:08:25 +01:00
parent c323486250
commit 10ef2f1034
3 changed files with 10 additions and 9 deletions

View File

@@ -881,7 +881,7 @@ namespace
}
}
if(NSString* projectPath = self.defaultProjectPath ?: self.fileBrowser.location ?: [NSString stringWithCxxString:path::parent(doc->path())])
if(NSString* projectPath = self.defaultProjectPath ?: self.fileBrowser.path ?: [NSString stringWithCxxString:path::parent(doc->path())])
map["projectDirectory"] = to_s(projectPath);
settings_t const settings = settings_for_path(doc->virtual_path(), doc->file_type() + " " + to_s(self.scopeAttributes), docDirectory, doc->variables(map, false));
@@ -1411,7 +1411,7 @@ static std::string file_chooser_glob (std::string const& path)
{
self.filterWindowController = [OakFilterWindowController new];
OakFileChooser* dataSource = [OakFileChooser fileChooserWithPath:(self.fileBrowser.location ?: [NSString stringWithCxxString:[self selectedDocument]->path()] ?: self.projectPath ?: NSHomeDirectory()) projectPath:self.projectPath ?: NSHomeDirectory()];
OakFileChooser* dataSource = [OakFileChooser fileChooserWithPath:(self.fileBrowser.path ?: [NSString stringWithCxxString:[self selectedDocument]->path()] ?: self.projectPath ?: NSHomeDirectory()) projectPath:self.projectPath ?: NSHomeDirectory()];
dataSource.excludeDocumentWithIdentifier = [NSString stringWithCxxString:[self selectedDocument]->identifier()];
dataSource.sourceIndex = self.fileChooserSourceIndex;
dataSource.globString = [NSString stringWithCxxString:file_chooser_glob(to_s(dataSource.path))];
@@ -1461,7 +1461,7 @@ static std::string file_chooser_glob (std::string const& path)
NSArray* selectedURLs = self.fileBrowser.selectedURLs;
if([selectedURLs count] == 1 && [[selectedURLs lastObject] isFileURL] && path::is_directory([[[selectedURLs lastObject] path] fileSystemRepresentation]))
res = [[selectedURLs lastObject] path];
else if(NSString* folder = self.fileBrowser.location)
else if(NSString* folder = self.fileBrowser.path)
res = folder;
}
return res;

View File

@@ -10,7 +10,7 @@
PUBLIC @interface OakFileBrowser : NSResponder
@property (nonatomic, weak) id <OakFileBrowserDelegate> delegate;
@property (nonatomic, readonly) NSView* view;
@property (nonatomic, readonly) NSString* location;
@property (nonatomic, readonly) NSString* path;
@property (nonatomic, readonly) NSArray* selectedURLs;
@property (nonatomic) NSArray* openURLs;
@property (nonatomic) NSArray* modifiedURLs;

View File

@@ -78,7 +78,8 @@ static NSMutableSet* SymmetricDifference (NSMutableSet* aSet, NSMutableSet* anot
@implementation OakFileBrowser
- (BOOL)acceptsFirstResponder { return NO; }
- (NSString*)location
- (NSString*)path
{
NSURL* tmp = [[_url scheme] isEqualToString:@"scm"] ? ParentForURL(_url) : _url;
return [tmp isFileURL] ? [tmp path] : nil;
@@ -170,7 +171,7 @@ static NSMutableSet* SymmetricDifference (NSMutableSet* aSet, NSMutableSet* anot
- (void)setOpenURLs:(NSArray*)newOpenURLs
{
if(!settings_for_path(NULL_STR, "", to_s(self.location)).get(kSettingsFileBrowserDocumentStatusKey, true))
if(!settings_for_path(NULL_STR, "", to_s(self.path)).get(kSettingsFileBrowserDocumentStatusKey, true))
return;
if([_outlineViewDelegate.openURLs isEqualToArray:newOpenURLs])
@@ -197,7 +198,7 @@ static NSMutableSet* SymmetricDifference (NSMutableSet* aSet, NSMutableSet* anot
- (void)setModifiedURLs:(NSArray*)newModifiedURLs
{
if(!settings_for_path(NULL_STR, "", to_s(self.location)).get(kSettingsFileBrowserDocumentStatusKey, true))
if(!settings_for_path(NULL_STR, "", to_s(self.path)).get(kSettingsFileBrowserDocumentStatusKey, true))
return;
if([_outlineViewDelegate.modifiedURLs isEqualToArray:newModifiedURLs])
@@ -549,7 +550,7 @@ static NSMutableSet* SymmetricDifference (NSMutableSet* aSet, NSMutableSet* anot
env["TM_SELECTED_FILES"] = text::join(quoted, " ");
}
if(NSString* dir = self.location)
if(NSString* dir = self.path)
env["PWD"] = [dir fileSystemRepresentation];
}
@@ -940,7 +941,7 @@ static struct data_source_options_map_t { NSString* const name; NSUInteger flag;
[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel setAllowsMultipleSelection:NO];
[panel setDirectoryURL:[NSURL fileURLWithPath:self.location]];
[panel setDirectoryURL:[NSURL fileURLWithPath:self.path]];
[panel beginSheetModalForWindow:_view.window completionHandler:^(NSInteger result) {
if(result == NSOKButton)
[self showURL:[[panel URLs] lastObject]];