$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'
$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
end
}
ios = File.open($config_file, "w")
- $xmldoc.write(ios, 0)
+ xmldoc.write(ios, 0)
ios.close
$tempfiles.each { |f|