Monitoring connection or disconnection of removable storage using Gio::VolumeMonitor
- From: Mohith Manoj <mohith manoj skanray com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Monitoring connection or disconnection of removable storage using Gio::VolumeMonitor
- Date: Wed, 11 Mar 2020 12:04:01 +0530
Hi,
I need to detect when a removable storage device is connected, mounted, un-mounted and disconnected. Gio::VolumeMonitor appeared to be the right one, only that I am not able to receive any signal. This is what I had tried.
Glib::RefPtr<Gio::VolumeMonitor> refVolumeMonitor = Gio::VolumeMonitor::get();
refVolumeMonitor->signal_drive_changed().connect(<the_slot>);
refVolumeMonitor->signal_drive_connected().connect(<the_slot>);
refVolumeMonitor->signal_drive_disconnected().connect(<the_slot>);
refVolumeMonitor->signal_mount_added().connect(<the_slot>);
refVolumeMonitor->signal_mount_changed().connect(<the_slot>);
refVolumeMonitor->signal_mount_removed().connect(<the_slot>);
refVolumeMonitor->signal_volume_added().connect(<the_slot>);
refVolumeMonitor->signal_volume_changed().connect(<the_slot>);
refVolumeMonitor->signal_volume_removed().connect(<the_slot>);
The <the_slot> never gets called even when I connect, mount, un-mount or disconnect a USB thumb-drive.
Please consider the Environment before printing this e-mail.
The information contained in this message
(including any attachments) is confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended
recipient, you must not copy this message or attachment or disclose the
contents to any other person. If you have received this transmission in
error, please notify the sender immediately by return e-mail and
permanently delete this message and any attachments from your system.
Any dissemination, use, review, distribution, printing or copying of
this message in whole or in part is strictly prohibited. Please note
that e-mails are susceptible to change.
SKANRAY(including
its group of companies) shall not be liable for any omission or error
in the message, improper or incomplete transmission of the information
contained in this communication or for any delay in its receipt or
damage to your system. SKANRAY(or
its group of companies) does not guarantee that the integrity of this
communication has been maintained or that this communication is free of
viruses, interceptions or interference.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]