Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:xfdesktop:port-to-gio-progress [2010/10/19 13:22] 217.229.78.181dev:xfdesktop:port-to-gio-progress [2010/10/24 21:42] (current) 217.229.124.132
Line 23: Line 23:
  
 ==== xfdesktop-file-icon-manager.{c,h} ==== ==== xfdesktop-file-icon-manager.{c,h} ====
- 
-=== xfdesktop_file_icon_menu_mime_app_executed() === 
- 
-Use ''GAppInfo'' instead of ''ThunarVfsMimeApplication'' and call ''g_app_info_launch()'' 
-instead of ''thunar_vfs_mime_handler_exec()''. Make sure to change the working directory 
-before and after this call (similar to how Thunar does it). 
- 
-=== xfdesktop_menu_item_from_mime_handler() === 
- 
-Replace this method with a similar one based on ''GAppInfo'' instead of 
-''ThunarVfsMimeApplication'' 
- 
-=== xfdesktop_file_icon_menu_other_app() === 
- 
-Again, we only need the ''GFile'', not the file info, in order to obtain the file URI. 
-Replace ''xfdesktop_file_icon_peek_info()'' with ''xfdesktop_file_icon_get_file()'' 
-and ''ThunarVfsInfo''/''ThunarVfsPath'' with ''GFile''. 
- 
-=== xfdesktop_file_icon_menu_create_launcher() === 
- 
-Use a ''GFile'' instead of the ''ThunarVfsInfo'' and ''ThunarVfsPath'' to obtain 
-the file URI. Feed exo-desktop-item-edit with the URI instead of a local path. 
-The function ''launcher_dialog_item_button_clicked()'' in  
-xfce4-panel/plugins/launcher/launcher-dialog.c has an example of how we can do  
-this. 
- 
-=== xfdesktop_file_icon_create_file_error() === 
- 
-Remove this function. 
  
 === xfdesktop_file_icon_interactive_job_ask() === === xfdesktop_file_icon_interactive_job_ask() ===
  
 Remove this function. Remove this function.
- 
-=== xfdesktop_file_icon_template_item_activated() === 
- 
-TODO: This needs more thought. Thunar implements the same functionality, so 
-maybe we can reuse its implementation through D-Bus. If not, then at least 
-the ThunarVFS stuff should be replaced with ''GFile'' and ''GFileInfo''. The 
-calls to ''thunar_vfs_copy_file()'' and ''thunar_vfs_create_file()'' should 
-be replaced with Thunar D-Bus method calls. 
- 
-=== info_compare() === 
- 
-If this is still needed after the other refactorings, make it compare 
-''GFileInfo'' objects instead of ''ThunarVfsInfo'' structs. 
- 
-=== xfdesktop_file_icon_menu_fill_template_menu() === 
- 
-Use ''GFile'', ''GFileEnumerator'' and ''GFileInfo'' instead of the corresponding 
-ThunarVFS structures. Maybe we can reuse some code from Thunar implementing 
-the same thing. 
- 
-=== xfdesktop_file_icon_manager_populate_context_menu() === 
- 
-Use ''GFileInfo'' instead of ''ThunarVfsInfo'' and ''GFile'' instead of ''ThunarVfsPath''. 
-Use ''GAppInfo'' instead of ''ThunarVfsMimeDatabase'' and  
-''ThunarVfsMimeHandler''/''ThunarVfsMimeApplication''. 
- 
-=== xfdesktop_file_icon_manager_add_icon() === 
- 
-Use ''GFile'' instead of ''ThunarVfsInfo''. 
- 
-=== xfdesktop_file_icon_manager_add_regular_icon() === 
- 
-Use ''GFileInfo'' to query the content type and ''GFile'' instead of 
-''ThunarVfsPath'' to query the file path passed to ''XfceRc''. 
  
 === xfdesktop_file_icon_manager_add_volume_icon() === === xfdesktop_file_icon_manager_add_volume_icon() ===
  
 Use ''GVolume'' instead of ''ThunarVfsVolume''. Use ''GVolume'' instead of ''ThunarVfsVolume''.
- 
-=== xfdesktop_file_icon_manager_vfs_monitor_cb() === 
- 
-Replace this with a monitor callback for ''GFileMonitor''. 
- 
-=== xfdesktop_file_icon_manager_listdir_infos_ready_cb() === 
- 
-This function will have to be replaced with something similar because we 
-cannot use the list dir job from ThunarVfsJob anymore.  
- 
-=== xfdesktop_file_icon_manager_listdir_finished_cb() === 
- 
-This function will have to be replaced with something similar because we 
-cannot use the list dir job from ThunarVfsJob anymore.  
- 
-=== xfdesktop_file_icon_manager_listdir_error_cb() === 
- 
-This function will have to be replaced with something similar because we 
-cannot use the list dir job from ThunarVfsJob anymore.  
- 
-=== xfdesktop_file_icon_manager_load_desktop_folder() === 
- 
-Asynchronously load the folder using ''GFileEnumerator''. 
  
 === xfdesktop_file_icon_manager_volume_changed() === === xfdesktop_file_icon_manager_volume_changed() ===
Line 155: Line 69:
 === xfdesktop_file_icon_manager_real_init() === === xfdesktop_file_icon_manager_real_init() ===
  
-Get rid of the ''ThunarVfsMimeDatabase'' and the global ''ThunarVfsVolumeManager''+Get rid of the global ''ThunarVfsVolumeManager''.
-The hash table needs to use either URIs or ''GFile'' as well as the right hash +
-and equal functions for them. URIs are easier due to the availability of string +
-hash and equal functions, I guess. +
- +
-We'll have to change the ''ThunarVfsInfo'' parameter of ''xfdesktop_regular_file_icon_new()'' +
-to a ''GFile'' or ''GFileInfo''. We can use ''g_file_new_for_path()'' instead of  +
-''thunar_vfs_info_new_for_path()'' here when creating the ''GFile'' for the desktop folder, +
-if the ''folder'' member isn't a ''GFile'' already.+
  
 === xfdesktop_file_icon_manager_fini() === === xfdesktop_file_icon_manager_fini() ===
Line 190: Line 96:
 Replace the ''ThunarVfsMonitor'' with a ''GVolumeMonitor'' and remove  Replace the ''ThunarVfsMonitor'' with a ''GVolumeMonitor'' and remove 
 the ''ThunarVfsMonitorHandle''. the ''ThunarVfsMonitorHandle''.
- 
-Remove the ''ThunarVfsJob *list_job'' member. 
  
 ==== xfdesktop-file-properties-dialog.{c,h} ==== ==== xfdesktop-file-properties-dialog.{c,h} ====
Line 234: Line 138:
  
 Replace the ''ThunarVfsInfo *info'' member with ''GFile'' and ''GFileInfo'' members. Replace the ''ThunarVfsInfo *info'' member with ''GFile'' and ''GFileInfo'' members.
- 
-=== xfdesktop_regular_file_icon_peek_info() === 
- 
-Return a ''GFileInfo''. 
- 
-=== xfdesktop_regular_file_icon_update_info() === 
- 
-TODO: Replace the ''ThunarVfsInfo'' parameter with ''GFileInfo''. Maybe we also need 
-to add a ''GFile'' parameter because ''GFileInfo'' contains no path information. 
- 
-=== xfdesktop_delete_regular_file_finished() === 
- 
-Remove. 
- 
-=== xfdesktop_regular_file_icon_finalize() === 
- 
-Call ''g_object_unref()'' instead of ''thunar_vfs_info_unref()''. Also release the 
-new ''GFile'' member. 
- 
-=== xfdesktop_regular_file_icon_tfi_init() === 
- 
-Update this to Thunarx 2. Need to set ''iface->get_file_info'', ''iface->get_filesystem_info'' 
-and ''iface->get_location''. 
  
 === xfdesktop_regular_file_icon_peek_pixbuf() === === xfdesktop_regular_file_icon_peek_pixbuf() ===
Line 262: Line 143:
 Need to rewrite this to make use of ''g_file_get_icon()'' and tumbler. Maybe a new thumbnailer Need to rewrite this to make use of ''g_file_get_icon()'' and tumbler. Maybe a new thumbnailer
 or icon factory class like in thunar could be introduced. or icon factory class like in thunar could be introduced.
- 
-=== xfdesktop_regular_file_icon_get_allowed_drag_actions() === 
- 
-Use ''GFileInfo'' instead of ''ThunarVfsInfo''. Instead of ''ThunarVfsInfo'' flags we have 
-to query ''GFileInfo'' attributes to determine the readable/writable state of the target icon. 
- 
-=== xfdesktop_regular_file_icon_get_allowed_drop_actions() === 
- 
-See the previous function. 
  
 === xfdesktop_regular_file_icon_drag_job_error() === === xfdesktop_regular_file_icon_drag_job_error() ===
Line 305: Line 177:
  
 Here we can simply rewrite the code to use ''GFile'' and ''GFileInfo''. Here we can simply rewrite the code to use ''GFile'' and ''GFileInfo''.
- 
-=== xfdesktop_delete_file_error() === 
- 
-Remove. 
- 
-=== xfdesktop_delete_file_finished() === 
- 
-Remove. 
- 
-=== xfdesktop_regular_file_icon_delete_file() === 
- 
-Instead of ''thunar_vfs_unlink_file()'', use the Thunar D-Bus API here. Fire 
-and forget. 
- 
-=== xfdesktop_regular_file_icon_rename_file() === 
- 
-See previous function. 
  
 === xfdesktop_regular_file_icon_peek_info() === === xfdesktop_regular_file_icon_peek_info() ===
  
 Change the return type to ''GFileInfo''. Change the return type to ''GFileInfo''.
- 
-=== xfdesktop_regular_file_icon_update_info() === 
- 
-TODO: Check how and where this function is being used and what we can do in order 
-to replace the ''ThunarVfsInfo'' parameter. 
- 
-=== xfdesktop_regular_file_icon_new() === 
- 
-Add a ''GFile'' parameter, update the code to use ''g_object_ref()'' instead of 
-''thunar_vfs_info_ref()''. 
  
 ==== xfdesktop_special_file_icon.{c,h} ==== ==== xfdesktop_special_file_icon.{c,h} ====