config may be a local thing..
authorGuillaume Cottenceau <gcottenc@gmail.com>
Sun, 14 Dec 2008 23:41:08 +0000 (00:41 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Sun, 14 Dec 2008 23:41:08 +0000 (00:41 +0100)
bin/booh

index 040dd593705176c189950819318504f32220fa9d..980c456921168ed2b4cd3385cd5eb60abc176d9b 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -98,8 +98,8 @@ def read_config
     $config = {}
     $config_file = File.expand_path('~/.booh-gui-rc')
     if File.readable?($config_file)
-        $xmldoc = Synchronizator.new(REXML::Document.new(File.new($config_file)), $xmlaccesslock)
-        $xmldoc.root.elements.each { |element|
+        xmldoc = REXML::Document.new(File.new($config_file))
+        xmldoc.root.elements.each { |element|
             txt = element.get_text
             if txt
                 if txt.value =~ /~~~/ || element.name == 'last-opens'
@@ -188,10 +188,10 @@ def write_config
         $config['last-opens'] = $config['last-opens'][-10, 10]
     end
 
-    $xmldoc = Synchronizator.new(Document.new("<booh-gui-rc version='#{$VERSION}'/>"), $xmlaccesslock)
-    $xmldoc << XMLDecl.new(XMLDecl::DEFAULT_VERSION, $CURRENT_CHARSET)
+    xmldoc = Document.new("<booh-gui-rc version='#{$VERSION}'/>")
+    xmldoc << XMLDecl.new(XMLDecl::DEFAULT_VERSION, $CURRENT_CHARSET)
     $config.each_pair { |key, value|
-        elem = $xmldoc.root.add_element key
+        elem = xmldoc.root.add_element key
         if value.is_a? Hash
             $config[key].each_pair { |subkey, subvalue|
                 subelem = elem.add_element subkey
@@ -208,7 +208,7 @@ def write_config
         end
     }
     ios = File.open($config_file, "w")
-    $xmldoc.write(ios, 0)
+    xmldoc.write(ios, 0)
     ios.close
 
     $tempfiles.each { |f|