Bookmark name in thunar wrong when shortcut added on plugin

Bug #995634 reported by Brian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cairo-Dock Plug-ins
Fix Released
Undecided
Unassigned
cairo-dock-plug-ins (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I posted this in the forums but the thread is marked resolved so I thought I should report a bug and let you decide if it is an issue and to see if anyone can confirm the issue (personally I don't add shortcuts this way because if I have thunar open already it is just as easy to drag and drop in thunar's left pane but it came up during testing for someone's issue).

When I drop a folder on the shortcuts it gets added to both the shortcuts plugin and thunar but thunar shows an odd name. I tried it again yesterday (May 4th, 2012) and same thing, the bookmark was added, cairo-dock showed the correct name and opened the correct folder but thunar showed random characters for the name but opened the correct folder. All I had to do was right click in thunar and rename the bookmark and everything was fine. (I just tried a number of times and sometimes the name is fine but most times there are random names and/or characters showing in thunar)

xubuntu 11.04
cairo-dock 3.0 (added using ppa)
opengl
regular xfdesktop (no compiz)
Thunar 1.2.1

Revision history for this message
Brian (mycompostpile) wrote :

I updated my system so everything is up to date for xubuntu 11.04 and tried some more testing. I haven't figured out exactly what is going on but it looks like a buffering issue. I removed all bookmarks and started from scratch (several times). If the folder name of the one I am adding is longer than the previous (which is true for the very first one regardless) I get garbage characters for a name. If the folder name is shorter than the previous then the name that gets put in contains a string from the end of the previous name. No matter what though the previous names are corrected and it is only the current one that has issues.

So for example:

If I drag and drop a folder named "Some_Folder" as the first one what I see in thunar is garbage (or most likely, sometimes it works for a few).
If I then drag and drop a folder named "Music" the first one gets fixed and now shows "Some_Folder" in the thunar pane (so it is corrected) but the second one might show as "_Folder".
If I then do one named "cat" it might show as "er" and the first 2 are fine.
Adding a few more might be ok depending on their lengths and then I might get more cycling like the "_Folder" and "er" issue. Then depending on lengths of names I might get more garbage characters. In every case it is only the current new bookmark that has issues.

To confirm more that it is a buffer issue I tried adding a bookmark from thunar to see if the buffer was reset and it was. So say from the example above I added "cat" and what showed in thunar was "er" then I added the folder "Downloads" but used thunar to drag the folder to the side pane instead of onto the shortcut plugin then the "er" would not be fixed so I would have a list in thunar that shows "Some_Folder", "Music", "er" and "Downloads". If I then start adding bookmarks again using the shortcut plugin the issue restarts from the point on but the folder "er" does not get fixed and "Downloads" does not get affected (note: the "er" folder points to "cat" and if I manually rename it then everything is fine).

So this definitely looks like a buffer issue only in the name that gets sent to the file manager but not the directory path that gets sent to the file manager (or however the bookmark gets added to the file manager bookmarks)

Hope all this makes sense, it is hard to wrap your head around unless you see it in action and even then it took me many tries to figure out what was going on.

Revision history for this message
Fabounet (fabounet03) wrote :

Thanks for the many tests !
It seems like a bug in Thunar (since everything works in the dock, IIUC).

we can check that easily:
reproduce the problem (by dragging a folder on the Shortcuts applet, then notice that the new bookmark in Thunar has a wrong name).
then copy-paste here the content of the file .gtk-bookmarks (it's a hidden file in your home)

If there is no gargabe inside, then Thunar might have a bug.

then solve the problem by renaming the bookmark in thunar (now the name should be ok in both Thunar and the dock), and copy-paste the .gtk-bookmarks again.

Also, what if you add the bookmark from the dock, and then restart Thunar completely ?

Thanks in advance !

Revision history for this message
Brian (mycompostpile) wrote :
Download full text (3.8 KiB)

Thank you, that was my next step but I hadn't looked up what the bookmark file was yet. Thanks for making that much easier.

Long story short the shortcut plugin is sending a newline before it sends the file link to the .gtk-bookmarks file and no newline after the file link. Nautilus ignores this error but thunar and PCManFM do not.

The details of my testing are below:

With just 2 Folders in the thunar bookmark pane Downloads and Documents. When I do cat on the .gtk-bookmarks file it shows:

brian@gibralter:~$ cat .gtk-bookmarks
file:///home/brian/Downloads
file:///home/brian/Documents
brian@gibralter:~$

 I added the folder Conky by dragging to the shortcut plugin and the left pane in thunar shows Downloads, Documents and nts (instead of Conky. I have a screen shot if you need to see it -> bookmarks-debug1.png). Doing cat on .gtk-bookmarks shows that a new line was inserted before the Conky link and no new line was inserted after the conky link:

brian@gibralter:~$ cat .gtk-bookmarks
file:///home/brian/Downloads
file:///home/brian/Documents

file:///home/brian/Conkybrian@gibralter:~$

Notice that the command line returns to the end of the cat because there is no new line.

If I add Videos by dragging to the shortcut thunar shows Downloads, Documents, Conky, ts (instead of Videos. I have a screen shot if you need to see it -> bookmarks-debug2.png). Cat shows:

brian@gibralter:~$ cat .gtk-bookmarks
file:///home/brian/Downloads
file:///home/brian/Documents

file:///home/brian/Conky
file:///home/brian/Videosbrian@gibralter:~$

There is now a newline at the end of the Conky link (I presume it was put there ahead of the Videos link instead of after). If I now add a bookmark through thunar (drag Music to the left thunar pane) the newlines get reset but notice the link for the Video file. It has the "ts" at the end as if that is the name of the shortcut and in thunar the name for the Video bookmark is "ts" but the link is correct (I have a screen shot if you need to see it -> bookmark-debug3.png).

brian@gibralter:~$ cat .gtk-bookmarks
file:///home/brian/Downloads
file:///home/brian/Documents
file:///home/brian/Conky
file:///home/brian/Videos ts
file:///home/brian/Music
brian@gibralter:~$

If I now add a folder by dragging (openbravopos-database) to the shorcut plugin the newline issue is back (I have a screen shot if you need to see it -> bookmark-debug4.png). The name in thunar is garbage characters.

brian@gibralter:~$ cat .gtk-bookmarks
file:///home/brian/Downloads
file:///home/brian/Documents
file:///home/brian/Conky
file:///home/brian/Videos ts
file:///home/brian/Music

file:///home/brian/openbravopos-databasebrian@gibralter:~$

Now I tried the exact same steps with nautilus and here is the cat results before the dragging of the Music folder using nautilus dragging to the left pane. Notice that the drags to the shortcut plugin still results in the newline issue. Nautilus ignores this error and notice that using nautilus to drag to the left pane it puts the link and the shortcut name not just the link like thunar does. Nautilus even does the new line reset when I drag the Music folder over to the left pane and the newline returns whe...

Read more...

Revision history for this message
Brian (mycompostpile) wrote :

Sorry the nautilus cat didn't get added: If I do a cat on the .gtk-bookmarks file after doing the steps with nautilus it shows:

brian@gibralter:~$ cat .gtk-bookmarks
file:///home/brian/Downloads Downloads
file:///home/brian/Documents Documents

file:///home/brian/Conky
file:///home/brian/Videosbrian@gibralter:~$

There is still a newline issue when bookmarks are added through the shortcut plugin but Nautilus ignores the error and shows the bookmarks properly.

Sorry for the long post previously. I was going to just attach a file but didn't think it would be that long.

Revision history for this message
Fabounet (fabounet03) wrote :

Thanks again for the detailled tests !
I've fixed it as you said (removed the new line before and add a new line after, when you add and also remove a bookmark).
Hope it solves the problem with Thunar :-)

Changed in cairo-dock-plug-ins:
status: New → Fix Committed
Changed in cairo-dock-plug-ins:
status: Fix Committed → Fix Released
Changed in cairo-dock-plug-ins (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cairo-dock-plug-ins - 3.0.99.beta1-0ubuntu1

---------------
cairo-dock-plug-ins (3.0.99.beta1-0ubuntu1) quantal; urgency=low

  * New upstream beta release.
  * Upstream ChangeLog (main changes):
   - Better integration of Unity: support of the Launcher API and better
      support of indicators
   - All configuration windows have been merged into a single one.
   - Added progress bars in several applets and in the Dbus API
   - The Music Player applet can control players in the systray.
   - Icons of the taskbar can be separated from launchers or not
   - And as always ... various bug fixes and improvements :-)
  * Fixed one bug reported on Launchpad:
   - Bookmark name in thunar wrong when shortcut added on plugin (LP: #995634)
  * debian: Used 'wrap-and-sort' tool
  * debian/control:
   - Bump Cairo-Dock version
   - Updated my email address
  * debian/rules:
   - Added Disks, Global-Menu and Doncky applets.
  * debian/cairo-dock-plug-ins.install:
   - Added 'appmenu-registrar' ('Global-Menu' applet)
      and 'cairo-dock-unity-bridge' ('Dbus' applet)
 -- Matthieu Baerts (matttbe) <email address hidden> Sun, 19 Aug 2012 00:37:51 +0200

Changed in cairo-dock-plug-ins (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.