Forum: Ruby-Gnome 2 gio volume changed signal

Ff312ec21b0fd1d07c8708e29df7d242?d=identicon&s=25 Ebru Akagunduz (ebruakagunduz)
on 2014-02-15 17:40
Hi, I work on dynamic volume add-remove issue. I should detect which
device added and which one removed. I add to a hash mounted devices. I
do this:


# to add
@volume = Gio::VolumeMonitor.get
all_volumes = @volume.volumes
v0 = all_volumes.last.mount
devices_hash.store(v0.name, v0)

# to remove
@volume.signal_connect("volume-removed") do |vol|
index = devices_hash.values.index(vol)
...
..
.
.
end

I realized vol is not any v0. device_hash values doesn't include vol
value. So How can I get correctly which device removed and added?
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.