Progress on ThunarVFS References in Thunar

… or: which ones are left.

Thunar

ThunarVFS is used almost everywhere inside Thunar. All appearances in the code have to be replaced with equivalent (or improved) implementations based on GIO. In order to do that, we first have to collect information about all the ThunarVFS references in the code. Afterwards, we can determine what to do with each reference.

It's probably a good idea to look at ThunarFolder/ThunarFile at the very end because I already have an idea on how to deal with them. Deciding what to do with the other ThunarVFS references first could have interesting implications on ThunarFolder/ThunarFile.

ThunarFile

Each instance of the ThunarFile class represents one file/node in the filesystem. It wraps both ThunarVfsPath and ThunarVfsInfo with a huge number of convenience functions and macros.

Of course all these functions could easily be ported to GIO. A number of function signatures will have to be changed to get rid of ThunarVFS references. However, we have to do something about blocking GFileInfo queries inside ThunarFile.

First of all, the constructor should be split up from

ThunarFile *thunar_file_get_for_info (ThunarVfsInfo       *info);
ThunarFile *thunar_file_get_for_path (ThunarVfsPath       *path, 
                                      GError             **error);
ThunarFile *thunar_file_get_for_uri  (const gchar         *uri,
                                      GError             **error);

into something like this:

ThunarFile *thunar_file_get          (GFile               *file);
gboolean    thunar_file_load         (ThunarFile          *file,
                                      GCancellable        *cancellable,
                                      GError             **error);

Maybe alternatively add an asynchronous way to load files:

void        thunar_file_load_async   (ThunarFile          *file,
                                      GCancellable        *cancellable,
                                      GAsyncReadyCallback *callback,
                                      gpointer             user_data);
gboolean    thunar_file_load_finish  (ThunarFile          *file,
                                      GAsyncResult        *result,
                                      GError             **error);
gboolean    thunar_file_is_loaded    (ThunarFile          *file);

main.c

Has references to

  • thunar_vfs_init()
  • thunar_vfs_shutdown()

Solution

Make sure to setup GIO correctly by following these steps:

  1. More?

Thunarx

Thunarx has a few references to ThunarVFS in ThunarxFileInfo which have to be replaced with GIO equivalents:

  • ThunarVfsInfo *thunarx_file_info_get_vfs_info (ThunarxFileInfo *file_info)
  • ThunarVfsInfo *(*get_vfs_info) (ThunarxFileInfo *file_info) in ThunarxFileInfoIface

Thunar Extensions

There is a number of extensions for Thunar, like

Most of them have references to ThunarVFS or rely on ThunarVFS to work (as is the case with thumbnailers which don't support GIO).

Thunar Volume Manager

thunar-volman uses ThunarVFS everywhere and will have to be ported to GIO as well.

 
implementation/thunar-vfs-references-progress.txt · Last modified: 2009/06/16 01:40 by jannis
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki