From e5c2daa05a9e6fa739816ff26281f7e2f48f602e Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Tue, 14 Aug 2012 16:53:15 +0200 Subject: [PATCH] Revert "Use current document when no URL given in txmt URL" Pending improved implementation which also handle the case where frontmost document is untitled. This reverts commit 2beac7080b810ad9442b4e182e63f7eab6fcbedb. --- .../TextMate/src/AppController Documents.mm | 14 -------------- Frameworks/DocumentWindow/src/DocumentController.h | 1 - .../DocumentWindow/src/DocumentController.mm | 5 ----- 3 files changed, 20 deletions(-) diff --git a/Applications/TextMate/src/AppController Documents.mm b/Applications/TextMate/src/AppController Documents.mm index 1b208350..72e60776 100644 --- a/Applications/TextMate/src/AppController Documents.mm +++ b/Applications/TextMate/src/AppController Documents.mm @@ -83,7 +83,6 @@ static NSString* const OakGlobalSessionInfo = @"OakGlobalSessionInfo"; { std::map parameters; - BOOL hadURL = NO; NSArray* components = [[aURL query] componentsSeparatedByString:@"&"]; for(NSString* part in components) { @@ -93,19 +92,6 @@ static NSString* const OakGlobalSessionInfo = @"OakGlobalSessionInfo"; std::string key = to_s([[keyValue firstObject] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]); NSURL* fileURL = key == "url" ? [NSURL URLWithString:[keyValue lastObject]] : nil; parameters[key] = to_s([fileURL isFileURL] ? [fileURL path] : [[keyValue lastObject] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]); - hadURL |= (key == "url"); - } - } - - if(!hadURL && [[NSApp orderedWindows]count] > 0) - { - NSWindow* window=[[NSApp orderedWindows]objectAtIndex:0]; - DocumentController* controller = (DocumentController*)[window delegate]; - if([controller isKindOfClass:[DocumentController class]] && !controller->documentTabs.empty()) - { - NSString* path=[controller documentFilePath]; - - if(path && [path length] > 0) parameters["url"] = to_s(path); } } diff --git a/Frameworks/DocumentWindow/src/DocumentController.h b/Frameworks/DocumentWindow/src/DocumentController.h index 72392624..05fdfc15 100644 --- a/Frameworks/DocumentWindow/src/DocumentController.h +++ b/Frameworks/DocumentWindow/src/DocumentController.h @@ -71,7 +71,6 @@ namespace bundles { struct item_t; typedef std::tr1::shared_ptr item_ptr @property (nonatomic, readonly) NSString* identifier; @property (nonatomic, assign) BOOL fileBrowserHidden; @property (nonatomic, readonly) NSString* documentPath; -@property (nonatomic, readonly) NSString* documentFilePath; @property (nonatomic, readonly) NSString* fileBrowserPath; @property (nonatomic, readonly) NSString* projectPath; @property (nonatomic, readonly) NSString* untitledSavePath; diff --git a/Frameworks/DocumentWindow/src/DocumentController.mm b/Frameworks/DocumentWindow/src/DocumentController.mm index 5c05caa8..b2365465 100644 --- a/Frameworks/DocumentWindow/src/DocumentController.mm +++ b/Frameworks/DocumentWindow/src/DocumentController.mm @@ -1199,11 +1199,6 @@ static std::string parent_or_home (std::string const& path) return [NSString stringWithCxxString:documentTabs.empty() ? NULL_STR : parent_or_home([self selectedDocument]->path())]; } -- (NSString*)documentFilePath -{ - return [NSString stringWithCxxString:documentTabs.empty() ? NULL_STR : [self selectedDocument]->path()]; -} - - (NSString*)projectPath { settings_t const& settings = documentTabs.empty() || [self selectedDocument]->path() == NULL_STR ? settings_for_path(NULL_STR, "", to_s(self.fileBrowserPath)) : [self selectedDocument]->settings();