Jannis Pohlmann wrote:
> Hey Benny,

Hey Jannis,

> 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:
> 
>   [EMAIL PROTECTED] ~/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?

I cannot reproduce your problem. Attached is a complete example, please
check if that works.

> Regards,
> Jannis

Benedikt
#include <thunar-vfs/thunar-vfs.h>


int
main (int argc, char **argv)
{
  ThunarVfsInfo *file_info;
  ThunarVfsPath *path;
  GError        *error = NULL;

  gtk_init (&argc, &argv);
  g_thread_init (NULL);

  thunar_vfs_init ();

  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);
    if (G_LIKELY (file_info != NULL))
      {
        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));

        thunar_vfs_info_unref (file_info);
      }
  }

  thunar_vfs_shutdown ();

  return 0;
}
_______________________________________________
Thunar-dev mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/thunar-dev

Reply via email to