[Thunar-dev] ThunarVfsInfo: Bug in thunar_vfs_info_new_for_path?

Jannis Pohlmann info at sten-net.de
Wed Feb 1 03:14:02 CET 2006


Hey Benny,

I played around with thunar-vfs today, because I wanted to look into
file monitoring in general (but not using low-level FAM/Gamin). The
program I'm using for these tests is rather simple: It tries to open a
GTK window in order to display information about argv[1] there. Here's a
rough excerpt of it doing the most important stuff:

  path = (argc > 1) ? thunar_vfs_path_new (argv[1], &error) : NULL;

  if (G_LIKELY (path != NULL)) {

    fprintf (stderr, "Path name (before info): %s\n",
             thunar_vfs_path_get_name (path));

    file_info = thunar_vfs_info_new_for_path (path, &error);

    fprintf (stderr, "Path name (after info): %s\n",
             thunar_vfs_path_get_name (file_info->path));

    thunar_vfs_path_unref (path);

    fprintf (stderr, "Path name (after path unref): %s\n",
             thunar_vfs_path_get_name (file_info->path));

  }

So, basically, I create a new ThunarVfsPath object from argv[1] and try
to acquire the ThunarVfsInfo based on it. What I noticed now is that the
path data is lost after the thunar_vfs_info_new_for_path call. Here's
the output:

  jannis at nebelsee ~/Projects/Aye/src>./aye /tmp/XmlIniFile.html
  Path name (before info): XmlIniFile.html
  Path name (after info):
  Path name (after path unref):

The file /tmp/XmlIniFile.html exists and the GError variable 'error' is
NULL, even after the initialization of file_info; so I guess this may be
a bug.

Any ideas?

Regards,
Jannis



More information about the Thunar-dev mailing list