about summary refs log tree commit diff stats
path: root/code/runcontext.rb
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-07-06 17:51:46 +0200
committerhut <hut@lavabit.com>2009-07-06 17:51:46 +0200
commit3e69b03dc185e85e9c02cc360bc9cde7929be67d (patch)
treebccf574e97c83f11f61a34ff396fe9f11efb7e39 /code/runcontext.rb
parentf037fa4ba89527eff741b3889b70ecb84b0b83f0 (diff)
downloadranger-3e69b03dc185e85e9c02cc360bc9cde7929be67d.tar.gz
allow to set a preferred application at runcontexts
Diffstat (limited to 'code/runcontext.rb')
-rw-r--r--code/runcontext.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/code/runcontext.rb b/code/runcontext.rb
index d3a0b9d1..df9f3a81 100644
--- a/code/runcontext.rb
+++ b/code/runcontext.rb
@@ -33,21 +33,21 @@ class RunContext
 	end
 	## }}}
 
-	def initialize(files, mode=0, flags='')
+	def initialize(files, mode=nil, flags=nil, preferred_app=nil)
 		@mode = mode.to_i
 		if files.is_a? Array
 			@files = files.dup
 		else
 			@files = [files.dup]
 		end
-		self.flags = flags
+		self.flags = flags || ''
 		
 		@files.reject! {|file|
 			file.handler == nil or !file.exists?
 		}
 		@handlers = @files.map {|file| file.handler}
 		@paths = @files.map {|file| file.path}
-		@handler = @handlers.first
+		@handler = preferred_app || @handlers.first
 
 		@multi = (@files.size > 1 and @handlers.uniq.size == 1)