Skip to content

Commit 3295001

Browse files
committed
Fixed jenswilly#5: opening zip requires app to be active:
- the zip file was attempted unzipped both from application:didFinishLaunchingWithOptions: _and_ from handleOpenURL:
1 parent 7e7b57c commit 3295001

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

EAGLEView/AppDelegate.m

+7-6
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4242
[DBSession setSharedSession:dbSession];
4343

4444
// Are we opened in response to a "Open in…"?
45-
NSURL *url = launchOptions[ UIApplicationLaunchOptionsURLKey ];
46-
if( [url isFileURL] )
47-
// Yes: open the file
48-
[self openFileURL:url];
45+
// NOTE: next part has been removed (issue #5) since handleOpenURL: was called too. Regardless of whether the app was active or not. (Maybe this is an iOS 8 thing?)
46+
// NSURL *url = launchOptions[ UIApplicationLaunchOptionsURLKey ];
47+
// if( [url isFileURL] )
48+
// // Yes: open the file
49+
// [self openFileURL:url];
4950

5051
#ifdef FABRIC_API_KEY
5152
[Fabric with:@[CrashlyticsKit]];
@@ -61,7 +62,7 @@ - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
6162
{
6263
// Is it a file URL?
6364
if( [url isFileURL] )
64-
// Yes: open schematic file
65+
// Yes: open file
6566
[self openFileURL:url];
6667
else if( [[DBSession sharedSession] handleOpenURL:url] )
6768
{
@@ -93,7 +94,7 @@ - (void)openFileURL:(NSURL*)fileURL
9394
// It is a zip file: extract and see if we can find a .sch file in the archive
9495
NSString *sourceFilePath = [fileURL path];
9596
_unzipDirectoryPath = [NSTemporaryDirectory() stringByAppendingString:@"unzip"];
96-
DEBUG_LOG( @"Unzipping to %@", _unzipDirectoryPath );
97+
NSLog( @"Unzipping to %@", _unzipDirectoryPath );
9798
BOOL success = [SSZipArchive unzipFileAtPath:sourceFilePath toDestination:_unzipDirectoryPath];
9899
if( !success )
99100
{

0 commit comments

Comments
 (0)