diff options
author | hut <hut@lavabit.com> | 2009-07-06 17:51:46 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-07-06 17:51:46 +0200 |
commit | 3e69b03dc185e85e9c02cc360bc9cde7929be67d (patch) | |
tree | bccf574e97c83f11f61a34ff396fe9f11efb7e39 /code | |
parent | f037fa4ba89527eff741b3889b70ecb84b0b83f0 (diff) | |
download | ranger-3e69b03dc185e85e9c02cc360bc9cde7929be67d.tar.gz |
allow to set a preferred application at runcontexts
Diffstat (limited to 'code')
-rw-r--r-- | code/runcontext.rb | 6 |
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) |