diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-15 15:06:16 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-15 15:06:16 -0400 |
commit | a5ad810c71396f476be4fe64d5f4e239237fd7d5 (patch) | |
tree | be0b10d5bff4f75ee9739e7831ad7adbbf4422f8 | |
parent | Add another upgrade rule for 0.8.6->0.8.7: (diff) | |
download | lumina-a5ad810c71396f476be4fe64d5f4e239237fd7d5.tar.gz lumina-a5ad810c71396f476be4fe64d5f4e239237fd7d5.tar.bz2 lumina-a5ad810c71396f476be4fe64d5f4e239237fd7d5.zip |
Filter out any empty snapshots from the ZFS snapshot detection backend.
-rw-r--r-- | lumina-fm/DirData.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lumina-fm/DirData.h b/lumina-fm/DirData.h index 49a9beef..cd5db81a 100644 --- a/lumina-fm/DirData.h +++ b/lumina-fm/DirData.h @@ -156,6 +156,12 @@ public slots: base = HASH.value(dirpath).snapdir; QDir dir(base); snaps = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time |QDir::Reversed ); + //Also remove any "empty" snapshots (might be leftover by tools like "zfsnap") + for(int i=0; i<snaps.length(); i++){ + dir.cd(base+"/"+snaps[i]); + //qDebug() << "Snapshot Dir Contents Count:" << dir.count() << snaps[i]; + if(dir.count() < 3 && dir.exists() ){ snaps.removeAt(i); i--; } // "." and ".." are always in the count + } //NOTE: snaps are sorted oldest -> newest } |