diff --git a/installer/osx/Controller.mm b/installer/osx/Controller.mm index 3c27cdf3c..1950473ea 100644 --- a/installer/osx/Controller.mm +++ b/installer/osx/Controller.mm @@ -100,8 +100,8 @@ -(void)dealloc if (temporaryDirectory) { - [[NSFileManager defaultManager] - removeFileAtPath:temporaryDirectory handler:nil]; + [[NSFileManager defaultManager] + removeItemAtPath:temporaryDirectory error:nil]; [temporaryDirectory release]; } @@ -662,7 +662,7 @@ -(void)applicationDidFinishLaunching:(NSNotification *) notif // Remove the update file as soon as possible, so that if the installation // fails the application will still start. We can always fetch the update // later. - [[NSFileManager defaultManager] removeFileAtPath:updateFile handler:nil]; + [[NSFileManager defaultManager] removeItemAtPath:updateFile error:nil]; } std::string tempDir = FileUtils::GetTempDirectory(); diff --git a/kroll b/kroll index 72112e8a7..963951975 160000 --- a/kroll +++ b/kroll @@ -1 +1 @@ -Subproject commit 72112e8a709ef70d940f2eb64f8c01065c431021 +Subproject commit 96395197504910513a0061f44dc65b7ad1a61602 diff --git a/modules/ti.Filesystem/File.cpp b/modules/ti.Filesystem/File.cpp index 16c3844e0..078774efd 100644 --- a/modules/ti.Filesystem/File.cpp +++ b/modules/ti.Filesystem/File.cpp @@ -598,7 +598,7 @@ void File::GetSpaceAvailable(const ValueList& args, KValueRef result) #ifdef OS_OSX NSString *p = [NSString stringWithCString:this->filename.c_str() encoding:NSUTF8StringEncoding]; - unsigned long avail = [[[[NSFileManager defaultManager] fileSystemAttributesAtPath:p] objectForKey:NSFileSystemFreeSize] longValue]; + unsigned long avail = [[[[NSFileManager defaultManager] attributesOfFileSystemForPath:p error:nil] objectForKey:NSFileSystemFreeSize] longValue]; diskSize = (double)avail; #elif defined(OS_WIN32) unsigned __int64 i64FreeBytesToCaller; diff --git a/modules/ti.UI/SConscript b/modules/ti.UI/SConscript index 3854d23f2..759fec190 100644 --- a/modules/ti.UI/SConscript +++ b/modules/ti.UI/SConscript @@ -9,6 +9,13 @@ build.add_thirdparty(env, 'poco') build.add_thirdparty(env, 'webkit') env.Append(LIBS=['tiappmodule']) +# If we are on Mac use the system installed WebKit. +# Otherwise use our build of WebKit on all other platforms. +if build.is_osx(): + env.Append(FRAMEWORKS=['WebKit', 'JavaScriptCore']) +else: + build.add_thirdparty(env, 'webkit') + sources = Glob('*.cpp') + ['url/URLUtils.cpp'] if build.is_linux(): sources = sources + Glob('gtk/*.cpp') diff --git a/modules/ti.UI/ScriptEvaluator.cpp b/modules/ti.UI/ScriptEvaluator.cpp deleted file mode 100644 index c9707ad22..000000000 --- a/modules/ti.UI/ScriptEvaluator.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2009-2010 Appcelerator, Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ScriptEvaluator.h" - -#include -#include - -#include - -namespace Titanium { - -/*static*/ -void ScriptEvaluator::Initialize() -{ - static AutoPtr instance(new ScriptEvaluator()); -#if defined(OS_OSX) - [WebScriptElement addScriptEvaluator:[[OSXScriptEvaluator alloc] - initWithEvaluator:instance.get()]]; -#elif defined(OS_WIN32) - addScriptEvaluator(instance.get()); -#elif defined(OS_LINUX) - webkit_titanium_add_script_evaluator(instance.get()); -#endif -} - -} // namespace Titanium - -#if defined(OS_OSX) -@implementation OSXScriptEvaluator --(OSXScriptEvaluator*) initWithEvaluator:(Titanium::ScriptEvaluator*)evaluator -{ - self = [self init]; - delegate = evaluator; - return self; -} - --(BOOL) matchesMimeType:(NSString*)mimeType -{ - return kroll::Script::GetInstance()->CanEvaluate([mimeType UTF8String]); -} - --(void) evaluate:(NSString *)mimeType sourceCode:(NSString*)sourceCode context:(void *)context -{ - // TODO get source name from webkit - try - { - Script::GetInstance()->Evaluate([mimeType UTF8String], "