* MIME.subproj/IFDownloadHandler.h:
* MIME.subproj/IFDownloadHandler.mm:
* WebView.subproj/IFWebFrame.mm:
(-[IFWebFrame setProvisionalDataSource:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@1238
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2002-05-30 Chris Blumenberg <cblu@apple.com>
+
+ Use NSWorkspace methods instead of Launch Services and Finder functions.
+
+ * MIME.subproj/IFDownloadHandler.h:
+ * MIME.subproj/IFDownloadHandler.mm:
+ * WebView.subproj/IFWebFrame.mm:
+ (-[IFWebFrame setProvisionalDataSource:]):
+
=======
2002-05-30 Richard Williamson <rjw@apple.com>
+2002-05-30 Chris Blumenberg <cblu@apple.com>
+
+ Use NSWorkspace methods instead of Launch Services and Finder functions.
+
+ * MIME.subproj/IFDownloadHandler.h:
+ * MIME.subproj/IFDownloadHandler.mm:
+ * WebView.subproj/IFWebFrame.mm:
+ (-[IFWebFrame setProvisionalDataSource:]):
+
=======
2002-05-30 Richard Williamson <rjw@apple.com>
- initWithDataSource:(IFWebDataSource *)dSource;
- (void)downloadCompletedWithData:(NSData *)data;
-+ (void) launchURL:(NSURL *) url;
@end
{
NSString *path = [dataSource _downloadPath];
NSFileManager *fileManager;
-
+ NSWorkspace *workspace;
+
// FIXME: Should probably not replace existing file
// FIXME: Should report error if there is one
fileManager = [NSFileManager defaultManager];
// Send Finder notification
WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD, "Notifying Finder");
- FNNotifyByPath((UInt8 *)[[path stringByDeletingLastPathComponent] UTF8String], kFNDirectoryModifiedMessage, kNilOptions);
+ workspace = [NSWorkspace sharedWorkspace];
+ [workspace noteFileSystemChanged:path];
if([dataSource contentPolicy] == IFContentPolicyOpenExternally){
- [[self class] launchURL:[NSURL fileURLWithPath:path]];
+ [workspace openFile:path];
}
}
-+ (void) launchURL:(NSURL *) url{
- WEBKITDEBUGLEVEL(WEBKIT_LOG_DOWNLOAD,"Launching: %s", [[url absoluteString] cString]);
- LSOpenCFURLRef((CFURLRef)url, NULL);
-}
@end
}
else if(urlPolicy == IFURLPolicyOpenExternally){
- [IFDownloadHandler launchURL:[newDataSource inputURL]];
+ return [[NSWorkspace sharedWorkspace] openURL:[newDataSource inputURL]];
}
// Do nothing in the IFURLPolicyIgnore case.
-
- //FIXME: When do we return NO?
+
return YES;
}
}
else if(urlPolicy == IFURLPolicyOpenExternally){
- [IFDownloadHandler launchURL:[newDataSource inputURL]];
+ return [[NSWorkspace sharedWorkspace] openURL:[newDataSource inputURL]];
}
// Do nothing in the IFURLPolicyIgnore case.
-
- //FIXME: When do we return NO?
+
return YES;
}