Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 310541 Details for
Bug 450618
Nautilus does not mount Ipods
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Now use signals
test.c (text/plain), 4.19 KB, created by
Laurent Aguerreche
on 2008-06-29 20:41:48 UTC
(
hide
)
Description:
Now use signals
Filename:
MIME Type:
Creator:
Laurent Aguerreche
Created:
2008-06-29 20:41:48 UTC
Size:
4.19 KB
patch
obsolete
>#include <glib.h> >#include <gio/gio.h> >#include <string.h> > >static void >treat_volumes( GDrive* drive ) >{ > if( g_drive_has_media( drive ) ) > { > g_print( "drive has media\n" ) ; > if( g_drive_is_media_check_automatic( drive ) ) > { > g_print( "is_media_check_automatic\n" ) ; > } > else > { > g_print( "NOT is_media_check_automatic\n" ) ; > } > } > else > { > g_print( "drive has not media\n" ) ; > } > > gchar** identifiers = g_drive_enumerate_identifiers( drive ) ; > if( identifiers ) > { > for( gchar** elm = identifiers ; *elm ; elm++ ) > { > gchar* identifier = *elm ; > g_print( "Identifier: %s\n", identifier ) ; > } > g_strfreev( identifiers ) ; > > gchar* identifier = g_drive_get_identifier( drive, "unix-device" ) ; > if( identifier ) > { > g_print( "Info about unix-device identifier: %s\n", identifier ) ; > g_free( identifier ) ; > } > identifier = g_drive_get_identifier( drive, "hal-udi" ) ; > if( identifier ) > { > g_print( "Info about hal-udi identifier: %s\n", identifier ) ; > g_free( identifier ) ; > } > } > > g_print( "Looking for volumes...\n" ) ; > GList* volumes = g_drive_get_volumes( drive ) ; > for( GList* a_volume = volumes ; a_volume ; a_volume = a_volume->next ) > { > GVolume* volume = a_volume->data ; > gchar* volume_name = g_volume_get_name( volume ) ; > g_print( "Volume name: %s\n", volume_name ) ; > g_free( volume_name ) ; > > g_print( "will try to mount it...\n" ) ; > GMount* mount = g_volume_get_mount( volume ) ; > if( mount ) > { > g_print( "Volume is mounted!\n" ) ; > } > } > g_list_free( volumes ) ; >} > >static void >drive_connected_cb( GVolumeMonitor* volume_monitor, > GDrive* drive, > gpointer user_data ) >{ > gchar* name = g_drive_get_name( drive ) ; > g_print( "Connected drive: %s\n", name ) ; > g_free( name ) ; > > if( g_drive_is_media_removable( drive ) ) > { > g_print( "It is removable\n" ) ; > } > else > { > g_print( "NOT removable\n" ) ; > } > > treat_volumes( drive ) ; >} > >static void >drive_changed_cb( GVolumeMonitor* volume_monitor, > GDrive* drive, > gpointer user_data ) >{ > gchar* name = g_drive_get_name( drive ) ; > g_print( "Changed drive: %s\n", name ) ; > g_free( name ) ; > > treat_volumes( drive ) ; >} > >static void >drive_disconnected_cb( GVolumeMonitor* volume_monitor, > GDrive* drive, > gpointer user_data ) >{ > gchar* name = g_drive_get_name( drive ) ; > g_print( "Disconnected drive: %s\n", name ) ; > g_free( name ) ; >} > >static void >volume_added_cb( GVolumeMonitor* volume_monitor, > GVolume* volume, > gpointer user_data ) >{ > gchar* name = g_volume_get_name( volume ) ; > g_print( "Volume added: %s\n", name ) ; > g_free( name ) ; >} > >static void >volume_changed_cb( GVolumeMonitor* volume_monitor, > GVolume* volume, > gpointer user_data ) >{ > gchar* name = g_volume_get_name( volume ) ; > g_print( "Volume changed: %s\n", name ) ; > g_free( name ) ; >} > >static void >volume_removed_cb( GVolumeMonitor* volume_monitor, > GVolume* volume, > gpointer user_data ) >{ > gchar* name = g_volume_get_name( volume ) ; > g_print( "Volume removed: %s\n", name ) ; > g_free( name ) ; >} > >int >main() >{ > g_type_init() ; > > GVolumeMonitor* monitor = g_volume_monitor_get() ; > > g_signal_connect( monitor, "drive-connected", > G_CALLBACK( drive_connected_cb ), NULL ) ; > g_signal_connect( monitor, "drive-changed", > G_CALLBACK( drive_changed_cb ), NULL ) ; > g_signal_connect( monitor, "drive-disconnected", > G_CALLBACK( drive_disconnected_cb ), NULL ) ; > > g_signal_connect( monitor, "volume-added", > G_CALLBACK( volume_added_cb ), NULL ) ; > g_signal_connect( monitor, "volume-changed", > G_CALLBACK( volume_changed_cb ), NULL ) ; > g_signal_connect( monitor, "volume-removed", > G_CALLBACK( volume_removed_cb ), NULL ) ; > > > GMainLoop* loop = g_main_loop_new( NULL, FALSE ) ; > g_main_loop_run( loop ) ; > > return 0 ; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 450618
:
310303
|
310304
| 310541