Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 3 years ago

Closed 3 years ago

#9509 closed Patch - Bug Fix (fixed)

MythGallery completely exits when pressing Escape inside a symlinked subdirectory

Reported by: mythtv@… Owned by: beirdo
Priority: minor Milestone: 0.25
Component: Plugin - MythGallery Version: 0.24-fixes
Severity: low Keywords:
Cc: Ticket locked: no

Description

I had some trouble with MythGallery not being able to move up one directory level when I press Escape. Instead it would exit MythGallery completely. I did some testing and figured out its due to a problem with the is_subdir() function in iconview.cpp

The function calls QDir::canonicalPath() on the parent and current directories, but this makes a directory with a symlink resolve to its actual patch. This is turn makes the indexOf() check fail.

Here's my setup.

/var/share/images is the base directory. /var/share/images/taz is a symlink to /mnt/taz/e/pictures. When you go into a subdirectory, such as /var/share/images/taz/2010/December and press Escape, it will exit completely because the is_subdir() commands converts /var/share/images/taz/2010/December to /mnt/taz/e/pictures/2010/December, which is no longer a subdirectory of /var/share/images.

The enclosed patch fixed this by using cleanPath() instead. It looks like the primary difference between cleanPath() and canonicalPath() is the resolving of symlinks (which doesn't seem necessary to me). I'm by no means a Qt expert, so I'm not sure if this is the best way to accomplish this.

Attachments (1)

dir_path_fix.patch (641 bytes) - added by mythtv@… 3 years ago.
Patch to fix directory name calculation

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by mythtv@…

Patch to fix directory name calculation

comment:1 Changed 3 years ago by beirdo

  • Status changed from new to assigned

comment:2 Changed 3 years ago by Github

  • Milestone changed from unknown to 0.25
  • Resolution set to fixed
  • Status changed from assigned to closed

Make mythgallery allow symlinked dir structure

Fixes #9509. Patch from the ticket.

Signed-off-by: Gavin Hurlbut <ghurlbut@…>

Branch: master
Changeset: bedc054074fff2e4d5d8807fad4d7906ab5f5d4b

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.