Re: GVolumeMonitor refresh after writing to fstab [SOLVED]



Amit <amit.uttam <at> gmail.com> writes:



My current application adds an entry to fstab and then uses
GVolumeMonitor to get the list of volumes and then mounts the recently
added volume.

The problem is GVolumeMonitor does not see the recently added fstab
entry right away. Thus, I have to re-run the operation again.

OK solved it by doing the following:

 1. Connecting a signal to the volume monitor for *volume-added*.
        - This only works if the mount point is at /media/<...>
 2. Add an entry to fstab.
 3. Run the main loop.
 4. Async callback to finish write to fstab.
        - Don't quit the main loop here!
 5. The volume-added signal is triggered and does a callback to a function
        - Quit the main loop here.

This works as expected. Hope this helps anyone with similar issues.

Thanks,
Amit




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]