=begin AUTHOR: Kesiev WHAT IT DOES: Add filesystem destinations, which are indexed on-access. Destinations can be added by user, creating a label and a filesystem attribute. List can be refreshed manually, pushing the refresh button. lists.label="My filesystem folder" lists.filesystem="/home/user/mymusic/" =end def filesystem_generate(section) open(section[:file],"w") { |f| (Dir.new(section[:filesystem]).select{ |file| !File.directory?(section[:filesystem]+"/"+file) }).each { |file| f.puts([File.extname(file).upcase[1..-1],"","",file,"",section[:filesystem]+"/"+file].join($opt[:separator])) } } end alias filesystem_generateimplicits generateimplicits def generateimplicits filesystem_generateimplicits $lists.length.times { |i| if $lists[i][:filesystem] then $lists[i][:icon]="stock_folder" $lists[i][:file]="#{$opt[:root]}/filesystem_"+Digest::MD5.hexdigest($lists[i][:filesystem]) $lists[i][:onclick]=Proc.new { |s| filesystem_generate(s) if !File.exist?(s[:file]); :update} $lists[i][:onrefresh]=Proc.new { |s| filesystem_generate(s) } end } end