[mythtv-commits] Ticket #9509: MythGallery completely exits when pressing Escape inside a symlinked subdirectory
MythTV
noreply at mythtv.org
Mon Jan 24 05:42:22 UTC 2011
#9509: MythGallery completely exits when pressing Escape inside a symlinked
subdirectory
--------------------------------------+------------------------
Reporter: mythtv@… | Owner: beirdo
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: unknown
Component: Plugin - MythGallery | Version: 0.24-fixes
Severity: low | Keywords:
Ticket locked: 0 |
--------------------------------------+------------------------
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.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/9509>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list