[aseprite] 176/196: Override application:openFiles: instead of application:openFile:

Tobias Hansen thansen at moszumanska.debian.org
Wed Apr 20 18:50:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 5ef931b7d4ca42b62329c8ce99e081e82641616a
Author: David Capello <davidcapello at gmail.com>
Date:   Mon Apr 11 17:27:34 2016 -0300

    Override application:openFiles: instead of application:openFile:
---
 src/she/osx/app_delegate.h  | 2 +-
 src/she/osx/app_delegate.mm | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/she/osx/app_delegate.h b/src/she/osx/app_delegate.h
index 29d3b38..fc24cb9 100644
--- a/src/she/osx/app_delegate.h
+++ b/src/she/osx/app_delegate.h
@@ -14,7 +14,7 @@
 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)sender;
 - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)app;
 - (void)applicationWillTerminate:(NSNotification*)notification;
-- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename;
+- (BOOL)application:(NSApplication*)app openFiles:(NSArray*)filenames;
 @end
 
 #endif
diff --git a/src/she/osx/app_delegate.mm b/src/she/osx/app_delegate.mm
index 426be8c..76460d3 100644
--- a/src/she/osx/app_delegate.mm
+++ b/src/she/osx/app_delegate.mm
@@ -36,15 +36,20 @@
   she::queue_event(ev);
 }
 
-- (BOOL)application:(NSApplication*)app openFile:(NSString*)filename
+- (BOOL)application:(NSApplication*)app openFiles:(NSArray*)filenames
 {
   std::vector<std::string> files;
-  files.push_back([filename UTF8String]);
+  for (int i=0; i<[filenames count]; ++i) {
+    NSString* fn = [filenames objectAtIndex: i];
+    files.push_back([fn UTF8String]);
+  }
 
   she::Event ev;
   ev.setType(she::Event::DropFiles);
   ev.setFiles(files);
   she::queue_event(ev);
+
+  [app replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
   return YES;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list