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 2beac7080b.
This commit is contained in:
Allan Odgaard
2012-08-14 16:53:15 +02:00
parent 5aaebb9e25
commit e5c2daa05a
3 changed files with 0 additions and 20 deletions

View File

@@ -83,7 +83,6 @@ static NSString* const OakGlobalSessionInfo = @"OakGlobalSessionInfo";
{
std::map<std::string, std::string> 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);
}
}