! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
When repeatedly inserting/removing a USB stick, file->info can get out of date.
Status:
RESOLVED: FIXED

Comments

Description NeilBrown 2012-07-26 09:25:55 CEST
Try this experiment:
With "thunar --daemon" running, insert and remove a usb stick repeatly (waiting between events for thunar to catch up) until the insert operation doesn't cause a new window to pop up.  This usually takes me 2 or 3 attempts.

Then double click on the name of mountpoint in the listview of one of the open windows.  For me, this runs nautlius to view the folder!!

The problem is that the file->info becomes NULL at some point when the name doesn't exist, and this gets cached and not refreshed.

I fixed it with the following patch.
You can also find it at https://github.com/neilbrown/thunar.git in the
'folder-destroy' branch.
There are a few other patches in there that I would like to recommend to you.  I can open new bugzilla entries for them it you like.

Thanks.

My Patch:

diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 9509600..ad7915b 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -621,6 +621,8 @@ thunar_file_get (GFile   *gfile,
     {
       /* take a reference for the caller */
       g_object_ref (file);
+      if (file->info == NULL)
+             thunar_file_load (file, NULL, NULL);
     }
   else
     {
Comment 1 Nick Schermer editbugs 2012-10-29 11:44:50 CET
This should be fixed now ThunarFiles are destroyed when not "visible", other references only keep the GFile.
Comment 2 Harald Judt editbugs 2015-02-21 13:48:34 CET
Closing fixed.

Bug #9160

Reported by:
NeilBrown
Reported on: 2012-07-26
Last modified on: 2015-02-21

People

Assignee:
Jannis Pohlmann
CC List:
2 users

Version

Attachments

Additional information