From 39e07a9256956a5f6af606375a679915d4e35215 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 22 Dec 2016 12:09:44 -0500 Subject: Fix an issue with ZFS snapshot finding where the directory path of interest needs to be converted into the canonical path (evaluate all symlink redirects) first before the ZFS snapshot finder does it's work. --- src-qt5/desktop-utils/lumina-fm/DirData.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fm/DirData.h') diff --git a/src-qt5/desktop-utils/lumina-fm/DirData.h b/src-qt5/desktop-utils/lumina-fm/DirData.h index c887ed5c..528a82d6 100644 --- a/src-qt5/desktop-utils/lumina-fm/DirData.h +++ b/src-qt5/desktop-utils/lumina-fm/DirData.h @@ -78,17 +78,18 @@ public: } void findSnapDir(){ + QString canonpath = QDir(dirpath).canonicalPath(); //Search the filesystem - if(dirpath.contains(ZSNAPDIR)){ - snapdir = dirpath.section(ZSNAPDIR,0,0)+ZSNAPDIR; //no need to go looking for it + if(canonpath.contains(ZSNAPDIR)){ + snapdir =canonpath.section(ZSNAPDIR,0,0)+ZSNAPDIR; //no need to go looking for it }else if(mntpoints.isEmpty()){ snapdir.clear(); //no zfs dirs available }else{ //Only check the mountpoint associated with this directory QString mnt; for(int i=0; imnt.length()){ mnt = mntpoints[i]; } + if(canonpath == mntpoints[i]){ mnt = mntpoints[i]; break; } + else if(canonpath.startsWith(mntpoints[i]) && mntpoints[i].length()>mnt.length()){ mnt = mntpoints[i]; } } if(QFile::exists(mnt+ZSNAPDIR)){ snapdir = mnt+ZSNAPDIR; } else{ snapdir.clear(); } //none found -- cgit