fix my xpath to make it work with ruby 1.8.3
[booh] / bin / booh
index 44f34a557badc84369f95926317dfb3c5850a398..299d5be06950fa2cc179893e66a1b2d41e869fe4 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -753,7 +753,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
     }
 
     rotate_and_cleanup = Proc.new { |angle|
-        rotate(angle, thumbnail_img, img, $xmldir.elements["[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y])
+        rotate(angle, thumbnail_img, img, $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y])
         cleanup_all_thumbnails.call
     }
 
@@ -784,7 +784,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     color_swap_and_cleanup = Proc.new {
         perform_color_swap_and_cleanup = Proc.new {
-            color_swap($xmldir.elements["[@filename='#{filename}']"], '')
+            color_swap($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }
 
@@ -808,7 +808,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     change_frame_offset_and_cleanup_real = Proc.new { |values|
         perform_change_frame_offset_and_cleanup = Proc.new { |val|
-            change_frame_offset($xmldir.elements["[@filename='#{filename}']"], '', val)
+            change_frame_offset($xmldir.elements["*[@filename='#{filename}']"], '', val)
             my_gen_real_thumbnail.call
         }
         perform_change_frame_offset_and_cleanup.call(values[:new])
@@ -829,18 +829,18 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
     }
 
     change_frame_offset_and_cleanup = Proc.new {
-        if values = ask_new_frame_offset($xmldir.elements["[@filename='#{filename}']"], '')
+        if values = ask_new_frame_offset($xmldir.elements["*[@filename='#{filename}']"], '')
             change_frame_offset_and_cleanup_real.call(values)
         end
     }
 
     whitebalance_and_cleanup = Proc.new {
         if values = ask_whitebalance(from_utf8("#{$current_path}/#{filename}"), thumbnail_img, img,
-                                     $xmldir.elements["[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
+                                     $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
             perform_change_whitebalance_and_cleanup = Proc.new { |val|
-                change_whitebalance($xmldir.elements["[@filename='#{filename}']"], '', val)
+                change_whitebalance($xmldir.elements["*[@filename='#{filename}']"], '', val)
                 recalc_whitebalance(val, from_utf8("#{$current_path}/#{filename}"), thumbnail_img, img,
-                                    $xmldir.elements["[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
+                                    $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
                 cleanup_all_thumbnails.call
             }
             perform_change_whitebalance_and_cleanup.call(values[:new])
@@ -863,7 +863,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     enhance_and_cleanup = Proc.new {
         perform_enhance_and_cleanup = Proc.new {
-            enhance($xmldir.elements["[@filename='#{filename}']"], '')
+            enhance($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }
 
@@ -1083,7 +1083,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
             if !$ignore_next_release
                 x, y = autotable.get_current_pos(vbox)
                 next_ = autotable.get_next_widget(vbox)
-                popup_thumbnail_menu(event, ['delete'], type, $xmldir.elements["[@filename='#{filename}']"], '',
+                popup_thumbnail_menu(event, ['delete'], type, $xmldir.elements["*[@filename='#{filename}']"], '',
                                      { :can_left => x > 0, :can_right => next_ && autotable.get_current_pos(next_)[0] > x,
                                        :can_up => y > 0, :can_down => y < autotable.get_max_y, :can_multiple => true },
                                      { :rotate => rotate_and_cleanup, :move => move, :color_swap => color_swap_and_cleanup, :enhance => enhance_and_cleanup,