Skip to content

Instantly share code, notes, and snippets.

@osak

osak/queue.patch

Created Jun 7, 2011
Embed
What would you like to do?
Index: core/addon/proxy/proxy.rb
===================================================================
--- core/addon/proxy/proxy.rb (リビジョン 398)
+++ core/addon/proxy/proxy.rb (作業コピー)
@@ -75,15 +75,16 @@
def self.gen_record(name, radio)
radio.signal_connect('toggled'){ |widget|
- UserConfig[:proxy_enabled] = name }
+ UserConfig[:proxy_enabled] = name if widget.active? }
radio
end
def self.gen_group(name, radio)
eventbox = __send__("gen_#{name}_ev")
radio.signal_connect('toggled'){ |widget|
- UserConfig[:proxy_enabled] = name
- eventbox.sensitive = widget.active? }
+ UserConfig[:proxy_enabled] = name if widget.active?
+ eventbox.sensitive = widget.active? }
+
eventbox.sensitive = UserConfig[:proxy_enabled] == name
Mtk::group(radio, eventbox)
end
Index: core/configloader.rb
===================================================================
--- core/configloader.rb (リビジョン 398)
+++ core/configloader.rb (作業コピー)
@@ -26,17 +26,16 @@
@@configloader_pstore = nil
@@configloader_cache = Hash.new
@@configloader_queue = TimeLimitedQueue.new{ |data|
- detected = Set.new
+ detected = Array.new
ConfigLoader.transaction{
data.each{ |pair|
key, val = *pair
- if not detected.include?(key)
- detected << key
- begin
- ConfigLoader.pstore[key] = val
- rescue => e
- error e end end } }
- notice "configloader: wrote #{detected.size} keys (#{detected.to_a.join(', ')})"
+ detected << key
+ begin
+ ConfigLoader.pstore[key] = val
+ rescue => e
+ error e end } }
+ notice "configloader: wrote #{detected.size} keys (#{detected.join(', ')})"
}
# _key_ に対応するオブジェクトを取り出す。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.