ThunarVFS vs. GIO

Equivalents / Replacements

ThunarVFS GIO Solution
ThunarVfsDeepCountJob Rewrite as ThunarDeepCountJob
ThunarVfsFileSize guint64 Replace
ThunarVfsFileTime guint64 Replace
ThunarVfsFileType GFileType Replace
ThunarVfsGroup Rename to ThunarGroup
ThunarVfsInfo GFileInfo Replace
ThunarVfsJob Rewrite as ThunarJob
ThunarVfsMimeApplication GAppInfo Replace
ThunarVfsMimeDatabase GAppInfo Replace
ThunarVfsMonitor GFileMonitor Replace
ThunarVfsPath GFile Replace
ThunarVfsSimpleJob Rewrite as ThunarSimpleJob
ThunarVfsThumbFactory Rewrite as ThunarThumbnailFactory
ThunarVfsTransferJob Rewrite as ThunarTransferJob
ThunarVfsUser Rename to ThunarUser
ThunarVfsUserManager Rename to ThunarUserManager
ThunarVfsVolume GVolume/GMount/GDrive Replace
ThunarVfsVolumeManager GVolumeMonitor Replace

Sync vs. Async

ThunarFile       *file = thunar_file_get_for_path ("/home/jannis/test.txt");
ThunarVfsFileSize size = thunar_file_get_size (file);


GFile     *file = g_file_new_for_path ("/home/jannis/test.txt");
GFileInfo *info = g_file_query_info (file, "standard::*", G_FILE_QUERY_INFO_NONE, cancellable, &error);
guint64    size = g_file_info_get_size (info);


file_info_ready_cb (GObject      *source_object,
                    GAsyncResult *result,
                    gpointer      user_data)
  GError    *error = NULL;
  GFileInfo *info;

  info = g_file_query_info_finish (G_FILE (source_object), result, &error);

GFile *file = g_file_new_for_path ("/home/jannis/test.txt");
g_file_query_info_async (file, "standard::*", G_FILE_QUERY_INFO_NONE, 0, cancellable, file_info_ready_cb, user_data);

Singleton vs. Per-File

ThunarVfsMonitor       *monitor = thunar_vfs_monitor_get_default ();
ThunarVfsMonitorHandle *handle = thunar_vfs_monitor_add_file (monitor, path, callback, user_data);


GFileMonitor *monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, cancellable, &error);

Jobs vs. Low-level Functions

ThunarVFS has a job framework based on the ThunarVfsJob base class. It has implementations for tasks like

  • determining the total size and number of children of a file or directory,
  • copying directories recursively,
  • and many more.

GIO only has per-file functions like g_file_copy_async() which don't work recursively. As a consequence, the job framework will have to be moved into Thunar. This will most likely require all jobs to be rewritten based on GIO. It's very likely that the job framework has to be redesigned beforehand, due to the asynchronous APIs in GIO.

Built-In Thumbnailing vs. Do-It-Yourself

With ThunarVfsThumbFactory, ThunarVFS has built-in support for generating file thumbnails using thumbnailers like those provided with the thunar-thumbnailers package. All GIO does is looking in $HOME/.thumbnails/ for available thumbnails. It has no support for generating them.

We'll have to move ThunarVfsThumbFactory and related code into Thunar or, even better, into exo.

preparation/thunar-vfs-vs-gio.txt · Last modified: 2009/04/08 19:04 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